504 timeout on callback

I am trying to authorize a Google Calendar Oauth2 credential, and I noticed that the OAuth Redirect URL has changed a few times in n8n. Today it is https://orange-wasp-75.hooks.n8n.cloud/rest/oauth2-credential/callback
A few days ago it was https://7piviwjp1pwhgeg4ig42kq8m.hooks.n8n.cloud/rest/oauth2-credential/callback , and a few days before that it was something different. What’s going on with this?

edit: Also, I am getting a 504 timeout from n8n.cloud after granting access to services on Google’s auth page.

Hi @Jason_Jason ,

n8n can make use of a special tunnel to allow incoming web traffic. This tunnel is not meant for production use and might not live forever (in which case a new tunnel URL would be requested from the server when you launch n8n).

A gateway timeout indicates the tunnel server could be reached, but your n8n instance behind the tunnel could not. Were you possibly using an outdated tunnel URL or is your firewall blocking traffic here?

Hi @Muted_Jam, thanks for the reply. I may have been using an outdated tunnel URL… I’m not sure. It looks like it was generated automatically when I started n8n (I should have mentioned that I’m running the Windows version).

I’m wondering if I should turn off the tunnel. I didn’t manually launch it with the command line (as per your link). I’m guessing the Windows editor automatically uses it? Can I disable it?

Now when I open a credential, it says “https://fast-bat-31.hooks.n8n.cloud/rest/oauth2-credential/callback
Why does it keep changing?

How are you running n8n? Are you using docker, the desktop app or something else?

Desktop app on Windows.

As said before, the tunnel URL is not permanent and changes. The desktop app would use it automatically as external services would otherwise be unable to send webhooks to your local n8n instance. I don’t think there is any way currently of changing the desktop app behaviour with regards to using this tunnel, but I’m sure @ivov can confirm.

That said, n8n desktop listens (by default) on port 5679 of your local machine, so you can replace https://$tunnelName.hooks.n8n.cloud/ with http://localhost:5679/ to address your local instance directly instead of using a tunnel.

More information here:

2 Likes

Thank you both. It seems to have stabilized.

1 Like