Problems with setting up in Docker with NPM

I followed the documentation on the website, but I am running into problems. On my server I am using Synology’s OS with Portainer and NGINX Proxy Manager. NPM is using a separate MacVLAN network with its own IP.

Here is my Docker Compose file which I deployed in Portainer.

version: '3'

services:
 vikunja:
  image: vikunja/vikunja
  environment:
    PUID: 1026
    PGID: 100
    VIKUNJA_SERVICE_PUBLICURL: https://vikunja.mydomain.com/
    VIKUNJA_DATABASE_HOST: mariadb
    VIKUNJA_DATABASE_PASSWORD: <MYPW>
    VIKUNJA_DATABASE_TYPE: mysql
    VIKUNJA_DATABASE_USER: vikunja
    VIKUNJA_DATABASE_DATABASE: vikunja
    VIKUNJA_SERVICE_JWTSECRET: <SECRET>
  ports:
   - 3456:3456
  volumes:
   - /volume2/docker/vikunja/files:/app/vikunja/files
  depends_on:
   mariadb:
    condition: service_healthy
  restart: unless-stopped
 mariadb:
  image: mariadb:10
  command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
  environment:
   MYSQL_ROOT_PASSWORD: supersupersecret
   MYSQL_USER: vikunja
   MYSQL_PASSWORD: <MYPW>
   MYSQL_DATABASE: vikunja
  volumes:
   - /volume2/docker/mariadb/db:/var/lib/mysql
  restart: unless-stopped
  healthcheck:
   test: ["CMD-SHELL", "mysqladmin ping -h localhost -u vikunja --password=<MYPW>"]
   interval: 2s
   start_period: 30s

After it gets deployed I have the following logs in the containers:

  1. For MariaDB:
    2024-04-28 19:21:00 265 [Warning] Access denied for user 'vikunja'@'localhost' (using password: YES)

  2. For Vikunja:
    info: creating the new user vikunja with 1026:100
    usermod: no changes
    2024-04-28T19:10:04.82801601Z: INFO ▶ config/InitConfig 001 No config file found, using default or config from environment variables.
    2024-04-28T19:10:04.83071995Z: CRITICAL ▶ migration/Migrate 003 Migration failed: Error 1130: Host '172.21.0.3' is not allowed to connect to this MariaDB server
    The docker/vikunja/files folder is empty.

This looks like you’re re-using database files from another database container. Please switch this so that the Vikunja-mariadb container has its own directory.

That database was empty originally, I just created it for the sake of Vikunja. However I changed the location to this, because it indeed makes more sense:
- /volume2/docker/vikunja/db:/var/lib/mysql

I’m now having the exact same errors on both container logs. :confused:

The db folder is created and filled with data, but files is empty.

The same error as before?

Did you recreate (not only restart) the container?

Yes, I completely deleted the containers and cleared the data in folders referencing any of them. With this fresh start, I receive the same errors.

Huh I’ve never seen this exact error with docker. Not sure how to fix it. You could of course switch to postgres or sqlite but that’s more of a workaround.

The files directory stay empty until you upload files (either project backgrounds or task attachments).

It is working with Postgres, I have no idea what might’ve caused the issue with MariaDB.

Thanks for the help!