Sign in Google fails in N8N hosted in Railway server

Hey everyone,

I’m new to n8n and Railway, and I really need help! :weary:

I deployed n8n on Railway using the “workers” template, which automatically set up PostgreSQL and Redis (I have no idea how to use them properly). I followed a tutorial to configure Google credentials in Google Cloud, and everything seemed fine.

However, when I try to add the credentials in n8n to use a Google Sheets node, I get stuck. I entered the Client ID and Client Secret, clicked Sign In, granted all permissions, and clicked Allow. But instead of redirecting me back to n8n, I get this error:

DNS_PROBE_FINISHED_NXDOMAIN

I think the problem might be related to domain/URL settings in Railway, but I have no clue how to fix it. Do I need to set up custom domains or change something in Google Cloud settings?

If anyone has successfully set up Google OAuth in n8n on Railway, PLEASE HELP! :pray:


Information on my n8n setup

  • n8n version: 1.79.2
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Railway server
  • Operating system: Windows 11

What’s the domain you’re redirecting to. Basically, it seems like the redirect URL you’ve setup in Google is not a domain that can be resolved using public DNS servers.

I don´t know how or where to identify the domain.

Thats the redirecting URL authorized:

https://n8n.operacional.galeria9.app/rest/oauth2-credential/callback

Thats the link in the error screen:

https://n8n.operacional.galeria9.app/rest/oauth2-credential/callback?state=eyJ0b2tlbiI6InUzcGI2c2VZLWVkS2hXajI4bTFWbERjTXg1QmMtbWF5ZEhYUSIsImNpZCI6IjJ5c1V2MmlQNU9WNnkwWEciLCJjcmVhdGVkQXQiOjE3NDE4OTgyMjU4NDB9&code=4/0AQSTgQFkjwlBB6DDzdLaXFpXcPfyW9InMO4EhEnrwPjic_HiWqiE7nqUCCvRumgCuxSCug&scope=https://www.googleapis.com/auth/drive%20https://www.googleapis.com/auth/drive.file%20https://www.googleapis.com/auth/spreadsheets%20https://www.googleapis.com/auth/drive.metadata

The railway-public-domain is

n8n.operacional.galeria9.app

Visiting that domain indeed gives that error:

Basically, that domain is not public. I’d recommend you to contact Railway to get the real public domain for your instance.

1 Like

I’ll try that