I’m trying to set up an automation to upload videos to YouTube from n8n. I’ve configured Google OAuth2 correctly, and the Google login process completes successfully.
But at the final step, after Google redirects back, I get this error:
“This site can’t be reached — localhost refused to connect”
If you are using docker compose, post the n8n service section of docker-compose.yml (especially the ports and environment section). Someone might be able to help if they had that info.
I’m running this on a Windows machine using Docker. Everything works fine, and I can access http://localhost:5678 in the browser. The Google OAuth2 flow completes, but after that, the redirect to http://localhost:5678/rest/oauth2-credential/callback?... fails with:
“This site can’t be reached — localhost refused to connect.”
Let me know if you need more info. Really appreciate your help!
It seems like everything is as it should be. There is some mystery (i.e. possibly inconsistent use in different areas of n8n’s codebase) related to the WEBHOOK_URL environment variable. First thing to try is adding that and setting it explicitly to http://localhost:5678 Maybe also remove the N8N_EDITOR_BASE_URL until things are working.
For some reason, WEBHOOK_URL is documented in a different place than where N8N_EDITOR_BASE_URL is documented, and there’s another one named N8N_PUBLIC_API_ENDPOINT that can make things more unclear when/if it specified. Without going through the code, it’s hard to tell when these different settings are in effect and when they override each other. Most of the time, the best answer seems to be getting rid of everything but WEBHOOK_URL.