I
Immich•2mo ago
wokkieman

Feature to check if all photos are still there?

I've been moving my photos a bit between hard drives and would like to verify that I'm not missing something. I can run a count or a diff via shell, but was wondering if there was a job or something else I can use within Immich to verify that all photos known in the database are actually on my hard drive?
4 Replies
Immich
Immich•2mo ago
:wave: Hey @wokkieman, 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.
Mraedis
Mraedis•2mo ago
There currently is not You could run a query to count the lines in the asset table perhaps
Sergey Katsubo
Sergey Katsubo•2mo ago
Yeah, there is no integrity check/feature for the internal (default) library. External library has its implementation to detect offline files during scan. We can emulate it in shell and run against all assets (limit 10 in the example below):
docker exec immich_postgres psql -U postgres -d immich -At0 -c 'select "originalPath" from asset limit 10' | docker exec -i immich_server xargs -0 stat -t

/data/library/admin/2020/2020-07/mk-2020-9ffc-2020-06-28-v2.jpg 460204 904 81a4 1000 1000 fe02 1588847 ...
/data/library/admin/2021/2021-07/ml-motorcycle.webp 325034 640 81a4 1000 1000 fe02 1698868 ...
stat: cannot statx '/data/library/admin/2021/2021-03/20210313_210321.jpg': No such file or directory
stat: cannot statx '/data/library/admin/2021/2021-05/20210502_230939.jpg': No such file or directory
docker exec immich_postgres psql -U postgres -d immich -At0 -c 'select "originalPath" from asset limit 10' | docker exec -i immich_server xargs -0 stat -t

/data/library/admin/2020/2020-07/mk-2020-9ffc-2020-06-28-v2.jpg 460204 904 81a4 1000 1000 fe02 1588847 ...
/data/library/admin/2021/2021-07/ml-motorcycle.webp 325034 640 81a4 1000 1000 fe02 1698868 ...
stat: cannot statx '/data/library/admin/2021/2021-03/20210313_210321.jpg': No such file or directory
stat: cannot statx '/data/library/admin/2021/2021-05/20210502_230939.jpg': No such file or directory
(Just a quick PoC: may be vulnerable to injections from unsafe input. Also "where" clause can be added for precise filtering)
dustlesswalnut
dustlesswalnut•2mo ago
seriously a life saver, thank you so much for this! all 98 missing images have been restored 🙂

Did you find this page helpful?