Back

Database Not Found

  • 0
  • Self Hosted
  • Functions
  • Databases
6lackknight
25 Aug, 2024, 03:10

I've had this error in the past, last week perhaps. But by the time I got responses, the I could not recreate the issue since I had just reverted back to a backup. But it's back now. I keep getting error "Database not Found" using code in a function that worked a few days ago.

Steps to reproduce:

  1. Setup self-signed node-appwrite@13.0.0 sdk.Client() with ENV vars.
  2. Ensure API key has access to DB, full R+W permissions
  3. Try to access DB / Collection / Document from project

I have attached the error messages and the setup I have without revealing too much. I have double crosschecked ENV vars (Key, endpoint). I have double checked permissions. Just like last time, If I however try to do the same using REST API, it succeeds.

I may be missing something small here, is this a known issue in v1.5.7

TL;DR
Developers are receiving a "Database Not Found" error when trying to access documents in a project. The issue might be related to the function call and error message discrepancy. One developer suggested checking the `client.config` with `JSON.stringify`. Ensure the setup, permissions, and environment variables are correct. There's a mention of a similar past error that was resolved by reverting to a backup. Using the REST API instead of the SDK seemed to work. The missing attachments may need their extensions fixed. The issue might be due to a known bug in version 1.5.7.
Steven
25 Aug, 2024, 03:12

Womp. These attachments are missing the extension in the name so they don't open right on my phone 😕 can you put the extensions back?

6lackknight
25 Aug, 2024, 03:28

Oh my bad, here you go:

6lackknight
25 Aug, 2024, 03:36

and if you wondering if db exists...

Steven
25 Aug, 2024, 03:37

Can you try logging JSON.stringify(client.config) right before the list documents?

Steven
25 Aug, 2024, 03:38

The error in your docker logs is odd because it's for the get document call, not list documents 🧐

Steven
25 Aug, 2024, 03:39

And the error is document can't be found. Not database not found

6lackknight
25 Aug, 2024, 03:45

Yeah it's weird, because the function call gives DB not found but I am calling listDocuments

Steven
25 Aug, 2024, 03:45

The function error is database not found as expected. Something else is calling get document 🧐

6lackknight
25 Aug, 2024, 03:50

Could be from the other projects running? This one specifically is trying to list all documents.

I also managed to print out the config just:

TypeScript
----------------------------------------------------------------------------
Unsupported logs detected. Use context.log() or context.error() for logging.
----------------------------------------------------------------------------
{"endpoint":"https://xxx/v1/","project":"xxx","key":"xxxx","jwt":"","locale":"","session":"","forwardeduseragent":""}

----------------------------------------------------------------------------

redacted url and keys

6lackknight
25 Aug, 2024, 03:52

client.config seems to have both url, and key correctly

Steven
25 Aug, 2024, 03:53

Try changing the endpoint to not have that trailing slash

Steven
25 Aug, 2024, 03:56

Hopefully you're hitting the right server

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more