"Basic auth is activated but no user got defined. Please set one!" after updating to latest docker image

Describe the issue/error/question

I am running via docker-compose. I pulled the latest container image and restarted, web interface returns 502 and docker logs show errors related to basic auth user. My .env file was not changed and contains both N8N_BASIC_AUTH_USER and N8N_BASIC_AUTH_PASSWORD sample data aside my .env file is the same as n8n/.env at master · n8n-io/n8n · GitHub

What is the error message (if any)?

N8N

n8n_1       | Initializing n8n process
n8n_1       |  ›   Error: There was an error: Basic auth is activated but no user got 
n8n_1       |  ›   defined. Please set one!

Postgres

postgres_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1  | 
postgres_1  | 2022-05-12 00:53:16.736 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1  | 2022-05-12 00:53:16.736 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1  | 2022-05-12 00:53:16.740 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1  | 2022-05-12 00:53:16.758 UTC [26] LOG:  database system was shut down at 2022-05-12 00:53:15 UTC
postgres_1  | 2022-05-12 00:53:16.763 UTC [1] LOG:  database system is ready to accept connections

Hey @j0ey, welcome to the community.

I am really sorry to hear you’re encountering this behavior. I just started a temporary container with the latest n8n docker image (n8n:0.176.0) and the environment variables from the file you have linked (docker run -it --rm --name n8n -p 5678:5678 -e N8N_BASIC_AUTH_USER=admin -e N8N_BASIC_AUTH_PASSWORD=admin n8nio/n8n:0.176.0), but it boots up fine for me :frowning:

From looking at the code it would seem the error is thrown only if n8n can’t read the user name from your environment variables. How exactly did you update and start n8n? Can you share your docker-compose.yml file (you can of course redact anything confidential)?

Thanks for testing that, after adding the credentials to my compose file it works as expected. Im not sure how it ever worked as there is no reference to .env file. I suspect that it was an argument used with docker-compose start and I ran it differently this time. A classic case of should have made better documentation :man_facepalming: