Tuesday, 25 April 2017

Google Cloud Function "ECONNRESET" error

I recently created google cloud function to monitor any file change on my google cloud storage bucket. My website constantly create new file/replace existing file base on the operation. By checking the logs during the past few days, I noticed that this error happened quite often and I am not sure why.

{
 textPayload: " [ERROR] : {
   "code": "ECONNRESET",
   "errno": "ECONNRESET",
   "syscall": "read"
 }   
}

One thing I noticed is that this error often occurs with file replacement on the GCS bucket, but would not occur again when my google cloud function retry the existing logic after catching this error.

I am thinking it may because when the triggered Google Cloud Function is notified, the replacement operation is still in process which leads to concurrency read/write access to the file. However, base on the google cloud storage triggers document here, the GCloud function will not be triggered until the object is create, updated or deleted.

Anyone has any clue why this error occur or how to fix it?

Thank you all for your time in advance!



via user2913464

No comments:

Post a Comment