When I upgraded from 24.2 to 24.3 I noticed 500 internal server errors when images were loaded. Avatar and project backgrounds is where I noticed.
I was able to delete and replace the files, but then figured out what had happened - the path had changed, most likely related to changelog item (files) Use absolute path everywhere
Container logs showed:
2024-09-23T02:18:21Z: ERROR βΆ 7f0 Error getting avatar for user 1: open /db/files/1: no such file or directory
2024-09-23T02:18:21Z: ERROR βΆ 7f1 open /db/files/1: no such file or directory
Note the delete also failed to remove the file on disk:
2024-09-23T02:26:05Z: ERROR βΆ bc2 Error deleting file 2: %!w(*fs.PathError=&{remove /db/files/2 2})
2024-09-23T02:26:05Z: WEB βΆ 192.168.3.20 DELETE 200 /api/v1/projects/1/background 25.782568ms - Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
It looks like files is now nested under ServiceRootPath where it wasnβt before. Found in diff here
The newly uploaded files were created in a new directory files
under the ServiceRootPath. This is fine, itβs just not documented in the files.basepath documentation that it MUST be under there, and no existing data migration was done.
My config; docker compose based on the documentation (sqlite config on full docker example page) with separate volumes for db and files.
name: vikunja
services:
vikunja:
image: vikunja/vikunja:0.24.3
volumes:
- vikunja-files:/files
- vikunja-config:/db
environment:
- VIKUNJA_SERVICE_ROOTPATH=/db
restart: unless-stopped
And a config.yml in the /db volume:
database:
type: sqlite
path: /db/vikunja.db
files:
basepath: /files
To aid in visualizing the change, hereβs the structure of the 2 docker volumes contents:
vikunja-config <-- mounted on /db in the container
βββ config.yml
βββ files <-- newly created files directory
β βββ 5 <-- newly uploaded
βββ vikunja.db
vikunja-files <-- mounted on /files in the container (original files directory)
βββ 1 <-- original file
I have not yet tested if simply moving the files to the new location would work without any other update (might be an easy solution for other users).
If this files.basepath config was ok before, maybe log a warning if the setting starts with /
and fallback to the original behaviour (or trigger a migration, but permissions might impact that).
Thank you for this amazing project.