GCP Cloud Function Cold Start Error with Retry

Viewed 174

In the last couple of weeks there we have been observing an increase in errors during a function cold start.

When we call a correctly deployed GCP function (Node10 runtime, europe-west3) which is publicly available (allUsers granted Invoke Cloud Function permission).

The request returns the following:

https://project-id.cloudfunctions.net/http-triggered-functions  500     
      <html><head>
      <meta http-equiv="content-type" content="text/html;charset=utf-8">
      <title>500 Server Error</title>
      </head>
      <body text=#000000 bgcolor=#ffffff>
      <h1>Error: Server Error</h1>
      <h2>The server encountered an error and could not complete your request.<p>Please try again in 30 seconds.</h2>
      <h2></h2>
      </body></html>

It seems like this issue has a smaller probability in the evenings (region: europe-west3). It also seems that this issue has a bigger probability on projects with small amount of function calls.

This behaviour is not covered by documentation.

The GCP logging does not show any line related to that incident.

1 Answers

Investigating more with the information you shared I got that actually this is a Known issue with Cloud Functions with NodeJS.

In Long cold start times in Node.js applications you can follow up the updates the google team will be posting.

They also mention that it is not depending on the actual code deployed and there are no known work araounds there

In theGithub Issue there is mentioned this partial workaroundhowever it only addresses the delay caused by the startup of communication objects with firestore.

The other mentioned workaround is to move the code to App Engine as it supports warmup calls and there is more control on developer's side.

Related