Unable to login after Containers were restarted

Hi There. I am currently unable;e to log back into N8n after restarting the containers. I set Postgres, and reviewed the log files for the containers, and no issues.

So when prompted with the login screen, it does recognize my user, but says my password is invalid (I did also double check my password)

If I reset the password it works and I can log in. Do it is able to store some information.

I am using portainer, i created a stack/docker compose and below is my config (With random password and url data):

version: '3.8'
networks:
    n8n_net:
        driver: bridge
services:
  n8n:
    container_name: n8n
    image: n8nio/n8n
    restart: unless-stopped
    user: 0:0
    ports:
      - 5678:5678
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=n8ndatabase
      - DB_POSTGRESDB_USER=admin
      - DB_POSTGRESDB_PASSWORD="apassword"
      - WEBHOOK_URL=https://n8.mydomain.com/
      - EXECUTIONS_PROCESS=main
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_EDITOR_BASE_URL=https://n8.mydomain.com/
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD="Test@132"
      - N8N_PROTOCOL=http
      - NODE_ENV=production
      - GENERIC_TIMEZONE=Africa/Harare
      - N8N_EMAIL_MODE=smtp
      - N8N_SMTP_PORT=587
      - N8N_SMTP_HOST=smtp.office365.com
      - N8N_SMTP_USER=admin.mydomain.com
      - N8N_SMTP_PASS=randompassword
      - [email protected]
      - N8N_SMTP_SSL=false
    volumes:
      - /home/ubuntu/DockerCompose/n8n:/home/node/.n8n
    networks:
      - n8n_net
    links:
      - postgres
    depends_on:
      postgres:
        condition: service_healthy
  postgres:
    image: postgres:11
    restart: always
    container_name: n8n_postgres
    user: 0:0
    environment:
      - POSTGRES_USER=admin
      - POSTGRES_PASSWORD="apassword
      - POSTGRES_DB=n8ndatabase
      - POSTGRES_NON_ROOT_USER=adminroot
      - POSTGRES_NON_ROOT_PASSWORD="adminrandompassword
    volumes:
      - /home/ubuntu/DockerCompose/n8n/database:/var/lib/postgresql/data
      - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -h localhost -U admin -d n8ndatabase']
      interval: 5s
      timeout: 5s
      retries: 10
    ports:
      - 3306:3306
    networks:
      - n8n_net

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @Surgical17,

Welcome to the community :tada:

It looks like your compose file is a bit old and has a couple of old config options in it although they shouldn’t be stopping you from logging in.

Best thing to do would be to use the forgot password feature which should send you an email to reset your password or if you are the only user you can run the n8n user-management:reset command from inside the container, You can find the docs page for that command here: CLI commands | n8n Docs

Hey Jon

Thank you. Thus far n8n has been great as I am use to NodeRed and this is a more simplified way of building flows that integrate well out of the box.

I managed to solve my issue, Deleted the database, created both containers from scratch and then after first login (After creating user) I immediately reset the password, restarted containers and no issue.

I have a few other issues but new tickets for them as they are unrelated.

1 Like

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