I have a cloud function running for quite some time. This function is triggered weekly by cloud scheduler. Recently, the function stops executing half way in the script and it constantly returns a timeout error. This is very weird behavior since the script should run in less than 20 seconds. Timeout is set at 500 seconds. And it always used to work!
What have I tried:
Somehow when deploying the function and trigger the function through cloud scheduler does not work. I have tried logging all the errors. There are no errors at, except for the timeout that is triggered. It does trigger the script, but it seems like it stops running after 5 seconds.
Could someone help?
Extra data:
* Python 3.10
* Weekly Trigger, every monday 08:00 AM
* Error message: "Function execution took 500001 ms, finished with status: 'error'"
Hi @xsvv,
Welcome to Google Cloud Community!
There are three possible reasons why your Cloud Function may be stopping after 5 seconds, even though you have set the timeout to 500 seconds:
To troubleshoot the issue, you can:
Here are some additional tips for preventing Cloud Function timeouts:
Thanks
Thanks @christianpaula
The code works both in local environment and within cloud functions during testing (before deploying the function). But once deployed, it just stops running and logging. I feel like there can't be a bug in my code because of these reasons.
In addition, I have also tried to redeploy my code into a new cloud function, resulting in the same problem.
Where can I best ask for support on this topic to have customer support look with me in the logs? The logs don't tell me anything extra other than a timeout issue. The function should run within 20 seconds time (as is the case while testing locally and before deploying the cloud function).