Back

Error 520

  • 0
  • Self Hosted
Hugo ;)
3 May, 2024, 20:32

Hey, my node JS app randomly crash with the following error

TypeScript
/root/AdFront/backend/node_modules/node-appwrite/lib/client.js:204
            throw new AppwriteException(text, response.status, "", text);
                  ^

AppwriteException [Error]: error code: 520
    at Client.call (/root/AdFront/backend/node_modules/node-appwrite/lib/client.js:204:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Databases.listDocuments (/root/AdFront/backend/node_modules/node-appwrite/lib/services/databases.js:1658:16)
    at async Timeout.UpdateImg [as _onTimeout] (/root/AdFront/backend/index.js:126:18) {
  code: 520,
  type: '',
  response: 'error code: 520'
}

Node.js v21.6.1

I'm confused as this is the first time I see this error and the documentation dont mention it, and it seems to crash after a certain amount of time

Here's the line 126 of the code

TypeScript
    const response = await databases.listDocuments("ads_db", "ads_list", [Query.equal('index', currentIndex)]);

Cheers

TL;DR
Error 520 is related to Cloudflare, not Appwrite. It's likely a network issue. The App randomly crashes after some time. Make sure Cloudflare settings are configured correctly.
Binyamin
3 May, 2024, 20:34

Are you using Cloudflare? seems like error 520 has something to do with them. Appwrite itself doesn't produce error 520

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