I’m self hosting an instance of n8n using the Docker image which has been working fine with Basic Auth (+ my personal IP whitelisted in nginx). After a recent upgrade I was prompted to create a new admin account, so I did (was happy to see this). Unfortunately, on hitting submit, I got an error:
Problem setting up owner
Request failed with status code 401
I did see on a recent post someone else with this problem, but they are on the desktop version. Here’s what I’ve tried:
set the N8N_BASIC_AUTH_ACTIVE to false, since I read in the docs you can’t have both auth methods.
run the n8n command in the container: user-management:reset
gave up on the new auth and tried to set N8N_USER_MANAGEMENT_DISABLED to true (the docs say this won’t work once you’ve created the owner user, which I reckon must have happened in an incomplete way)
Restarted and destroyed the container multiple times with various env variables
attempted to recover my password (wouldn’t work because SMTP isn’t setup)
Haven’t yet tried to login into the DB (not that versed in sqlite) but I could.
Haven’t set up SMTP. Is that a requirement for the new auth? If so, there should probably at least be a warning in the GUI when you upgrade…
Any help would be appreciated! I’d be equally happy to get either basic auth or the new standard auth working. Right now I can’t get into the app and the only next step I can think of is to nuke everything, start fresh and lose all data.
What is the error message (if any)?
Problem setting up owner
Request failed with status code 401
Please share the workflow
n/a
Share the output returned by the last node
n/a
Information on your n8n setup
n8n version: lastest Docker image
Database you’re using (default: SQLite): default/sqlite
Running n8n with the execution process [own(default), main]: default
Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker
Hi @unleashit, welcome to the community! I am very sorry to hear you’re having trouble.
From giving this a very quick go user-management:reset doesn’t quite work as expected (which presumably is why it’s not documented yet). I’ve set aside some additional time to test this in more detail though.
I think at the moment the only way to remove user management functionality with certainty and without knowing the state of your database would be what I’ve described here:
If your user table is still intact you can alternatively follow this great suggestion from @GlitchWitch:
Thanks for the quick reply. Unfortunately, neither of those examples were the issue I was having but I did end up getting some clues for how to backup/restore and nuke the db.
My problem wasn’t that I forgot the password, it just wouldn’t finish the process of creating the owner user. The user creation dialog kept coming back as a never ending loop (and if I selected skip, instead of skipping it went to a login form which wouldn’t accept the correct credentials). I did try setting up SMTP as per one of the suggestions, but that didn’t do anything. Neither did truncating the user table in the database. But after doing the nuclear option, it’s all up and running again with workflows restored! New auth is working too so all is good.
In case it’s helpful, here’s what I got in the log after trying to set up the user:
Error: Invalid database state - user has password set.
at /usr/local/lib/node_modules/n8n/dist/src/UserManagement/routes/auth.js:64:19
at async /usr/local/lib/node_modules/n8n/dist/src/ResponseHelper.js:90:26