6lackknightOriginal post
Rank 1: Thread
Could someone point me in the right direction I'm going in cirlces. I have a problem with sdks and my self-hosted server in production (for ~3 years) I have been having issues with sdks where they start throwing a 404, from the python, node/Web or Dart/Flutter client or server sdks. This has carried over to the latest version of both server and sdks.
const appwrite = new Client()
.setEndpoint(APPWRITE_ENDPOINT) // Your API Endpoint
.setProject(APPWRITE_PROJECT) // Your project ID
.setKey(APPWRITE_API_KEY); // Your secret API key
const databases = new Databases(appwrite);
databases.listDocuments('content_db', 'post_col').then(console.log).catch(console.error);
databases.list().then(console.log).catch(console.error);
What's weird is that I can run other DB operations, like in the test code above above listing DBs work but subsequently listing documents fails with a document not found:
Listening on http://0.0.0.0:8000/
AppwriteException: Database not found
at _Client.call (file:///Users/tawandabrandon/Library/Caches/deno/npm/registry.npmjs.org/node-appwrite/17.0.0/dist/client.mjs:293:13)
at eventLoopTick (ext:core/01_core.js:177:7) {
name: "AppwriteException",
code: 404,
type: "database_not_found",
response: '{"message":"Database not found","code":404,"type":"database_not_found","version":"1.7.4"}'
}
{
total: 5,
databases: [
{
"$id": "content_db",
name: "content",
"$createdAt": "2023-03-15T06:48:23.060+00:00",
"$updatedAt": "2023-09-18T20:18:41.047+00:00",
enabled: true
},
{
"$id": "channel_db",
name: "channels",
"$createdAt": "2023-03-15T07:04:32.835+00:00",
"$updatedAt": "2023-09-18T20:18:41.051+00:00",
enabled: true
},
...
]
Summary
Developers are experiencing a problem with SDKs where document operations fail while other DB operations work. The error message indicates the database is not found, despite listing databases successfully. The issue persists across different client and server SDKs, even on the latest versions.