"OAuth Authorization Error: status 500" but only on my computer

Hi. I have a very rare problem with the OAuth.

I’m trying to connect to an OAuth account (doesn’t matter what account), and get the title error:

The point is that this error only occurs on my computer. Not browser, computer. I tried with 3 different browsers and get the same error, but I tried on another computer and works fine…

Can anyone have any idea of what can be happening??? I’m going crazy because I can’t create new credentials using my computer…

Thanks a lot!

Hey @netyaco,

What is the credential for and where is n8n running?

Hi Jon!

The credentials are for Google and Gitlab, and the instance is self-hosted on a VPS (sorry, I forgot to mention this).

The credentials (client and secret) of both services are correct, because I can create connections from another computer. I tried to install a new browser that I never used before, and get the same error…

Hey @netyaco,

That is very odd, I would expect the client and secret to be right but I am not why you would see that message. Does the redirect URI look right for the credential in n8n? Does anything show in the browser console log as well?

I guess the only other thing to think about is what is different between your computer and the one that works. Different network / vpn maybe?

1 Like

Well… This is very strange, and I don’t know how I can explain properly, but I will try.


The process not works (return error 500) on the next situations:

My personal computer
  • Personal network (home network)
  • No firewall, no VPN or nothing about network monitoring. Basically free access to all.
  • Browsers: Firefox (main browser) and Chrome. I installed Opera (fresh installation) and get the same error message

These are some logs from Firefox

I marked some differences between my other computer.


I tried to do this with my mobile, with Firefox, Chrome and Opera too, and check on both networks (WiFi and Mobile Data). Same result:


The process works on the next situation

Work computer
  • Personal network (home network)
  • No VPN, but can be filtered or monitored by a firewall
  • Browsers: Firefox (main browser).

Here are some logs:

Weird things

I have Firefox Containers to separate my personal data from my work data, and I tried to access to my n8n instance with my work container, and surprise, it works, but only a few times. After that, I just clear all my browser data because I suspect that can be some problem with the cookies or something, and after that I get the error 500 again.

So, I don’t know what can be happening here… I tried to reset my instance (I’m on a Docker instance), but nothing…

I will try from another friend’s computer today or tomorrow just to check from another machine and network, but I’m going crazy :sweat_smile:

EDIT: I’m on 0.231.3

Thanks a lot for your time!

I’ve new tests:

I’ve another n8n instance, on another VPS, and another version (0.228.2), and get the same error from another device (mobile from data network).

This instance works fine from my work computer, but not from my personal.

So, at this point I can only create OAuth connections from my work computer, for some reason I don’t know, because it’s the device that can be more limited in terms of network.

I don’t know what can be the problem or how can do more tests to found it.

Can you share how you set up n8n and which vps provider you are using and we can try and reproduce it.


Here is the docker-compose. Both instances have the same, but one has ports as defined here and the other just expose to an internal IP (XX.XX.XX.XX:5678:5678):

version: "3"

    image: n8nio/n8n:latest
    restart: always
      - "5678:5678"
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - ./n8n:/home/node/.n8n

The .env:

# The top level domain to serve from

# The subdomain to serve from

# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from
# above example would result in: https://n8n.example.com

# The user name to use for authentication - IMPORTANT ALWAYS CHANGE!

# The password to use for authentication - IMPORTANT ALWAYS CHANGE!

# Optional timezone to set which gets used by Cron-Node by default
# If not set New York time will be used

One of the instances is on Azure and the other on Hetzner; both are behind a NPM with the same configuration too, but I don’t think that’s the problem, because I tried directly through the IP:port (without domain, and adapting the docker compose, of course), and nothing changes.

EDIT: I tried to add another OAuth2 accounts, just putting random ID and Secrets, and all returns the same error. So, the values seem not relevant, and it’s like if the url request to the service is not generating well, but the strange thing is that depending on the browser works or not.

If you need another information, I can try to send to you :slight_smile:

Thanks a lot again for your time! I hope we can find the problem :crossed_fingers:

Hi @Jon , I think I found the problem.

As suspect, is with the cookies. We have n8n behind NPM, AND Authelia to access to the front-end (and just bypass webhooks and rest endpoints). As we need to log in first with Authelia, the cookie of the session is associated to authelia (Cookie: authelia_session=XXXXXXXX), but for some reason, my work computer has a cookie stored to n8n (I don’t know why. Cookie: n8n-auth=XXXXXXXXX). As all new devices get the authelia cookie, this causes that n8n can’t resolve this session and generate (validate, I think) the url.

I removed the Authelia step and all works.

For now, our workaround will be deactivated Authelia when we need to create new credentials, meantime we investigate the proper configuration for Authelia.

Sorry for all of this confusion, and thank you so much for your patience.

Best regards!


Hey @netyaco,

That is good to know.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.