Open Chuckame opened 1 day ago
I personally don't view this as an Immich issue - having reliable backend storage is not something that is in Immich's control, and should be managed on the server / deployment side. Will leave open for a bit in case someone disagrees. Otherwise, I would say this is a feature request for "more resilient to regular network storage disconnection"
@mmomjian I'm not asking for retries or better handling of bad storage, I totally agree with that. I'm challenging the upload process, where maybe there is a try/catch to improve to not have inconsistencies.
After double check, it seems that the original file exists, while the thumbnail doesn't exist, and refreshing the thumbnail doesn't work as it still tries to access the thumbnail.
Currently, I'm unable to fix the issue because immich threat it as valid asset while the thumbnail literally doesn't exist and isn't able to be re-generated
Oh, I confirm back that some original files are missing. I don't know how but the Metadata and faces has been extracted well, while the original file isn't present anymore.
I found that the corruption appeared only once when I restarted the remote storage.
I'm currently in a weird state, where data has been extracted while immich fails reading the image
Is your networks storage getting unmounted? If so, you'll find the missing originals on the local disk at the path where the network storage is normally mounted.
No, I've found that it was because of a reboot, but finally the nfs mount seems stable the rest of the time. I think the issue has been a sudden timeout on storage operations.
Still, I don't understand how the faces/Metadata has been extracted while there is nothing on the disk 🤔
because of a reboot
Sounds likely that the mount didn't come up at boot and Immich ended up writing to the local disk. Did you look whether there are files there?
When it's unmounted (container stopped), the folder is completely empty. Btw, normally I cannot start the container if the mount fails, and we can't mount on a non-empty folder 🤔
Here is the order of errors:
11/28/2024, 6:37:48 PM ERROR [Api:ErrorInterceptor~3sgw8rrk] Unknown error: Error: Unknown system error -116: Unknown system error -116, mkdir 'upload/upload/a398e325-c5ed-49a1-9c01-d422130604a8/34/59'
(many)11/28/2024, 11:57:16 PM ERROR [Api:ErrorInterceptor~fv0w5q7j] Unknown error: Error: ENOENT: no such file or directory, statfs 'upload/library'
(once)11/29/2024, 12:00:00 AM WARN [Microservices:LibraryService] Skipping invalid import path: /usr/src/app/external/AAA. Reason: Error: EACCES: permission denied, stat '/usr/src/app/external/AAA'
[Nest] 7 - 11/29/2024, 12:00:00 AM WARN [Microservices:LibraryService] No valid import paths found for library ef7e34f3-f705-4919-9b63-277f2bfbc180
[Nest] 7 - 11/29/2024, 12:00:00 AM WARN [Microservices:LibraryService] Skipping invalid import path: /usr/src/app/external/BBB. Reason: Error: EACCES: permission denied, stat '/usr/src/app/external/BBB'
[Nest] 7 - 11/29/2024, 12:00:00 AM WARN [Microservices:LibraryService] No valid import paths found for library 95c90eec-97f7-4ff6-85a7-cbcdbc468a6f
11/29/2024, 12:00:00 AM ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: ffprobe exited with code 1
[...] upload/upload/a398e325-c5ed-49a1-9c01-d422130604a8/42/67/4267d5b7-a6e3-4eb2-8238-d2372ea676e7.mp4: No such file or directory
(twice on the same asset)11/29/2024, 12:00:05 AM WARN [Microservices:PersonService] Face d4d02667-3fd2-4fec-9d9d-18f908527ea2 not found
(3624 times)11/29/2024, 12:19:53 AM WARN [Microservices:MetadataService] Asset dd1e7cde-148d-41c6-b224-9cb184fdc920 has no valid date, falling back to asset.fileCreatedAt
11/29/2024, 10:41:32 PM ERROR [Api:LoggerRepository~mfkwvalm] Unable to send file: Error Error: ENOENT: no such file or directory, access 'upload/thumbs/a12a285f-cd74-4ae6-8938-5f99e5321ec3/dd/1e/dd1e7cde-148d-41c6-b224-9cb184fdc920-thumbnail.webp'
(many times, once per website visit)How to remove those assets to force the upload from the phones ?
Also, is there currently a job or cli command which verifies if the assets have the corresponding files with the corresponding hash ? Like an integrity check
The bug
I just setup a NFS mount for the library, but it seems to not be as stable as I expected. Because of that, since the link is unstable, it can fail at any moment.
This failure ended up to library inconsistencies, where the entry is in the db while the file hasn't been uploaded properly. It shows the images as broken images, and logs are printed saying the file is not existing. So the file is considered uploaded, and isn't possible to re-upload (except one-by-one manually).
I suspect a weird upload behavior, where the photo is marked as uploaded in the db before being totally uploaded, so that the thumbnail is still generated but on an inexistent asset.
Here I challenge more the upload process than the mount issues. I've seen some similar gh issues because of a bad storage.
The OS that Immich Server is running on
docker - debian
Version of Immich Server
v1.121.0
Version of Immich Mobile App
v1.121.0 build 168
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Relevant log output
Additional information
No response