Repository navigation
Replies: 2 comments 5 replies
|
Please don't send us slop. Your docker mount point(s) likely broke (or at least the mount point flaked for a brief moment), causing docker to lose the mount. |
|
In my case, since I don't know anything about databases, I used an AI to help me troubleshoot the issue. |
Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.
The bug
Technical Incident Report — Immich
Bug Report / Incident Report — Version 3
Suggested issue title: External Library scan incorrectly marks thousands of existing assets as offline and deleted
Conclusion: the investigation confirms that on August 14, 2026, an automatic External Library scan performed by
LibraryService found zero files in all three libraries. Thousands of existing assets were then marked offlined and
received a deletedAt timestamp in PostgreSQL. There is no evidence of manual user deletion.
The incident affected 68,811 assets between 00:00:00.573 and 00:00:07.211 UTC, in approximately 6.638
seconds. The physical files remained accessible in storage. After restoring the logical asset state, a validation
scan on August 17 showed normal behavior: assets were brought online and 0 assets were offlined in the library
that had completed processing.
Component Information
Operating system ZimaOS v1.7.0
Hardware ZimaCube
Architecture amd64
Immich image ghcr.io/immich-app/immich-server:release
External Libraries 3
Storage External libraries backed by remote storage mounts
Evidence Result
Affected assets 68,811
First deletedAt 2026-08-14 00:00:00.573 UTC
Last deletedAt 2026-08-14 00:00:07.211 UTC
Duration 6.638 seconds
Libraries affected 3
Disk crawl 0 files found in each library
The logs recorded the start of the External Library scan and, for each library, “Finished disk crawl, 0 file(s) found on disk”.
The LibraryService then checked the existing assets and marked them offlined in large batches.
The Immich UI restoration initially logged restoration operations, but PostgreSQL still showed the original deletedAt
timestamps for the incident assets. Because the physical files were accessible and a database backup was available, a
controlled transactional recovery was performed directly in PostgreSQL.
Exactly 68,811 assets were restored, limited to the incident's August 14 time window. Items that had already been in the
trash before the incident were left untouched.
Post-recovery state Count
Total assets 69,169
Post-recovery state Count
Active 68,982
In trash 187
Incident assets still with deletedAt 0
After recovery, a new External Library scan was performed. The LibraryService logs showed disk crawls for all three
libraries and reported 0 assets offlined due to import paths/exclusion patterns.
The first library to complete reported: 2,532 assets checked, 0 offlined, 2,468 onlined, 0 updated and 64
unchanged, with 100% progress. This demonstrates that Immich could again find the physical files and bring the
assets online.
At the time of this report, the provided logs show completion for one of the three libraries; the other two were still being
processed. Final results for all three libraries should be recorded once their scans complete.
Aug. 14 — incident Aug. 17 — validation
Automatic scan Manual/validation scan
0 files found during disk crawl Files found
Assets marked offlined 0 assets offlined
68,811 assets received deletedAt Assets restored/onlined
Libraries appeared empty to the scan Completed library: 2,468 onlined
• LibraryService performed the scan associated with the incident.
• The disk crawl returned zero files in all three External Libraries during the incident.
• 68,811 assets received deletedAt in less than seven seconds.
• The physical files remained in storage and were later accessible from the container.
• All 68,811 incident assets were recovered in the database without modifying the 187 pre-existing trash items.
• A subsequent validation scan found the files and, for the completed library, brought 2,468 assets online without offlining
any assets.
The August 17 validation scan shows that the issue is not reproduced when the mounts are accessible, but it does not
establish why the August 14 disk crawl returned zero files. Further investigation is needed into remote mount availability,
mount timing, connectivity, permissions, storage behavior, and possible race conditions during the scan.
Please investigate whether LibraryService has sufficient safeguards for External Library scans when a remote mount is
temporarily unavailable, empty, or not mounted. In this incident, a zero-file crawl was followed by mass marking of valid
assets as offline/deleted. Ideally, a scan that finds zero files in a previously populated library should be treated as an
anomalous condition before applying a large-scale destructive state change.
Please also determine whether this behavior corresponds to a known issue or has already been fixed in a newer Immich
release.
The OS that Immich Server is running on
ZimaOS v1.7.0
Version of Immich Server
3.1.0
Version of Immich Mobile App
3.1.0
Platform with the issue
Device make and model
Samsung Galaxy S23 Ultra
Your docker-compose.yml content
Your .env content
I don't use itReproduction steps
Important note:
We have not been able to reproduce the original failure deterministically under controlled conditions. The steps above describe the observed failure scenario and the environment in which it occurred.
The critical observation is that, during the incident, LibraryService reported 0 files found during the disk crawl for all three External Libraries, followed by a mass offline/deletion state affecting 68,811 existing assets. The physical files were never deleted and remained available on the underlying storage.
A subsequent scan, after the storage was accessible again, found the files normally and reported 0 assets offlined.
Relevant log output
Additional information
==========================================
ORIGINAL INCIDENT — 2026-08-14
==========================================
[Nest] LOG [Microservices:LibraryService] Initiating scan of all external libraries...
[Nest] LOG [Microservices:LibraryService] Starting disk crawl of 1 import path(s) for library ...
[Nest] LOG [Microservices:LibraryService] Starting disk crawl of 1 import path(s) for library ...
[Nest] LOG [Microservices:LibraryService] Starting disk crawl of 1 import path(s) for library ...
[Nest] LOG [Microservices:LibraryService] Finished disk crawl, 0 file(s) found on disk and queued 0 file(s) for import into library
[Nest] LOG [Microservices:LibraryService] Finished disk crawl, 0 file(s) found on disk and queued 0 file(s) for import into library
[Nest] LOG [Microservices:LibraryService] Finished disk crawl, 0 file(s) found on disk and queued 0 file(s) for import into library
Database evidence:
68,811 assets received deletedAt timestamps between:
2026-08-14 00:00:00.573 UTC
and
2026-08-14 00:00:07.211 UTC
==========================================
RECOVERY — 2026-08-17
==========================================
[Nest] LOG [Api:TrashService] Restored 1 asset(s) from trash
[Nest] LOG [Api:TrashService] Restored 27433 asset(s) from trash
==========================================
VALIDATION SCAN — 2026-08-17
==========================================
[Nest] LOG [Microservices:LibraryService] Initiating scan of all external libraries...
[Nest] LOG [Microservices:LibraryService] 0 asset(s) out of 2532 were offlined due to import paths and/or exclusion pattern(s) in library
[Nest] LOG [Microservices:LibraryService] 0 asset(s) out of 27451 were offlined due to import paths and/or exclusion pattern(s) in library
[Nest] LOG [Microservices:LibraryService] 0 asset(s) out of 39186 were offlined due to import paths and/or exclusion pattern(s) in library
[Nest] LOG [Microservices:LibraryService] Checked existing asset(s): 0 offlined, 2468 onlined, 0 updated, 64 unchanged of current batch of 2532 (Total progress: 2532 of 2532, 100.0 %) in library
[Nest] LOG [Microservices:LibraryService] Checked existing asset(s): 0 offlined, 7447 onlined, 0 updated, 4 unchanged of current batch of 7451 (Total progress: 27451 of 27451, 100.0 %) in library
[Nest] LOG [Microservices:LibraryService] Checked existing asset(s): 0 offlined, 8910 onlined, 0 updated, 276 unchanged of current batch of 9186 (Total progress: 39186 of 39186, 100.0 %) in library
[Nest] LOG [Microservices:LibraryService] Finished disk crawl, 2468 file(s) found on disk and queued 0 file(s) for import into
[Nest] LOG [Microservices:LibraryService] Finished disk crawl, 27436 file(s) found on disk and queued 2 file(s) for import into
[Nest] LOG [Microservices:LibraryService] Finished disk crawl, 38910 file(s) found on disk and queued 0 file(s) for import into
==========================================
SECONDARY ISSUE — MACHINE LEARNING
==========================================
[Nest] ERROR [Microservices] Unable to run job handler (AssetDetectFaces):
Error: Machine learning request
'{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}'
failed for all URLs
[Nest] ERROR [Microservices] Unable to run job handler (AssetDetectFaces):
Error: Machine learning request
'{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}'
failed for all URLs
All reactions