immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
38.96k stars 1.84k forks source link

Read-only external library metadata edits silently fail #10538

Open pyorot opened 2 weeks ago

pyorot commented 2 weeks ago

The bug

This has been discussed several times before, but there is an unintuitive behaviour where if a user edits metadata of an asset in an external library that's mounted as read-only (say by forgetting it's read-only or believing the edit would be stored in the database or generated files) then the edit silently fails.

A simple solution that came up in discussion is to issue a generic asynchronous popup to the client saying "failed to save metadata for \<asset filename>: file system is read-only" or similar (and the log should mention "read-only" too).

The OS that Immich Server is running on

Debian 12

Version of Immich Server

v1.106.3

Version of Immich Mobile App

n/a

Platform with the issue

Your docker-compose.yml content

-

Your .env content

-

Reproduction steps

1. Edit date of asset in external library that's mounted as read-only in docker-compose.yml.
2. Click confirm.
3. Date in info pane doesn't change; 2 warnings in server logs.

Relevant log output

[Nest] 8  - 06/22/2024, 11:04:37 AM    WARN [Microservices:MetadataRepository] Error writing exif data (/mnt/assets/Pictures External/Vesna/2019-20 WhatsApp-Viber [Motorola G3]/IMG-20190816-WA0000.jpg.xmp): Error: Error creating file: /mnt/assets/Pictures External/Vesna/2019-20 WhatsApp-Viber [Motorola G3]/IMG-20190816-WA0000.jpg.xmp - /mnt/assets/Pictures External/Vesna/2019-20 WhatsApp-Viber [Motorola G3]/IMG-20190816-WA0000.jpg.xmp
[Nest] 8  - 06/22/2024, 11:04:38 AM    WARN [Microservices:Error: File not found - /mnt/assets/Pictures External/Vesna/2019-20 WhatsApp-Viber [Motorola G3]/IMG-20190816-WA0000.jpg.xmp
    at ReadTask._ExifToolTask_parser (/usr/src/app/node_modules/exiftool-vendored/dist/ExifToolTask.js:76:71)
    at ReadTask.parser (/usr/src/app/node_modules/exiftool-vendored/dist/ExifToolTask.js:47:167)
    at ReadTask._Task_resolve (/usr/src/app/node_modules/batch-cluster/dist/Task.js:146:40)] Error reading exif data (/mnt/assets/Pictures External/Vesna/2019-20 WhatsApp-Viber [Motorola G3]/IMG-20190816-WA0000.jpg.xmp): Error: File not found - /mnt/assets/Pictures External/Vesna/2019-20 WhatsApp-Viber [Motorola G3]/IMG-20190816-WA0000.jpg.xmp

Additional information

No response

wolginm commented 1 week ago

Its funny, I've been 'reproducing' this bug for a few days now and pulling out may hair in the process.

I agree, that there should be some indication on the external library, or on the file. Maybe even gray out the options so the user knows whats going on. The silent fail felt very random.

I'm just glad its not me 😄. I am going to try and loosen the permissions on the folder and see if it solves the issue for me.

EDIT: It did.