Error loading images after storage template migration
Hello everyone, I posted on Reddit and was directed from a maintainer to post here as well:
After enabling the following storage template {{y}}/{{y}}-{{MM}}/{{filename}} , I ran the "Storage template migration" job. After that, all images are show as "Error loading image".
The photos are not gone, as I can see them stored in the hard drive in the following structure: /immich-upload/library/user/[photos]. Also, the server stats shows the correct photos count.
I also ran all jobs to see if it would fix it, but no success.
Anyone would have an idea what is going on and what I should do to solve this?
Details:
Immich version: 1.123.0
Installation: Docker compose in Debian server
Directory mounted from OMV NAS as SMB/CIFS
.env file:
Docker compose:


54 Replies
:wave: Hey @raf,
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. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :blue_square: reviewed the FAQs for known issues.
4. :blue_square: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: 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.What’s in the logs?
Thank you for your help!
This is repeating for each photo:
If you open up one of these assets and run the thumbnail job from the menu, what happens?
What’s at /mnt/nas/photos/immich-upload/thumbs?
This is the tree structure, level 3
The pictures are inside immich-upload/library/rafael/*
Try this
Opening them in Immich shows the same error. I also ran the thumbnail job, but didn't fix it.
This error appears in the log, when running the thumbnails job:
The thumbnails are there.
Please post the output of
docker inspect immich_server
_
not -
Underscore
Sorry, here it goes
But this just sounds like the nas was not mounted yet when the container was started to me
I'll restart the container
Can you download the original through immich?
yeah restarting should fix that
No, download doesn't work.
Just confirming my suspicions there 😛
Restarted the container, same error, pictures show as "Error loading image".
Why did it start without the .immich files though..?
Please run
docker exec -it immich_server ls /usr/src/app/upload
Now add on library/rafael/2020 to that command
2020 doesn't exist.
Do a docker compose down then docker compose up -d
Same error.
Also whats in the library/rafael folder on the NAS?
please stop immich docker, unmount the nas mount and see what is in the underlying folder
Okay, something is off. Debain server only sees 2024, but NAS has all the other years.
perhaps your NAS is not mounted at all

let me ls the mount in debian server
Ok, looks like the error is that the mount only shows one folder, for some reason.
I think it's more likely that it's not mounted at all and you're seeing your local filesystem
can you run
df -h
Looks like it's not mounted
I will stop the container and mount.
Ok, mounted back:
Restarted the container, but it is not starting:
you will need to create the .immich file in the backups folder of UPLOAD_LOCATION
it seems that for some time possible your NAS has been unmounted
so you may have a split immich install
Oh, that sounds bad. Should I create an empty file?
yes just touch .immich
I'm sorry, but what is the backup folder inside the UPLOAD_LOCATION?
I have these:
I guess you need to create it.
out of curiosity what is the size of the UPLOAD_LOCATION that is NOT on the NAS?
the one that just had 2024 (both upload and library folders)
The UPLOAD_LOCATION is pointing to the mount, that is in the NAS.
I mounted the NAS back, and I assume it merged to what was in the local folder before.
nope, no merging
whatever was there is still there if you unmount the nas
I see, so the local files are disabled (or hidden) once the mount is active?
yes
I assume those are sizes for the mount
yes
Should I unmount and check?
yep
By the way, all the photos are shown correctly now, with correctly mounting the NAS directory and adding the .immich file to a /backups folder.
I'm very grateful for your help.
But let me get back to the local directory size.
oh good
Output of local directory size:
This is funny.
ok, and how about the upload folder?
you might be able to piece things together if you put those files back in the correct spot in the NAS folder
I see. Those are probably files uploaded from my phone. Do you think if I delete everything from the local directory, it would reupload again?
no, you have to delete them through the immich UI
So copying those files to the NAS, as you suggested, should be a better option.
Is it enough to just copy the originals, or should I copy the contents of the thumbs folder as well?
Despite the following outcome, I'd like to thank you and Mraedis for the great help. Not surprising to anyone, it was my mistake, nothing related to Immich itself. Thank you for your support.