Container randomly turning off

Hi
Sometimes a bit random, and especially after host reboots all my containers go up except vikunja, it exits with erro 143

Installed vikunja with the following:

Sadly the default docker logs I see in portainer no NOT provied any details except some GET Requests from me and my uptime-kuma instance. All Gree 200, OK.

Anywhere else to view logs?


sudo mkdir -p /srv/dockerdata/vikunja/files /srv/dockerdata/vikunja/db 
sudo chown 1000 /srv/dockerdata/vikunja/files /srv/dockerdata/vikunja/db

docker run -dit \
    --name vikunja \
    -p 3456:3456 \
    --net vlan60 \
    --ip 10.90.50.240 \
    -v /srv/dockerdata/vikunja/files:/app/vikunja/files \
    -v /srv/dockerdata/vikunja/db:/db \
    -e VIKUNJA_SERVICE_PUBLICURL=https://subdomain.domain.com/ \
    --restart=unless-stopped \
    vikunja/vikunja

Hi,

Maybe you can try to set log level to debug by adding this environment variable to your docker run command:

-e VIKUNJA_LOG_LEVEL=DEBUG \

cf. https://vikunja.io/docs/config-options/#level

Hi,
Thanks for that.
As I found out, my deployment method was wrong and I also needed a DB.
Thanks for pointing this out…

After creating the stack with the following compose file:

version: '3'

services:
    vikunja:
        image: vikunja/vikunja
        environment:
            VIKUNJA_SERVICE_PUBLICURL: https://todo.example.dev
            VIKUNJA_DATABASE_HOST: db
            VIKUNJA_DATABASE_PASSWORD: {randompw1}
            VIKUNJA_DATABASE_TYPE: mysql
            VIKUNJA_DATABASE_USER: vikunja
            VIKUNJA_DATABASE_DATABASE: vikunja
            VIKUNJA_SERVICE_JWTSECRET: bca9xxxxxxxxxxx75faxxxxxxdc6f3xxxxxxxxff87exxxxxxbb
            VIKUNJA_LOG_LEVEL: DEBUG
        ports:
            - 3456:3456
        volumes:
            - /srv/dockerdata/vikunja/files:/app/vikunja/files
        depends_on:
            db:
                condition: service_healthy
        restart: unless-stopped
        networks:
            vlan20:
                ipv4_address: 10.10.20.204

    db:
        image: mariadb:10
        command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
        environment:
            MYSQL_ROOT_PASSWORD: {randompw2}
            MYSQL_USER: vikunja
            MYSQL_PASSWORD: {randompw1}
            MYSQL_DATABASE: vikunja
        volumes:
            - /srv/dockerdata/vikunja/db:/var/lib/mysql
        restart: unless-stopped
        healthcheck:
            test: ["CMD-SHELL", "mysqladmin ping -h localhost -u $$MYSQL_USER --password=$$MYSQL_PASSWORD"]
            interval: 2s
            start_period: 30s
        networks:
            vlan20:
                ipv4_address: 10.10.20.205
                
networks:
    vlan20:
        external: true

I get the following error:
db:

2024-04-28 17:10:43 118 [Warning] Access denied for user 'vikunja'@'localhost' (using password: YES)
2024-04-28 17:10:45 119 [Warning] Access denied for user 'vikunja'@'localhost' (using password: YES)
2024-04-28 17:10:47 120 [Warning] Access denied for user 'vikunja'@'localhost' (using password: YES)
2024-04-28 17:10:49 121 [Warning] Access denied for user 'vikunja'@'localhost' (using password: YES)
2024-04-28 17:10:51 122 [Warning] Access denied for user 'vikunja'@'localhost' (using password: YES)
2024-04-28 17:10:53 123 [Warning] Access denied for user 'vikunja'@'localhost' (using password: YES)

vikunja:

2024-04-28T17:15:25.014212176Z: INFO	▶ config/InitConfig 001 No config file found, using default or config from environment variables.
2024-04-28T17:15:25.016412867Z: CRITICAL	▶ migration/Migrate 003 Migration failed: Error 1045 (28000): Access denied for user 'vikunja'@'10.10.20.204' (using password: YES)
info: creating the new user vikunja with 1000:1000
usermod: no changes
2024-04-28T17:16:25.426634604Z: INFO	▶ config/InitConfig 001 No config file found, using default or config from environment variables.
2024-04-28T17:16:25.428166103Z: CRITICAL	▶ migration/Migrate 003 Migration failed: Error 1045 (28000): Access denied for user 'vikunja'@'10.10.20.204' (using password: YES)

Thank you, got it working.

But the part with the network was a bit complicated, each container needs to have it’s own ip and be in the same network.