2

There are some exceptions from my running GCF (--runtime python37 --trigger-topic <pubsub_topic> --retry).

They are all from this IP 169.254.8.129 which should be GCP internal IP and maybe the supervisor of GCF. I google this IP and grab the deploy output (via Node)

{
 “SUPERVISOR_HOSTNAME”: “169.254.8.129”,
 ...
 “X_GOOGLE_SUPERVISOR_HOSTNAME”: “169.254.8.129”,
}

(https://rominirani.com/google-cloud-functions-tutorial-using-environment-variables-20b4f0f82aa0)

From Stackdriver Logs, the GCF will have ConnectionResetError after this exception, and then this GCF will exit with failure errors.

"Traceback (most recent call last):
  File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 138, in run
    self.finish_response()
  File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 180, in finish_response
    self.write(data)
  File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 274, in write
    self.send_headers()
  File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 332, in send_headers
    self.send_preamble()
  File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 252, in send_preamble
    self._write(('HTTP/%s %s\r\n' % (self.http_version,self.status)).encode('iso-8859-1'))
  File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 453, in _write
    result = self.stdout.write(data)
  File "/opt/python3.7/lib/python3.7/socketserver.py", line 796, in write
    self._sock.sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer"  

Is it one bug of GCF? How to prevent this exception from developer's perspective?

northtree
  • 8,569
  • 11
  • 61
  • 80
  • The error `ConnectionResetError` means that the other side abruptly closed the TCP connection. This could be caused by no traffic, sending too much data, calling the endpoint too often, many reasons. You will need to provide more details about what your code actually does and what the other side of is. My guess is that you are exceeding an API limit. – John Hanley Feb 21 '19 at 01:47
  • @JohnHanley How to know which API limit exceed on GCP? I couldn't found any exceeding via `IAM & Admin` - `Quotas`. – northtree Feb 21 '19 at 04:42
  • APIs can also have rate limits. I am just guessing, your question has no details to analyse. – John Hanley Feb 21 '19 at 04:47
  • @JohnHanley It's not related to specified code, do you know how to get which limit exceeded on GCP? Thanks. – northtree Feb 21 '19 at 05:22

0 Answers0