Skip to content
Back

Function executions fail with cURL error 52 when coinciding with executor maintenance cleanup

  • 0
  • 1
  • Self Hosted
  • Functions
daniD
13 Jan, 2026, 13:55

Appwrite version: 1.8.0 Executor version: 0.11.4 Function runtime: Python 3.12 SELF-HOSTED

Function executions that occur at the same moment as the executor's hourly maintenance task fail with Internal curl error has occurred within the executor! Error Number: 52.

Evidence:

Executor logs show maintenance and error occurring within the same second:

TypeScript
2026-01-13T12:41:21.526Z Running maintenance task ...
2026-01-13T12:41:21.526Z Maintanance task finished.
2026-01-13T12:41:21.542Z [Error] Internal curl error has occurred within the executor! Error Number: 52
2026-01-13T12:41:26.189Z Successfully removed exc1-...-696484170e82d617cb4a

This pattern repeats every hour at :41:21 for any function scheduled to run at :40. appwrite-worker-functions logs:

TypeScript
2026-01-13T12:41:21.549327647Z [Job] (69663d20b02831.79501694) failed to run.
2026-01-13T12:41:21.549511242Z [Job] (69663d20b02831.79501694) Internal curl error has occurred within the executor! Error Number: 52
2026-01-13T12:41:21.549527872Z [Error] Type: Exception
2026-01-13T12:41:21.549539662Z [Error] Message: Internal curl error has occurred within the executor! Error Number: 52
2026-01-13T12:41:21.549615140Z [Error] File: /usr/src/code/src/Appwrite/Platform/Workers/Functions.php
2026-01-13T12:41:21.549630469Z [Error] Line: 646

Actual behavior:

The maintenance task removes containers without coordination with incoming execution requests, causing a race condition where: Execution request arrives Executor routes to existing container Maintenance simultaneously removes that container cURL gets empty response (error 52)

This function runs every 4 minutes, 15 times an hour, only one out 15 failure, always at the same time: X:40.

Maintenance should not remove containers that have pending or in-flight execution requests so I would like to understand if this is a bug or I am doing something wrong.

Thanks.

TL;DR
Scheduled functions fail due to cURL error 52 during executor maintenance cleanup. This is a known issue where maintenance at :41:21 may remove containers while functions scheduled at :40 are executing, causing the error. To prevent this, reschedule functions to run at a different time (like :35 or :45). This is a bug in Appwrite as it does not check for active executions before removing containers. For long-running functions, they can be terminated if still running at :41. Consider reporting the issue on GitHub.
13 Jan, 2026, 15:35

I can help! This is a known race condition in Appwrite where the executor's hourly maintenance task removes containers at the exact moment your scheduled function tries to execute, causing the cURL error 52. The maintenance runs at :41:21 every hour, and your function scheduled at :40 gets caught in this ~1-minute window where containers can be removed mid-execution. Quick question: Are you able to reschedule your function to run at a different time (like :35 or :45) to avoid the maintenance window, or do you need it to run precisely at :40?

13 Jan, 2026, 16:03

Hey <@1248902535142445057>, thanks a lot for replying, I actually can change the function schedule, I only wanted to know if there a different approach since this feels like a bug: you cannot run function at :40 but you're allowed to do it, what happens if your function takes long or you have multiples functions that are running at that time, will they be deleted?

13 Jan, 2026, 17:16

You're right this is definitely a bug. The maintenance task should check for active executions before removing containers, but it doesn't. For long-running functions: Yes, they can get terminated if still running at :41, which is a real problem.

13 Jan, 2026, 17:16

Can you just send me a message

13 Jan, 2026, 17:40

Thanks, talking with you helped more what you think, however, what do you mean by: "Can you just send me a message". Also, do you think I should rise an issue on Github or this is a known bug?

13 Jan, 2026, 21:29

Send me a friend request

13 Jan, 2026, 22:12

Ok, done.

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