permissions vikunja.db #1932

Closed
opened 2026-03-22 13:47:29 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @jhoogeboom on GitHub (Mar 24, 2024).

Description

Using this docker-compose:

version: '3'

services:
  vikunja:
    image: vikunja/vikunja
    environment:
      VIKUNJA_SERVICE_JWTSECRET: pjicf9Cs8KjNjV
      VIKUNJA_SERVICE_PUBLICURL: http://localhost:3456/
      # Note the default path is /app/vikunja/vikunja.db.
      # This config variable moves it to a different folder so you can use a volume and 
      # store the database file outside the container so state is persisted even if the container is destroyed.
      VIKUNJA_DATABASE_PATH: /db/vikunja.db
    ports:
      - 3456:3456
    volumes:
      - ./files:/app/vikunja/files
      - ./db:/db

I also chown the folders first before starting the docker with:

mkdir $PWD/files $PWD/db
chown 1000 $PWD/files $PWD/db

but I get this error:

vikunja-vikunja-1  | info: creating the new user vikunja with 1000:1000
vikunja-vikunja-1  | usermod: no changes
vikunja-vikunja-1  | 2024-03-20T12:05:51.412579305Z: INFO       ▶ config/InitConfig 001 No config file found, using default or config from environment variables.
vikunja-vikunja-1  | 2024-03-20T12:05:51.413096055Z: CRITICAL   ▶ migration/initMigration 002 Could not connect to db: could not open database file [uid=1000, gid=1000]: open /db/vikunja.db: per

Turns out that the user 1000 does own the folder and the files, but the permission on vikunja.db is zero, I did chmod u+rw db/vikunja.db which fixes it. Perhaps it can be fixed so that the user does not have to do this.

Vikunja Version

latest docker vikunja/vikunja

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Please select

Screenshots

No response

Originally created by @jhoogeboom on GitHub (Mar 24, 2024). ### Description Using this docker-compose: ``` version: '3' services: vikunja: image: vikunja/vikunja environment: VIKUNJA_SERVICE_JWTSECRET: pjicf9Cs8KjNjV VIKUNJA_SERVICE_PUBLICURL: http://localhost:3456/ # Note the default path is /app/vikunja/vikunja.db. # This config variable moves it to a different folder so you can use a volume and # store the database file outside the container so state is persisted even if the container is destroyed. VIKUNJA_DATABASE_PATH: /db/vikunja.db ports: - 3456:3456 volumes: - ./files:/app/vikunja/files - ./db:/db ``` I also chown the folders first before starting the docker with: ``` mkdir $PWD/files $PWD/db chown 1000 $PWD/files $PWD/db ``` but I get this error: ``` vikunja-vikunja-1 | info: creating the new user vikunja with 1000:1000 vikunja-vikunja-1 | usermod: no changes vikunja-vikunja-1 | 2024-03-20T12:05:51.412579305Z: INFO ▶ config/InitConfig 001 No config file found, using default or config from environment variables. vikunja-vikunja-1 | 2024-03-20T12:05:51.413096055Z: CRITICAL ▶ migration/initMigration 002 Could not connect to db: could not open database file [uid=1000, gid=1000]: open /db/vikunja.db: per ``` Turns out that the user 1000 does own the folder and the files, but the permission on vikunja.db is zero, I did `chmod u+rw db/vikunja.db` which fixes it. Perhaps it can be fixed so that the user does not have to do this. ### Vikunja Version latest docker vikunja/vikunja ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Please select ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Mar 28, 2024):

Can you check if this is still a problem with the unstable build? (do not use your main setup for this)

@kolaente commented on GitHub (Mar 28, 2024): Can you check if this is still a problem with the unstable build? (do not use your main setup for this)
Author
Owner

@jhoogeboom commented on GitHub (Mar 29, 2024):

Just did a fresh docker compose pull on the vikunja/vikunja:unstable image, deleted the db/files, recreated them with right owner. But the vikunja.db is created without any permissions still:

16777233 20779664 ---------- 1 (1000) (1000) 0 0 "Mar 29 09:44:52 2024" "Mar 29 09:44:52 2024" "Mar 29 09:52:25 2024" "Mar 29 09:44:52 2024" 4096 0 0 db/vikunja.db
@jhoogeboom commented on GitHub (Mar 29, 2024): Just did a fresh docker compose pull on the `vikunja/vikunja:unstable` image, deleted the db/files, recreated them with right owner. But the vikunja.db is created without any permissions still: ``` 16777233 20779664 ---------- 1 (1000) (1000) 0 0 "Mar 29 09:44:52 2024" "Mar 29 09:44:52 2024" "Mar 29 09:52:25 2024" "Mar 29 09:44:52 2024" 4096 0 0 db/vikunja.db ```
Author
Owner

@kolaente commented on GitHub (Mar 29, 2024):

I was unable to reproduce this with your docker compose file and the latest unstable build.

Maybe this is a filesystem issue? Which OS are you running on? Which FS are you using?

Does it work if you touch and chown the db file manually?

@kolaente commented on GitHub (Mar 29, 2024): I was unable to reproduce this with your docker compose file and the latest unstable build. Maybe this is a filesystem issue? Which OS are you running on? Which FS are you using? Does it work if you `touch` and `chown` the db file manually?
Author
Owner

@jhoogeboom commented on GitHub (Mar 30, 2024):

Oh it seems a OS issue, I cannot reproduce this on my ubuntu box where my normal setup runs, there the database is created with the right permissions. I thought I'd try out the new container version locally on my laptop which is macOS.

@jhoogeboom commented on GitHub (Mar 30, 2024): Oh it seems a OS issue, I cannot reproduce this on my ubuntu box where my normal setup runs, there the database is created with the right permissions. I thought I'd try out the new container version locally on my laptop which is macOS.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#1932