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
- [Regression] Appwrite 25.1.0 returns Inv...
I've already opened an issue on GitHub, but somewhat it doesn't seem like GitHub is monitored very closely, so I'm leaving a bug report here on Discord as well....
- Can't really use the S3 storage device
hi, I've linked my local MinIO Instance (it's just for testing, not for prod.) to my appwrite instance, when i'm uploading a file it's getting uploaded to the S...
- Next.js SSR Site Times Out on First Visi...
Hey everyone, I'm running a Next.js SSR site on a self-hosted Appwrite server (v1.9.0), and I've noticed a strange behavior that I'm hoping someone can help me...