Back

Operation timed out after 30000 milliseconds with 0 bytes received with status code 0\nError Code: 0

  • 0
  • Self Hosted
  • Functions
Nour
30 Oct, 2023, 15:20

When executing a function from the Appwrite SDK, I encountered an error message that reads ‘Operation timed out’ if the function takes longer than 30 seconds to complete. However, when I executed the same function from my server console, I did not encounter this error even it takes longer than 30s to executed. I have come across similar issues before, but none of the solutions I found worked for me. my docker compose exec appwrite vars shows : and docker logs appwrite shows:

TL;DR
The user is experiencing a timeout error when executing a function from the Appwrite SDK that takes longer than 30 seconds to complete. They have tried using asynchronous executions and listening to the database in real-time, but the issue persists. They mention the concept of parallel execution and suggest that the last user has to wait a long time to be served. The user later confirms that asynchronous executions worked for them. Solution: The user resolved the issue by using asynchronous executions.
Drake
30 Oct, 2023, 19:02

Synchronous executions have a hard timeout of 30s

Drake
30 Oct, 2023, 19:02

You can try executing it with async set to true

Nour
1 Nov, 2023, 06:43

Is this mentioned in the Appwrite documentation or somewhere else?

Nour
1 Nov, 2023, 06:43

I tried again with asynchronous executions, and it works now.

Nour
1 Nov, 2023, 06:48

Thanks for your support!

Nour
1 Nov, 2023, 06:48

I have another question If one user calls or executes a function, should other users wait until the function is executed by the first user?

Nour
1 Nov, 2023, 07:40

ex: If 1000 users call a specific function that requires 10 seconds to complete, should the last user wait until all previous executions are finished based on the Appwrite worker execution design?

Drake
1 Nov, 2023, 15:00

no need to wait. async functions get queued

Nour
2 Nov, 2023, 07:10

What I’m facing an issue where 10 users are executing the same function that requires 10 seconds to complete at the same time. As a result, the last user has to wait 100 seconds to be served. I tried using asynchronous executions and listening to the database in real-time whenever an execution is completed in the client.

Nour
2 Nov, 2023, 07:18

I think the execution queue here is following the first-in-first-out principle, so I need parallel execution.

Drake
2 Nov, 2023, 18:30

If it's only 10 seconds and they need the result right away, you can execute synchronously

Drake
2 Nov, 2023, 18:30

Yes, that is correct

Nour
7 Nov, 2023, 12:41

I am really sorry for the late reply. I had some exams at university.

Nour
7 Nov, 2023, 14:02

Anyway, I know that. but they are executing the same function at the same time, so the last user had to wait 100 seconds to be served based on the first-in-first-out principle which Appwrite execute worker uses. I think I need the parallel execution concept here to execute multiple calling function at the same time. So if they call or execute the same function at the same time (which it takes 10s to complete) then the last user won't be wait 100s to be served.

D5
7 Nov, 2023, 20:21

You want to implement a rate limit?

Nour
8 Nov, 2023, 09:57

Rate limit for what? Could you please explain more? Is my problem clear to you?

D5
8 Nov, 2023, 10:13

Basically a cooldown between executions I mean

Nour
9 Nov, 2023, 08:18

Hmmm

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