Invalid `documentId` param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and un
- 0
- Databases
- Flutter
- Self Hosted
in Flutter App i have a class, let's call it the car class.
i create a new Car:
Car( id: ID.unique(), created: true, )
and on other place there is a function which is called: if car.created == true:
...databases.createDocument( databaseId: ENV.APPWRITE_DB, collectionId: ENV.CAR_COLLECTION, documentId: car.id, data: car.toAppwrite(), );
my problem is: i get this error in return:
AppwriteException: general_argument_invalid, Invalid documentId param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore (400)<…>
would be great for any solutions and explanations of the reason.
What does your car ID look like ?
Would help if you print the value of car.id before you make the call to createDocument()
i get: "unique()" in return
are you able to open your app on the browser and inspect the network request?
hm, i can try to check it with the dev tools
yea that would be helpful 👍
request uri: https://appwrite.domain.com/v1/databases/alpha_db/collections/car/documents/unique() method: PATCH status: 400
request: {"data":{"title":"test2"}}
response: {"message":"Invalid documentId param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore","code":400,"type":"general_argument_invalid","version":"1.4.13"}
You;re hitting the updateDocument endpoint as indicated by the PATCH method
so you're trying to update a document with id unique() which does not exist
lol you right
Hope that solves the problem ?
yes, thank you very much
No worries 👌
Recommended threads
- Export, Import or Migration giving this ...
As you can see in yhe screenshot i am not able to export any data or export the data from tables. Also it is affecting the migration from appwrite to appwrite h...
- local (self-hosted) sites issues
setup: - `composer run installer:dev` issues - Getting error when visiting the site ```Synchronous function execution timed out. Use asynchronous execution in...
- Error With iOS Apps
I keep getting the below errors for my flutter app. The clients are registered and have been. This wasn't an issue a few hours ago. AppwriteException: AppwriteE...