Unable to login despite n8n-auth cookie is set

Describe the problem/error/question

I have a just created self-hosted n8n instance, running on n8nio/n8n:1.110.1 docker image.

/setup or /login requests that it makes seem to be successful, returns 200 and I can see that n8n-auth cookie is set in the response headers.

However, following requests are failing with 401.

Specifically, request to /rest/settings returns 200 and valid response, but /rest/module-settings returns 401 and {“status”:“error”,“message”:“Unauthorized”}. Also it resets the cookie, so all subsequent requests also fail with 401

What is the error message (if any)?

There is no error message

Information on your n8n setup

  • n8n version: 1.110.1
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: linux

Hey @shnooshnoo hope all is good. Welcome to the community.

There are a number of versions after that one, up to a stable version 1.113.3

What are you doing with paths and cookies? Are you trying to login programmatically? What happens in the UI?

Hi @jabbson , i’m not doing anything special, just trying to log in normally via UI.

Everything I wrote about paths/cookies is just my attempts to debug it.

Basically, what happens is that I’m just trying to set up owner account and then log in.

I enter my credentials in the UI form and then nothing really happens, no error messages appear, it just hangs. In the devtools I see that login was successful and some requests even returned 200, but everything after /rest/module-settings is 401

How did you install n8n in docker? Did you follow any documentation pages to do so?
Have you tried to use another browser, incognito mode, or clear cache? Try to update to the latest version too, no reason to be stuck behind the stable version.

its a pretty basic setup, here is my Dockerfile:

FROM {mydockerproxy}/n8nio/n8n:1.110.1

EXPOSE 5678

WORKDIR /data
VOLUME ["/data"]

USER node

Yes I’ve tried another browser, incognito mode and clearing caching - didn’t help. Also tried the latest version, same result.

Also, here are my env vars:

- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
- DB_SQLITE_POOL_SIZE=1
- N8N_RUNNERS_ENABLED=true
- N8N_BLOCK_ENV_ACCESS_IN_NODE=true
- N8N_DIAGNOSTICS_ENABLED=false
- N8N_VERSION_NOTIFICATIONS_ENABLED=false
- N8N_TEMPLATES_ENABLED=false
- N8N_SECURE_COOKIE=false

Is there a reason you are rebuilding this image? You are almost not changing anything.

problem found. It was accidentally deployed into multiple containers behind load balancer, so that initial /setup request would create a user in one container, but following requests then return 401 from others. We’re going to use a shared postgres eventually, but this was supposed to be a single-node testing instance with built-in sqlite.