Installation using docker compose results in Failed Migration - Error 1045

I am trying to install using the Example without any proxy example. I am starting a new stack in Portainer and using the Docker Compose below:

version: '3'

services:
  vikunja:
    image: vikunja/vikunja
    environment:
      VIKUNJA_SERVICE_PUBLICURL: http://192.168.86.39:3456
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: secret
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: <a super secure random secret>
    ports:
      - 3456:3456
    volumes:
      - ./files:/app/vikunja/files
    depends_on:
      db:
        condition: service_healthy
    restart: unless-stopped
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: supersupersecret
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: supersecret
      MYSQL_DATABASE: vikunja
    volumes:
      - ./db:/var/lib/mysql
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "--silent"]
      interval: 2s

I am seeing the following errors in the db container:

2024-02-13  4:52:59 306 [Warning] Access denied for user 'vikunja'@'172.24.0.3' (using password: YES)
2024-02-13  4:53:01 307 [Warning] Access denied for user 'root'@'localhost' (using password: NO)

And seeing the following errors in the vikunja container:

info: creating the new user vikunja with 1000:1000
usermod: no changes
2024-02-13T04:51:59.403922242Z: INFO	▶ config/InitConfig 001 No config file found, using default or config from environment variables.
2024-02-13T04:51:59.410603163Z: CRITICAL	▶ migration/Migrate 003 Migration failed: Error 1045 (28000): Access denied for user 'vikunja'@'172.24.0.3' (using password: YES)

I am a little stuck and not sure where I am going wrong. Thank you for the help!

The MYSQL_PASSWORD and VIKUNJA_DATABASE_PASSWORD do not match. That was an issue in the documentation, which is now fixed.

1 Like

Thank you! This fixed my issue and I was able to get the container up and running.

I see that the documentation for Example without any proxy now has “changeme” listed as the password for VIKUNJA_DATABASE_PASSWORD and MYSQL_PASSWORD. It might be even more clear if there was another note in this section that states the two passwords must match. That way there is no confusion in the future. Thanks again!