Google - error 400: invalid_request

Google Error 400: invalid_request

Describe the problem/error/question

I put the correct redirect uri in Google, but i still get the error below. I suspect it is because there is no “https://” in the redirect uri of the n8n google sheets node? but then, it should say redirect uri mismatch, and not error 400 invalid request…

i have not changed anything at all. last time i used a google sheet node was back in 1.73 and worked fine (im on 2.13.0 now)

Google setup:

N8N Google sheets node:

(red arrow points to a missing “https://” prefix in the redirect url)

Error when i sign in using google account:

What is the error message (if any)?

Error 400: invalid_request

Please share your workflow

no workflow, its just a google sheet node

Share the output returned by the last node

no workflow, its just a google sheet node

Information on your n8n setup

  • n8n version: 2.13.0
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker - selfhost
  • Operating system: ubuntu 22.04, arm64

Hello @bigfather, You are correct about the missing https. Looking at image 4, the redirect URI being sent to Google is missing the https:// prefix which is why it does not match what you saved in Google Console.
To fix this, you need to set the correct base URL in your Docker environment variables. Add this to your docker-compose file:
N8N_EDITOR_BASE_URL=https://n8n.myaccess12312.com
WEBHOOK_URL=https://n8n.myaccess12312.com

Without these set, n8n sometimes generates the redirect URI without the https prefix which causes exactly this error.

After adding them restart your Docker container and try connecting again. The redirect URI in n8n should then show the full https URL and match what you have in Google Console.

@bigfather check image 5 closely — the redirect_uri being sent has myaaccess (double “a”) but your Google Console has myaccess (single “a”), that typo is the actual 400 cause. fix the typo in your N8N_EDITOR_BASE_URL env var and add the https scheme while you’re at it:

N8N_EDITOR_BASE_URL=https://n8n.myaccess12312.com
WEBHOOK_URL=https://n8n.myaccess12312.com

once that’s sorted, reconnect creds and this basic sheets read should just work:

restart the container after changing env vars, pick your sheet+doc in the Sheets node, done.

hey @achamm @moosa , thanks! this is now resolved by adding https:// in the N8N_EDITOR_BASE_URL!! i did not need to do this in the previous n8n versions, but i guess its now needed in 2.13.0 :slight_smile: thanks for your help!

@bigfather your welcome! Feel free to heart whoever’s solution you want as the reply!