Back

Random error during function execution: "Error: fetch failed"

  • 0
  • Functions
  • Cloud
memoonlite
11 Oct, 2024, 17:26

Hi! πŸ‘‹πŸ» I'm using Appwrite Cloud and sometimes I randomly get a "fetch failed" error while executing a function:

TypeScript
    at Client.call (/usr/local/server/src/function/node_modules/node-appwrite/lib/client.js:195:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Databases.listDocuments (/usr/local/server/src/function/node_modules/node-appwrite/lib/services/databases.js:1658:16)
    at async Module.default (file:///usr/local/server/src/function/src/index.js:42:35)
    at async execute (/usr/local/server/src/server.js:208:16)
    at async action (/usr/local/server/src/server.js:225:7)
    at async /usr/local/server/src/server.js:14:5```

Running the function again makes it time out:

```Synchronous function execution timed out. Use asynchronous execution instead, or ensure the execution duration doesn't exceed 30 seconds.
Error Code: 408```

The line that is referred to in the exception:

```database.listDocuments('5445545454454545', '3298329823923', [Query.equal('$id', user_id),]);```

This error rarely occurs. But when it does, it happens randomly and at random parts of the code. This potentially causes inconsistencies in my database. Because the function basically errors out in the middle of an operation and it's unpredictable when/where it happens.

Extra information: I don't use a custom domain or anything and I've never added/deleted/changed anything there. It's the default configuration.

Any idea what causes this problem?
TL;DR
Developers experiencing random "fetch failed" errors during function execution, causing inconsistencies in the database. Error occurs randomly and not consistently reproducible. A patch was added to mitigate the issue, but it may still happen. Ensure to report any future occurrences. Runtime version is node-18.0, using `"node-appwrite": "^12.0.1"`.
Steven
11 Oct, 2024, 18:02

is it still happening?

memoonlite
11 Oct, 2024, 18:15

No, it seems to be working fine again now. It happened randomly before, but it happens rarely. That makes it difficult to find out what causes it I think. ☹️ Either way, I'll report it here again if I ever notice that this error occurred again.

faye
11 Oct, 2024, 18:17

Still happening, but randomly. Added context here: <#1288301421447352330>

darShan
12 Oct, 2024, 04:42

what runtime version?

memoonlite
12 Oct, 2024, 09:53

I'm using "node-appwrite": "^12.0.1",.

memoonlite
12 Oct, 2024, 09:55

Runtime version is node-18.0.

Eldad
12 Oct, 2024, 09:56

@memoonlite we added a patch to try and mitigate this issue, please let us know if you still see this,

memoonlite
12 Oct, 2024, 09:57

That's great to hear! πŸ‘πŸ»πŸ‘πŸ»

memoonlite
12 Oct, 2024, 09:57

Sure. πŸ‘πŸ»πŸ‘πŸ» I'm going to do a lot of development again today and I'll report it here if it happens again.

faye
12 Oct, 2024, 11:46

Seems fixed

memoonlite
13 Oct, 2024, 17:13

Unfortunately not. ☹️ It just happened a few seconds ago.

memoonlite
13 Oct, 2024, 17:15

This error just occurred again:

TypeScript
    at Client.call (/usr/local/server/src/function/node_modules/node-appwrite/lib/client.js:195:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Databases.listDocuments (/usr/local/server/src/function/node_modules/node-appwrite/lib/services/databases.js:1658:16)
    at async Module.default (file:///usr/local/server/src/function/src/index.js:42:35)
    at async execute (/usr/local/server/src/server.js:208:16)
    at async action (/usr/local/server/src/server.js:225:7)
    at async /usr/local/server/src/server.js:14:5```

It happens completely randomly.
Eldad
13 Oct, 2024, 17:16

I'll share with our team. Can you tell at which time didn't happen?

memoonlite
13 Oct, 2024, 17:17
memoonlite
13 Oct, 2024, 17:17

This is the execution log.

memoonlite
13 Oct, 2024, 17:19

It's the first time that it happened today. It rarely occurs.

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