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
- Self hosted project based backup
Is there a native way to perform a project-level backup in a self-hosted instance, instead of backing up the entire Docker instance? If not, I would like to off...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...