Tag failures are permanently unrecoverable: re-runs never re-tag assets that already exist on the server
Environment: same import as #1384 — immich-go 0.32.0, Immich v3.0.1, 46,557-asset Google Takeout, upload from-google-photos, default flags.
Symptom: During the import, 19 PUT /api/tags/{id}/assets batches failed with 500 while the server was under ingest load (18 of the 19 on one tag; up to ~950 asset-tag links). I re-ran the identical command against the idle server: the re-run applied tags only to the 63 assets it freshly uploaded (109 tagged events vs 61,544 in run 1). The failed links from run 1 stay lost after any number of re-runs.
Cause: manageAssetTags is only invoked from processUploadedAsset (run.go), which runs for freshly uploaded assets and skips StatusDuplicate. The SameOnServer path re-manages albums (run.go:393) but never tags. The code acknowledges the gap:
// TODO: current version of Immich doesn't allow to add same tag to an asset already tagged.
// there is no mean to go the list of tagged assets for a given tag.Impact: Albums self-heal on re-run and uploads deduplicate by checksum, so tags are the one place where a single transient server error causes permanent, silent metadata loss (silent because of #1384). The only remedy today is a hand-written API script.
Suggested fix: Treat tags like albums for SameOnServer assets — upsert the tag and PUT the asset IDs; the bulk-tag endpoint tolerates already-tagged assets. Alternatively, persist failed batches to a retry file. Retry-at-failure-time (#1367) would also mitigate, but re-run recoverability matters independently: it's the documented remedy for interrupted imports.
Addendum (2026-07-09): identified the affected tags via the API. The 18 same-tag batches were the Takeout timestamp tag, and the remaining one was a People/* tag — so the practical loss in my import was mostly cosmetic. The mechanism is unchanged (the failures land on whatever batches are in flight when the server hiccups; 18 People-tag batches would have been just as unrecoverable), but noting it for accurate severity assessment.
Source: simulot/immich-go