Being logout after few hour or hours with integration under google drive oauth2

Describe the problem/error/question

I have a selfhosted n8n instance, that I’ve setup recently, and it was integrated with a google project.

While I was using this integration over a Oauth 2.0 web application still on testing, I had to relogin once a week from n8n side, but when I had the workflows using that google application a lot more (using gmail, google sheets and google drive), I decided to put that on production from google web application.

After doing that I noticed right away that within one hour or a few hours that the integration was breaking regarding steps related just with google drive, and the only way to fix this was to sign-in again on n8n over that credential related with google drive only and not the rest.

These are the login popups that I get from google when I login from n8n (not sure if could be useful):

What is the error message (if any)?

The error I am getting is this:

Problem in node ‘Upload PDF to Drive2‘
The connection was aborted, perhaps the server is offline

What I have done so far to fix this without success:

  • I’ve revoked accesses from google side, and have relogin again from n8n side.
  • I’ve created new a credential for google drive.
  • I’ve deleted the google web application secret key, and setup a new one and set on every google credentails again.

Information on your n8n setup

  • n8n version: 2.6.4
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

Hi @marafado88 I had the same issue, it got resolved when i created a new google console project and added that app integration as a fresh instance and then published it, let me know if this works for you.

1 Like

Hey @marafado88,

This is a classic Google OAuth2 refresh token issue. When you moved from “Testing” to “Production” in Google Cloud Console, the OAuth consent screen publishing status might not have fully propagated, or your refresh tokens may have been invalidated during the transition.

**Most common causes & fixes:**

1. **Check your publishing status** in Google Cloud Console → APIs & Services → OAuth consent screen:

  • Make sure it says “In production” (not “Testing”)

  • If you just changed it, wait 10-15 minutes for propagation

2. **Force a complete re-authentication:**

  • In n8n, delete ALL existing Google Drive credentials

  • In your Google account (myaccount.google.com → Security → Third-party apps), revoke access for your n8n app

  • Go back to n8n and create a fresh credential - this will generate a new refresh token

3. **Verify your OAuth scopes** haven’t changed between Testing and Production. Google can invalidate tokens if the scopes differ.

4. **Check if you need to submit for verification:** If you’re using sensitive scopes (like Gmail or certain Drive scopes) and your app shows “Needs verification,” tokens will expire quickly until verified.

The fact that only Google Drive is affected (not Gmail/Sheets) suggests the Drive-specific scope may need re-authorization. Try the complete re-auth in step 2 first — that usually resolves it.

Let me know if you’re still seeing issues after this!

1 Like

Haven’t tried that tbh, will give it a shot and will let you know.

1 Like

Hello @marafado88

Im your Google console in the API & Services Click on OAuth consent screen then in Audience add your gmail in “Test users”

Have created a new project now, and in meantime I have been testing another workflow and have noticed that seems this situation is only happening with this step:


Can you please let me know if it was just for one particular steps or if it was for all cases related with google drive steps?

1 Like

@marafado88 please consider using inbuilt Drive node it is far easier to setup and easy to debug in all cases , i would not say it is related to particularly that issue but sometimes things just does not work with console so creating a new project make things work again , not related to n8n but it is something off from Google console. Please again use Drive node for interacting with Google drive services:

2 Likes

After switching that with the Upload File from Google Drive, the builtin one, it worked. I was using that because it came with a template that I’ve used, but since it was the first step using google drive, I thought that there was something more related. So after switching those that I had before with Google Drive builtin one, it worked with the other credentials that I was using already! Thank you!

1 Like

Glad it worked out for you! Cheers!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.