v1.137 update - database entries have wrong path

Since I upgraded to v1.137.3 (Truenas app) all image links are broken. The path on Truenas host is /mnt/tank/immich/data/{upload,thumbs,...} however it seems the entries in the database are referencing upload/thumbs/xxxx instead of thumbs/xxxx e.g. when I run immich-admin change-media-location I see this output:
# immich-admin change-media-location
Initializing Immich v1.137.3
Detected CPU Cores: 5


Examples from the database:
- upload/thumbs/c9fc54d4-7132-413d-89f0-2d220ca26672/c9/47/c947ba79-967b-4f5f-8e11-9cbf0c19273b.jpeg
- upload/thumbs/c9fc54d4-7132-413d-89f0-2d220ca26672/ea/24/ea2423b0-6d90-49d6-9c93-7f94b1a0daf8.jpeg
- upload/thumbs/c9fc54d4-7132-413d-89f0-2d220ca26672/56/e8/56e85133-f24f-4330-b553-a32cfe45be8e.jpeg
- upload/thumbs/8f4486d6-4225-4b5d-9a92-14a64c259d0e/66/f6/66f6d17b-2e97-405e-b9a2-2a6c0812becd-preview.jpeg
- upload/thumbs/8f4486d6-4225-4b5d-9a92-14a64c259d0e/66/f6/66f6d17b-2e97-405e-b9a2-2a6c0812becd-thumbnail.webp
- upload/thumbs/8f4486d6-4225-4b5d-9a92-14a64c259d0e/52/d2/52d25706-7efc-4d44-9fd9-23cd633e1499-preview.jpeg

? Enter the previous value of IMMICH_MEDIA_LOCATION: [/data] /data
# immich-admin change-media-location
Initializing Immich v1.137.3
Detected CPU Cores: 5


Examples from the database:
- upload/thumbs/c9fc54d4-7132-413d-89f0-2d220ca26672/c9/47/c947ba79-967b-4f5f-8e11-9cbf0c19273b.jpeg
- upload/thumbs/c9fc54d4-7132-413d-89f0-2d220ca26672/ea/24/ea2423b0-6d90-49d6-9c93-7f94b1a0daf8.jpeg
- upload/thumbs/c9fc54d4-7132-413d-89f0-2d220ca26672/56/e8/56e85133-f24f-4330-b553-a32cfe45be8e.jpeg
- upload/thumbs/8f4486d6-4225-4b5d-9a92-14a64c259d0e/66/f6/66f6d17b-2e97-405e-b9a2-2a6c0812becd-preview.jpeg
- upload/thumbs/8f4486d6-4225-4b5d-9a92-14a64c259d0e/66/f6/66f6d17b-2e97-405e-b9a2-2a6c0812becd-thumbnail.webp
- upload/thumbs/8f4486d6-4225-4b5d-9a92-14a64c259d0e/52/d2/52d25706-7efc-4d44-9fd9-23cd633e1499-preview.jpeg

? Enter the previous value of IMMICH_MEDIA_LOCATION: [/data] /data
Here is the contents of /data inside the Immich container:
# ls -l /data
total 51
drwxr-xr-x 2 root root 15 Aug 5 02:00 backups
drwxr-xr-x 4 root root 5 Sep 22 2024 encoded-video
drwxr-xr-x 2 root root 3 Sep 22 2024 library
drwxr-xr-x 2 root root 3 Sep 22 2024 profile
drwxr-xr-x 4 root root 5 Sep 22 2024 thumbs
drwxr-xr-x 4 root root 5 Aug 4 22:02 upload
# ls -l /data
total 51
drwxr-xr-x 2 root root 15 Aug 5 02:00 backups
drwxr-xr-x 4 root root 5 Sep 22 2024 encoded-video
drwxr-xr-x 2 root root 3 Sep 22 2024 library
drwxr-xr-x 2 root root 3 Sep 22 2024 profile
drwxr-xr-x 4 root root 5 Sep 22 2024 thumbs
drwxr-xr-x 4 root root 5 Aug 4 22:02 upload
And inside upload/:
# ls -l /data/upload/
total 17
drwxr-xr-x 258 root root 258 Jul 4 2024 8f4486d6-4225-4b5d-9a92-14a64c259d0e
drwxr-xr-x 258 root root 258 Jul 3 2024 c9fc54d4-7132-413d-89f0-2d220ca26672
# ls -l /data/upload/
total 17
drwxr-xr-x 258 root root 258 Jul 4 2024 8f4486d6-4225-4b5d-9a92-14a64c259d0e
drwxr-xr-x 258 root root 258 Jul 3 2024 c9fc54d4-7132-413d-89f0-2d220ca26672
Is there a script I can run to 'fix' the database entries?
7 Replies
Immich
Immich5mo ago
:wave: Hey @porjo3557, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
porjo3557
porjo3557OP5mo ago
Thanks but my IMMICH_MEDIA_LOCATION is already set to /data (or did I misunderstand the post you referenced?)
Xiticks
Xiticks5mo ago
You have not shared the logs so I can’t really tell It says that it’s in /data because new photos will be saved there, tue issue is that the migration did not run so all your old photo uses upload instead of /data, that’s why you have to run the command
porjo3557
porjo3557OP5mo ago
ok, I ran the command but it doesn't seem to have made any difference. See attached command.txt I restarted Immich server, but images are broken and I see log like attached log.txt
Xiticks
Xiticks5mo ago
? Enter the previous value of IMMICH_MEDIA_LOCATION: [/data] /data
? Enter the previous value of IMMICH_MEDIA_LOCATION: [/data] /data
why do you type that?? It should be
? Enter the previous value of IMMICH_MEDIA_LOCATION: [/data] upload
? Enter the previous value of IMMICH_MEDIA_LOCATION: [/data] upload
porjo3557
porjo3557OP5mo ago
oh, I understand now. I am so dumb! 😆 It is fixed now. Thankyou for your help and your patience

Did you find this page helpful?