Why am I frequently receiving socket hang up errors in my PipeDream workflow when updating Google Sheet cells in live mode?

This topic was automatically generated from Slack. You can find the original thread here.

Hey PipeDream team. I’ve been receiving a lot of these errors in my workflow.

Error
request to https://sheets.googleapis.com/v4/spreadsheets/1PA80fkbRHC_ywszfK7b_jwcZ7wZr9F4EIpyb6yGWZbI/values/Article%20Cost%20Tracking%211%3A1 failed, reason: socket hang up
DETAILS
    at Gaxios._request (/pipedream/dist/code/b737a18fd40924d15c333a3280db8003b95bf8ce210bf2b740787bf8ae507d11/node_modules/.pnpm/gaxios@6.1.1/node_modules/gaxios/build/src/gaxios.js:148:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at OAuth2Client.requestAsync (/pipedream/dist/code/b737a18fd40924d15c333a3280db8003b95bf8ce210bf2b740787bf8ae507d11/node_modules/.pnpm/google-auth-library@9.1.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:383:18)
    at Object.getSpreadsheetValues (file:///pipedream/dist/code/b737a18fd40924d15c333a3280db8003b95bf8ce210bf2b740787bf8ae507d11/code/google_sheets/google_sheets.app.mjs:292:24)
    at Object.run (file:///pipedream/dist/code/b737a18fd40924d15c333a3280db8003b95bf8ce210bf2b740787bf8ae507d11/code/google_sheets/actions/add-single-row/add-single-row.mjs:80:32)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)

All that the step does is update 7 cells in a Google Sheet on the same row.
It works fine when I manually trigger the workflow, but when it’s live, it usually gives me this.
Any thoughts?

Hi , it’s possible that the Google API is rejecting request to Pipedream. For this I would recommend you to check the events rate and try to configure throttle settings in your workflow if needed

any thoughts on this?

I see that you’re experiencing a “socket hang up” error when updating cells in a Google Sheet. This error might be caused by network issues or rate limits imposed by the Google Sheets API. To help you further, can you please provide more information about your workflow? For example, how often is the workflow triggered, and are there any other steps in the workflow that might be causing delays or consuming resources? This information will help me better understand the issue and suggest a solution.

The workflow is triggered once every 10 minutes. There are multiple steps that update the Google Sheet, but they are also spaced with at least 10s between, as they are calling the Open AI endpoint. I don’t see how it is a rate limit, given the infrequency in which the Google Sheet API is being called.

Thank you for providing more information about your workflow. It’s indeed unlikely that the issue is due to rate limits, considering the frequency of your API calls. The “socket hang up” error could be related to network issues or temporary unavailability of the Google Sheets API. To help troubleshoot the issue, you can try adding error handling and retry logic to your workflow. For example, you can use a try-catch block and implement a retry mechanism with a delay between retries. This way, if the error occurs, your workflow can attempt the request again after a short delay. If the issue persists, please consider reaching out to Pipedream support at https://pipedream.com/support for further assistance.