Back

Only one specific collection does not save the document. 500 error

  • 0
  • Databases
  • Web
  • Cloud
Roman Shamin
4 Feb, 2024, 15:26

sdk.js:124

TypeScript
   POST https://cloud.appwrite.io/v1/databases/||64667b35b7bd81b5d513||/collections/||64667be5ae8987f11e76||/documents 500 (Internal Server Error)

(anonymous) @ browser-ponyfill.js:518 fetch @ browser-ponyfill.js:455 (anonymous) @ client.ts:408 (anonymous) @ tslib.es6.js:76 __awaiter @ tslib.es6.js:72 call @ client.ts:361 (anonymous) @ databases.ts:96 (anonymous) @ tslib.es6.js:76 __awaiter @ tslib.es6.js:72 createDocument @ databases.ts:63 (anonymous) @ sdk.js:124 asyncGeneratorStep @ asyncToGenerator.js:3 _next @ asyncToGenerator.js:22 (anonymous) @ asyncToGenerator.js:27 (anonymous) @ asyncToGenerator.js:19 createDocument @ sdk.js:118 onSaveIngridient @ IngridientModal.js:58 onClick @ PressResponder.js:348 callCallback @ react-dom.development.js:4164 invokeGuardedCallbackDev @ react-dom.development.js:4213 invokeGuardedCallback @ react-dom.development.js:4277 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291 executeDispatch @ react-dom.development.js:9041 processDispatchQueueItemsInOrder @ react-dom.development.js:9073 processDispatchQueue @ react-dom.development.js:9086 dispatchEventsForPlugins @ react-dom.development.js:9097 (anonymous) @ react-dom.development.js:9288 batchedUpdates$1 @ react-dom.development.js:26140 batchedUpdates @ react-dom.development.js:3991 dispatchEventForPluginEventSystem @ react-dom.development.js:9287 dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465 dispatchEvent @ react-dom.development.js:6457 dispatchDiscreteEvent @ react-dom.development.js:6430 Show 30 more frames Show less sdk.js:136 AppwriteException: Server Error at Client.<anonymous> (http://localhost:19006/static/js/bundle.js:173596:27) at Generator.next (<anonymous>) at fulfilled (http://localhost:19006/static/js/bundle.js:173227:58)

TL;DR
Developer is experiencing a 500 internal server error when trying to create a document in a specific collection. They are able to read the collection and have the necessary permissions. The error occurs when using the `createDocument` method, which is successfully used for other collections without a problem. The specific piece of code that throws the error is not provided in the message. Solution: There is no specific solution provided in the support thread. However, the developer may need to investigate the server-side logs or contact the Appwrite support team to determine the cause of the internal server error and resolve the issue.
kamal.panara
4 Feb, 2024, 15:36

Can you share the piece of code which throws this error?

Roman Shamin
4 Feb, 2024, 15:41

export const createDocument = async ( collectionId, data, setCollection, abortableRequest ) => { const promise = databases.createDocument( DATABASE_ID, collectionId, ID.unique(), data ) ....

const onSaveIngridient = () => { createDocument( '64667be5ae8987f11e76', { DefaultMeasure: 'гр', Name: 'Test' }, () => { navigation.navigate('IngridientsNavigator') }, abortableRequest ) setData({}) }

Roman Shamin
4 Feb, 2024, 15:45

createDocument is common method that is used for other collections in which there is no error

Roman Shamin
4 Feb, 2024, 15:47

I can read this collection, but I cannot create or update it. Create and delete permissions are set

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more