Fixing HTTP 499 errors when working with a cloud function or Serverless Containers container
Issue description
The log of your cloud function or Serverless Containers container shows such messages as Error: Code 499 Message: request cancelled.
Solution
This error appears because of the timeout on the side of the client that calls the function. When an application sends a request to run a function, it waits for response for a certain time frame. This time limit is often 60 seconds by default. If the function fails to complete processing and retrieve the result within this time, the client aborts the connection.
In this case, you may want to try:
- Increasing the timeout on the side of the client that calls the function, if you can do so.
- Breaking down a job that takes a long time to complete into multiple functions triggered by timer. This may come in handy when you cannot change the client timeout.
If the above solutions did not help, adding logging to the function code and analyzing the logs. We have some examples of setting up logging for Python cloud functions that are available here:
If the issue persists
If the above actions did not help, create a support ticket
- ID of your cloud function or container in Serverless Containers.
- Contents of the log of your cloud function or container. You can find the function logs in the Logs section on the function's page in the management console
.