Skip to main content

Im running a Bot on Botrunner and where it gets to the line where connects to Google Sheet, gets stuck connecting forever, and it doesn’t throws an error. It says connect and active, but nothing is happening.

@lombardoalejandro05 Ooooh. That’s a tricky one. 

The only way I can think of to monitor this is to using an application like Wireshark. It can “see” the data being transferred between the bot agent and the target system. It might be able to let you know if there is some sort of error code coming back from Google (e.g., a 500 or 403), or if Google just isn’t responding at all.

Also, double check that you can manually connect (through a browser) to Google Sheets and perform the same action without error.


@lombardoalejandro05 Ooooh. That’s a tricky one. 

The only way I can think of to monitor this is to using an application like Wireshark. It can “see” the data being transferred between the bot agent and the target system. It might be able to let you know if there is some sort of error code coming back from Google (e.g., a 500 or 403), or if Google just isn’t responding at all.

Also, double check that you can manually connect (through a browser) to Google Sheets and perform the same action without error.

I opened the Google Sheet through an URL and I got an error on that line that says: An unexpected error occurred, begin 39, end -1. Please contact system administrator.


Hi ​@lombardoalejandro05,

 

As per my understanding, the issue might be likely causing by any of the following:

 

  1. Interactive OAuth on an unattended Runner
    If the Connect action is set to Authorization code (legacy, attended), the Google consent window needs a visible desktop. On an unattended Bot Runner (no interactive session), that dialog can’t appear, so the action sits at “Connecting/Active” and never proceeds. The recommended approach for unattended runs is Control Room–managed OAuth2 with a shared token.

  2. Browser Prompt: When executing the command to open the Google Sheet, check if a browser window opens with an Allow button. If so, make sure your bot has logic to handle it.

  3. OAuth connection not authenticated / wrong token type
    If you’re using a User‑specific token, it has to be authenticated (status Active) in My settings → OAuth connections before the bot runs; for fully unattended runs, use a shared token so the bot doesn’t wait on user consent.

  4. Using the deprecated G‑Suite Apps package
    Only the Google Sheets package is supported going forward; the older G‑Suite Apps package is deprecated and can lead to connection problems. Make sure your bot uses Google Sheets: Connect.

  5. Network/Firewall blocking Google endpoints
    Your runner must reach Google OAuth and Sheets endpoints. Ensure outbound HTTPS to:

  • https://accounts.google.com and https://oauth2.googleapis.com/token (OAuth)
  • https://sheets.googleapis.com (Sheets API)
  1. Outdated package or Bot Agent
    An older Google Sheets package or Bot Agent can cause odd behavior. Update packages in Manage → Packages and keep Bot Agent aligned with your Control Room version.

  2. Redirect URI mismatch (if using Authorization code mode)
    When you do use an authorization code, Google’s OAuth client must include the redirect URI http://localhost:8888/Callback. A mismatch can stall the handshake. (For Control Room–managed OAuth, use the Control Room’s callback URL.)

Note: Google Sheets package actions also include a per‑action “Wait for action to complete” setting (default ~10 minutes) for reads/writes; if the sheet doesn’t open in time the task moves on. That won’t fix an OAuth hang, but it’s good to know once you’re past Connect.


Hi ​@lombardoalejandro05 

I faced a similar issue while working with Google Sheets in a previous project. Here’s the workaround that helped me resolve it:

  1. Credential Authentication: Ensure that the credentials you're using are properly authenticated. Try logging in manually with those credentials to confirm they’re active and authorized.

  2. Browser Prompt: When executing the command to open the Excel file, check if a browser window opens with an "Allow" button. If so, make sure to click it to grant the necessary permissions.

Following these two steps should help resolve the issue.


Reply