Back

Function Execution timed out

  • 0
  • Self Hosted
  • Functions
  • Flutter
Drake
25 Oct, 2023, 18:30

i wonder if the error coincides with:

Skipping runtimes stats loop due to error: Docker Error: EOF

Also, any logs in the runtime container?

TL;DR
User is experiencing timeouts with a function execution that usually runs under 100ms. The issue seems to be related to the time it takes for a container to start. User suspects there might be something in the code causing the slow start. They also mention seeing error logs related to the max integer value and inquire about options to keep function workers continuously working. User shares that upgrading to 2 vcpu cores fixed the issue on their production server. They also mention not being able to find logs for certain functions and inquire about a specific container name. User wonders if the error coincides with "Skipping runtimes stats loop due to error: Docker Error
develocode777
25 Oct, 2023, 18:42

@Drake what is the name of that container? I can't find it.

Drake
25 Oct, 2023, 18:44

<project id>-<deployment id>

develocode777
25 Oct, 2023, 18:45

@Drake there is no container with that name

Drake
25 Oct, 2023, 19:37

you might need to execute it to spin it up again

develocode777
26 Oct, 2023, 06:27

@Drake I checked for three functions but there are no logs

Osman
27 Oct, 2023, 04:46

I get the same behavior when self-hosting on my local pc. Usually after a docker compose up, the functions will keep timing out. Then after like 10 minutes, it suddenly starts working again.

It also started happening on my self-hosted production server, but I managed to fix it by upgrading to 2 vcpu cores, almost like there was a deadlock somewhere. Still strange, since it hadn't been a problem before.

develocode777
6 Nov, 2023, 08:10

@Drake Is there an option to keep function workers working continuously once they are created?

Drake
8 Nov, 2023, 00:22

If you're self hosting, you can increase the inactivity interval environment variable

develocode777
8 Nov, 2023, 07:46

@Drake _APP_FUNCTIONS_INACTIVE_THRESHOLD this one? what is the max value?

Drake
11 Nov, 2023, 05:41

I would assume whatever the max integer is. I don't recall the exact value

develocode777
21 Nov, 2023, 10:58

@Drake I still get this error apearing randomly, this time in the logs is just: Preparing for start ... Starting ...

Drake
21 Nov, 2023, 21:08

Which logs?

develocode777
21 Nov, 2023, 21:15

I get the error most often in 3 functions, the logs are from the containers associated with those functions

Drake
21 Nov, 2023, 21:16

Weird...maybe there's something in the code that makes it slow to start

develocode777
21 Nov, 2023, 21:21

I don't think it's the code because in 90% of the time it executes in under 100ms, but it does take a while for a container to start if it's not running already so probably thats why the function gets timed out

develocode777
21 Nov, 2023, 21:24

Here is the code for one of the functions

develocode777
22 Nov, 2023, 13:59

now this is whats in the logs of one of the functions, is this normal? @Drake

develocode777
22 Nov, 2023, 14:13

and now it seems it fails constantly: Execution timed out.

Drake
23 Nov, 2023, 15:44

Is this one the same function code you shared above?

develocode777
23 Nov, 2023, 16:15

No, it's a different function

D5
23 Nov, 2023, 16:35

Could you please share the code if the second one?

develocode777
23 Nov, 2023, 16:40

here

Drake
23 Nov, 2023, 17:47

How long does it typically run for when it's successful

develocode777
23 Nov, 2023, 17:50

it's hard to tell because there is a sleep of 5 sec and that's what is shown in the dashboard on all executions, i think under a sec

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