"Something went wrong. Please try again!" when trying to add Google Sheets OAuth2 API credential

I’m trying to create a Google Sheets OAuth2 API credential.

Under my Google Cloud project, I’ve done the following:

  • Under Branding > Authorised Domains, i’ve added “n8n.cloud“
  • Under Audience > Publishing status, I’ve set it to “Testing” & I’ve added my email under Test user.
  • Under OAuth 2.0 Client ID, I’ve added a record.
  • Under Data access, I haven’t added anything yet.
  • Under Authorised redirect URIs, I’ve added my URI - https://.app.n8n.cloud/rest/oauth2-credential/callback

In n8n, when I try to add a “Google Sheets OAuth2 API“ credential & click the “Sign in with Google“ button, select my email, select all to give access to everything required, & click “Continue”, I get this error message:

Something went wrong. Please try again! 

Network tab:

Request URL https://oauth.n8n.cloud/oauth2/callback?state=something/somethingElse%2B/more/moreStuff&scope=https://www.googleapis.com/auth/drive.metadata%20https://www.googleapis.com/auth/drive.file%20https://www.googleapis.com/auth/spreadsheets

Request Method GET

Status Code 500 Internal Server

I’ve tried adding other similar Google credentials, but I just keep getting 500’s or 4xx errors

Can anyone provide advice on what I’m doing wrong?

I’ve opened a case with n8n support, but all I’m getting is the steps to follow that I have tried multiple times today

1 Like

Hey @damosull

When google tries to send that authorization code back to oauth.n8n.cloud but your google project only recognizes your specific instance URL, the whole thing just breaks.

You need to add a second one: https://oauth.n8n.cloud/oauth2/callback

p.s. first one (missing instance): https://missingInstance.app.n8n.cloud/rest/oauth2-credential/callback

Same problem here. And I have added the 2nd URL. Still the same issue.

@damosull Did you manage to figure this out? I am extremely frustrated with this issue.

Hi @adnan.kaiser

When I created the n8n instance yesterday, my n8n version was on 2.1.3 by default. I was getting this error with version 2.1.3.

Yesterday evening, I updated it to 2.1.4 (which seems to be the latest stable version). I then tried creating my ”Google Sheets OAuth 2.0 api” credential again, & it just worked.

2 Likes

Also, for what it’s worth, I actually just abandoned n8n for this & created a node.js / TypeScript CLI app that does the same thing.

I had that made within an hour, instead of wasting half a day trying to get an n8n credential set up while also paying for an n8n subscription

1 Like

@damosull Thank you so much man. You are a life saver. Upgrading to 2.1.4 solved the issue. I was panicking over this lol.

And power to you, looks like you also managed the situation by creating another app :saluting_face:

how do i upgrade to version 2.1.4

@Diego_Villar_Garcia https://app.n8n.cloud/manage head over there and you will find the option. (judging you are on the official cloud version).

Try updating your n8n version to 2.1.4 or later. It might help solve the issue (this update fixed an issue with the OAuth itself). Good luck!

This thread and you guys are a life saver!! my n8n was on version 2.2.1 (latest beta) as I like my instance to be the latest and greatest, and I was stuck with this exact same problem for 2 days

until I saw this reply and this thread, and finally solved it by switching to 2.1.4!! Turns out the latest (2.2.1) is NOT the greatest :rofl:

Thanks again @damosull and @adnan.kaiser for the solution and for opening this thread!!!

1 Like

Thank you, I was going crazy…

I have the same issue. Can someone help me, please? I am using the cloud and can’t update the version