#Media is on disk, but immich can't find it in the folder structure given by the db

1 messages · Page 1 of 1 (latest)

slate hill
#

the database is assuming the thumbs to be in /upload/thumbs, but actually they are in /thumbs
I checked, the files exist, but since I didn't change anything at my setup I can't figure out what broke it and how to get it working again

indigo valeBOT
#

:wave: Hey @slate hill,

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

#

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. :ballot_box_with_check: reviewed the FAQs for known issues.
  4. :ballot_box_with_check: 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. :ballot_box_with_check: 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.

slate hill
#

I'm running on rasbian 12, with 4GB RAM

#

what was odd to me as well, was the size it showed me on the web interface. the disk has 2TB, the sd (rasbian etc.) 64GB. It started showing me the size of the small disk, even though the large one was mounted at the right location

#

my dockers are all healthy running, I don't see that ml logs are relevant in this situation

#

redis logs are only:

21793:C 26 Nov 2024 22:52:52.153 * DB saved on disk
21793:C 26 Nov 2024 22:52:52.153 * RDB: 0 MB of memory used by copy-on-write
1:M 26 Nov 2024 22:52:52.176 * Background saving terminated with success
1:M 26 Nov 2024 22:57:53.050 * 100 changes in 300 seconds. Saving...
1:M 26 Nov 2024 22:57:53.051 * Background saving started by pid 21864
21864:C 26 Nov 2024 22:57:53.135 * DB saved on disk
21864:C 26 Nov 2024 22:57:53.135 * RDB: 0 MB of memory used by copy-on-write
1:M 26 Nov 2024 22:57:53.152 * Background saving terminated with success

repeated the whole time

#

postgressql logs are a whole lot and i looked into a few of them without finding any unusual stuff

indigo valeBOT
acoustic heart
#

Ignore the upload subfolder, that’s normal

#

Please post the output of tree -L 2 from your immich folder

slate hill
#
.
├── encoded-video
│   ├── 27b8c805-6333-4e0f-9cc3-89e487da0bc6
│   └── a9c92262-ed7d-494a-8785-eb871ecc09c3
├── library
├── profile
├── thumbs
│   ├── 27b8c805-6333-4e0f-9cc3-89e487da0bc6
│   └── a9c92262-ed7d-494a-8785-eb871ecc09c3
└── upload
    ├── 27b8c805-6333-4e0f-9cc3-89e487da0bc6
    └── a9c92262-ed7d-494a-8785-eb871ecc09c3

12 directories, 0 files
acoustic heart
#

Can you find that thumb file from the error in the thumbs folder?

#

Also please post docker inspect immich_server

slate hill
polar wedge
#

/upload/thumbs is the relative path inside the container

slate hill
#

@polar wedge What do you mean with that? It obviously looks there, but the folder doesn't exist and I didn't change anything

slate hill
#

@acoustic heart could you take another look at this thread?, it seems to have gone under a little

acoustic heart
#

Did you ever find the matching file on your server? What path is it present at?

slate hill
#

the file immich searches for: ./upload/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp
where it is actually located ./thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp
relative paths from immich data directory

acoustic heart
#

Please post the entire path of where it's actually located

#

on your disk

vast frigate
#

Err on the side of too much information ;) Post, like, all the paths

#

Output of tree, etc etc

#

Full commands, including the paths you're running them in and such

slate hill
#

here immich searches: /media/disk1/immich/upload/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp
here it is located: media/disk1/immich/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp

acoustic heart
#

immich would not search for /media/disk1, so that does not make sense

#

you are putting pieces together in your head and skipping steps

slate hill
acoustic heart
#

because you don't understand the underlying immich folder structure

slate hill
#

/media/disk1/immich is my data directory

acoustic heart
#

I want to see a log showing one file that immich cannot find, and the corresponding entire path on the host disk, please run ls -l /full/path/to/file/here

acoustic heart
#

such as ls -l /media/disk1/immich/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp, with a matching log showing that file missing

slate hill
#

-rw-r--r-- 1 root root 24770 Nov 3 21:09 /media/disk1/immich/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp

#

there it exists, but running ls -l /media/disk1/immich/upload/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp gives: ls: cannot access '/media/disk1/immich/upload/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp': No such file or directory

acoustic heart
#

forget about upload/ -- this is not how the immich folders work

#

please just post the answers we ask for

#

the upload/ folder is relative to the WORKDIR, which is /usr/src/app, inside the docker container

#

it will not exist on the host FS

#

still waiting for the immich log where it can't find that file

slate hill
acoustic heart
#

ok let me take a look

slate hill
#

it's not the only one, it can't find any thumbnails, but the error is always the same so i saw no benefit of posting them all, but of course I can do that, if you want to

acoustic heart
#

ok how about this: docker exec immich_server ls -l /usr/src/app/upload/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp

slate hill
#
ls: cannot access '/usr/src/app/upload/thumbs/27b8c805-6333-4e0f-9cc3-89e487da0bc6/8c/28/8c28c7b4-20f0-4dce-a5f6-475051d3ad46-thumbnail.webp': No such file or directory
acoustic heart
#

how about docker exec immich_server ls /usr/src/app/upload

slate hill
#
backups
encoded-video
library
profile
thumbs
upload
acoustic heart
#

ok and what's in thumbs for example? can you run tree -L 2 inside the immich container? I am not sure if we ship that binary

slate hill
#

can i also run that in usr/src/app directly or do i have to do that via docker exec?

acoustic heart
#

this has to be in docker exec

#

we don't include tree

#

you might just have to do a bunch of ls commands of each subfolder

slate hill
#
docker exec immich_server ls -l /usr/src/app/upload/thumbs
drwxr-xr-x 6 root root 4096 Oct 10 17:54 27b8c805-6333-4e0f-9cc3-89e487da0bc6
acoustic heart
#

ok so I guess start going deeper and figure out when we lose the file we are looking for

#

gotta admit this is pretty strange

slate hill
acoustic heart
#

yea, I see that

#

I think you are not using the mount point you think you are using

#

perhaps the filesystem was unmounted, docker was started, then the filesystem was mounted on top of it ,so docker still has the underlying handle to the filesystem

#

you could try unmounting the external drive and look at the mount point

slate hill
#

yeah that could be very real indeed

#

I'm mounting the drive manually after each reboot, since it's external and if it's in fdisk the system won't start at all if the disk is missing
and immich is already starting or finished with that when I'm mounting the disk

acoustic heart
#

oh that is very bad

#

the .immich mount checks we now have should prevent this

vast frigate
#

That's definitely the issue lol

acoustic heart
#

but likely yours was written to the wrong one when that upgrade was added

vast frigate
#

Stop Immich, unmount the disk, move anything that's on the unmounted path aside, remount the disk and merge those files back in

#

And set up automatic mounting :P

slate hill
#

ok away from immich, i think i got this
is there a way to mount the disk automatically and still boot normal (and just skip the mounting) if the disk is missing? (raspbian 12)

acoustic heart
#

if you get things fixed now the .immich file mount checks would have caught this

#

you'll probably have to manually create a .immich file in each of the subfolders (thumbs, library, etc) when you go back to your original drive

#

in terms of how to handle mounts, you should use /etc/fstab, change the fdisk priority (it shouldn't hang if > 0) and you can also put a sleep 120 in the docker init systemctl init file

slate hill
vast frigate
slate hill
#

yeah they are

vast frigate
#

So while the disk is unmounted, move those files somewhere else

#

Then remount the disk, and move the files back

slate hill
#

Thanks a lot guys, it works again!