Back

Synchronous function execution timed out. Use asynchronous execution instead, or ensure the executio

  • 0
  • Self Hosted
  • Functions
  • REST API
Alex
15 Sep, 2024, 21:28

Hi Appweite team !

I created an appwrite function in which I do API request to an AI server. When request take long such as more than 30 secondes, the function execution fail and return below error, regardless of what timeout is set at function's setting page. Synchronous function execution timed out. Use asynchronous execution instead, or ensure the execution duration doesn't exceed 30 seconds.\nError Code: 408

I call the function execution from another appwrite function using Node SDK.

I get this error when I call function execution with async => false. I also get the error when I call the function execution using REST API (axios call to the functions's domain)

When I call the function execution with async => true, the execution hang at step "waiting" for up to 10mins or 15mins till I cancel the call then the execution pass to "processing" then "completed".

Appwrite version: 1.5.7 Appwrite node version: 12.0.1 (tried with 13.0.0 but getting import error) SDK: Node 16 (tested with 18 and 20 also withe same result)

TL;DR
- Developer encountered a timeout error when making API requests to an AI server through Appwrite function. - The error suggests using asynchronous execution or ensuring the execution duration is within 30 seconds. - Setting async to true may cause the execution to hang for up to 10-15 minutes before completing. - Solution: Set async to true, refresh the page, and check if the execution completes successively.
Steven
15 Sep, 2024, 21:57

You need to set async to true. That is odd it's "waiting" for that long. Did you refresh the page to make sure?

Steven
15 Sep, 2024, 21:57

Oh wait, on self-hosted, all async executions are queued and processed serially

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