Hey, i'm using this code to create a database, then create a collection in it, but it return this :
Here's the code
const Creation_DB = databases.create(databaseId, databaseName);
const Info_Creation = databases.createCollection(databaseId, `${databaseId}_INFO`, 'Informations');
await Creation_DB;
await Info_Creation;
And here's the error that docker compose logs give me [Error] Timestamp: 2024-03-20T21:32:06+00:00 appwrite | [Error] Method: POST appwrite | [Error] URL: /v1/databases/:databaseId/collections appwrite | [Error] Type: Utopia\Database\Exception\Structure appwrite | [Error] Message: Invalid document structure: Missing collection attribute $collection appwrite | [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php appwrite | [Error] Line: 3070
That, or sometimes it throws me a 404 database not found while it does exist
Adding await delay(5000); seems to help, maybe the database hasnt been created at the time where im trying to do the request ?
(that's weird thought, i'm using async / awaits)
What's your appwrite version and your SDK version?
1.5.3
Yes, could be π€
From what I understand, you're basically in info_creation, creating a collection inside the database created in creation_db?
yea
im basically trying to create a collection inside the database i just made
Where does database id come from?
an arg
basically it's something along thoses lines
db_username_projectname_accountid
The function returns when the create database request has been added to the queue, but that doesn't necessarily mean it's actually been created yet
Recommended threads
- Unable to Migrate from Selfhosted 1.9.5 ...
I am trying to migrate my Appwrite to the cloud however it keeps failing. Errors in the Appwrite cloud logs say: { "$id": "6a4a0b2767ba6cf5348f", "$creat...
- image: openruntimes/executor:0.25.1 erro...
*this issue is not new and did happen on older versions using 0.7.22 removes the issue log ```ruby #2 /usr/local/app/http.php(78): Utopia\Http\Http->start() ...
- Executor with custom S3 doesn't work in ...
Was testing to upgrade appwrite to 1.9.5 and when testing the S3 part i saw the executor didn't work anymore. When looking closly i saw the `StorageFactory` doe...