0

I am having a small problem with my Cloud Function that crashes the message is

Function execution took 242323 ms, finished with status: 'crash'

My Setup There are two GCP projects set up, One is managed by Department A, I work in Department B and I am getting access to a server that is set up on Department A's GCP project.

The Department A GCP project sits behind our internal network, and I am accessing a server on that project via VPC Connector.

On my department B GCP project, I use Cloud Scheduler, Cloud Pub/Sub, Cloud Function and Cloud Storage.

Workflow Cloud Scheduler publishes once a day a message to a pub/sub-topic. A Cloud Function subscribes to the pub/sub-topic, when a new message arrives at the pub/sub-topic, the Cloud Function will initiate an HTTP request to the server on the Department A GCP Server. The request made to the server initiates a query and returns data that is stored in CLoud Storage as a .csv file.

I have several URL that I have scheduled to run during a morning period, only on give me a problem as it takes the longest time to execute, all other URLs that I execute are completing with status OK, and the files are stored in Cloud Storage.

This specific URL that I have a problem with always crashes around 242323 ms, even if my Cloud Function is set to 540 seconds.

enter image description here

To mention the other URLs that works are all completed before 242323 ms mark.

Viewing the log I can see that the troublesome URL that crash the Cloud Function, the message is ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

I am using python "requests" to make the HTTP Request.

In Department A we use a proxy server in their GCP Project which the VPC-Connector has been paired with.

We can use cURL to make the HTTP request from the Department B GCP project, with cURL we can without any problem complete the request to the URL that we have a problem with using a Cloud Function.

The issue is that the request from the Cloud Function gets terminated before the end of the Cloud Functions execution time of 540 seconds. I tested the proxy and it has a timeout of 15 minutes, which is more than sufficient for the Cloud Function.

It may be an issue with the VPN Connector, I can not see any settings that are related to the hangup, I'm hoping someone here has an idea on what to look for. enter image description here

Totta Zetterlund
  • 313
  • 5
  • 18
  • The network schema is quite confuse for me. Do you have a schema to make it clearer? – guillaume blaquiere Jun 14 '21 at 15:46
  • HI, @guillaumeblaquiere I have added a diagram to explain how the network is set up. I use a cloud function with a VPC connector to access a Proxy on another Google Project to make a URL request from a server, the request can take up to 9 minutes, I have tested it from the cmd line by using curl, I know how long the request takes. With curl I can call the file I want to extract and I get the whole file, via the cloud function it always crashes at the 4 minutes mark, with Connection reset by peer. – Totta Zetterlund Jul 06 '21 at 10:02

0 Answers0