immich-app / immich

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

Change of date/time for local asset fails silently #11263

Closed backstab5983 closed 1 month ago

backstab5983 commented 1 month ago

The bug

Trying to change the date/time of an asset via the WebUI fails silently. I don't see anything in the container logs - even with verbose option activated. All assets are uploaded to Immich - no external libraries.

The UI allows the update, but no sidecar .xmp is created, and the UI does not reflect the change either.

Also trying to changing from the app on iOS leads to the same outcome.

Changing the location works perfectly fine, this makes me think it's not a permission issue at all.

Example video of the bug:

https://github.com/user-attachments/assets/0d723b47-ba0d-4845-8ff4-7319faf7ba6d

The OS that Immich Server is running on

Ubuntu 22.04.4 LTS

Version of Immich Server

v1.109.2

Version of Immich Mobile App

v1.109.0

Platform with the issue

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    devices:
      - /dev/dri:/dev/dri
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always
  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - /data/dockerdata/immich/model-cache:/cache
    env_file:
      - .env
    restart: always
  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:328fe6a5822256d065debb36617a8169dbfbd77b797c525288e465f56c1d392b
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always
  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: --data-checksums
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' ||
        exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}'
        --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT
        COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo
        "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command:
      - postgres
      - -c
      - shared_preload_libraries=vectors.so
      - -c
      - search_path="$$user", public, vectors
      - -c
      - logging_collector=on
      - -c
      - max_wal_size=2GB
      - -c
      - shared_buffers=512MB
      - -c
      - wal_compression=on
    restart: always
networks: {}

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/nfs/immich/library
# The location where your database files are stored
DB_DATA_LOCATION=/data/dockerdata/immich/postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=Europe/Rome

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=REDACTED

# Set logs to verbose
IMMICH_LOG_LEVEL=verbose
# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

1. Try to change date or time of an asset via WebUI or mobile app
2. No error output/no log output and no change in the date/time of the asset

Relevant log output

No response

Additional information

This has been reported in Discord by multiple users, relevant support tickets open here: https://discord.com/channels/979116623879368755/1263448032893210716 https://discord.com/channels/979116623879368755/1264305376522801244 https://discord.com/channels/979116623879368755/1261312326544658432

bo0tzz commented 1 month ago

Can you post the output of docker ps -a?

Does this happen for all files?

backstab5983 commented 1 month ago

Can you post the output of docker ps -a?

CONTAINER ID   IMAGE                                                COMMAND                  CREATED          STATUS                   PORTS                                                                                          NAMES
e334106b8719   ghcr.io/cross-seed/cross-seed:master                 "/usr/bin/catatonit …"   40 minutes ago   Up 40 minutes            0.0.0.0:2468->2468/tcp, :::2468->2468/tcp                                                      cross-seed
50e02a9dba71   ghcr.io/hotio/readarr                                "/init"                  41 minutes ago   Up 41 minutes            0.0.0.0:8787->8787/tcp, :::8787->8787/tcp                                                      readarr-audio
a5d91589e0a6   ghcr.io/immich-app/immich-machine-learning:release   "tini -- ./start.sh"     47 hours ago     Up 5 minutes (healthy)                                                                                                  immich_machine_learning
7cf5cc0bff4b   ghcr.io/immich-app/immich-server:release             "tini -- /bin/bash s…"   47 hours ago     Up 5 minutes (healthy)   0.0.0.0:2283->3001/tcp, :::2283->3001/tcp                                                      immich_server
72ffc00f2cf5   ghcr.io/wg-easy/wg-easy                              "docker-entrypoint.s…"   3 days ago       Up 3 days (healthy)      0.0.0.0:51820->51820/udp, :::51820->51820/udp, 0.0.0.0:51821->51821/tcp, :::51821->51821/tcp   wg-easy
f5e035562c20   mauricenino/dashdot                                  "docker-entrypoint.s…"   3 days ago       Up 3 days                0.0.0.0:80->3001/tcp, :::80->3001/tcp                                                          dashdot
f2b3f1ab3914   ghcr.io/hotio/sonarr                                 "/init"                  3 days ago       Up 3 days                0.0.0.0:8989->8989/tcp, :::8989->8989/tcp                                                      sonarr
a8f440c96083   ghcr.io/hotio/sonarr                                 "/init"                  3 days ago       Up 3 days                0.0.0.0:8990->8989/tcp, :::8990->8989/tcp                                                      sonarr-anime
4d3df84d41f8   ghcr.io/hotio/lidarr                                 "/init"                  6 days ago       Up 4 days                0.0.0.0:8686->8686/tcp, :::8686->8686/tcp                                                      lidarr
e900a9709d71   ghcr.io/recyclarr/recyclarr                          "/sbin/tini -- /entr…"   7 days ago       Up 4 days                                                                                                               recyclarr
7ac763404727   redis:6.2-alpine                                     "docker-entrypoint.s…"   8 days ago       Up 5 minutes (healthy)   6379/tcp                                                                                       immich_redis
e4c3798e4059   tensorchord/pgvecto-rs:pg14-v0.2.0                   "docker-entrypoint.s…"   8 days ago       Up 5 minutes (healthy)   5432/tcp                                                                                       immich_postgres
6d08a6664726   ghcr.io/hotio/plex                                   "/init"                  9 days ago       Up 4 days                                                                                                               plex
2d881454c6c7   ghcr.io/hotio/prowlarr                               "/init"                  2 weeks ago      Up 4 days                0.0.0.0:9696->9696/tcp, :::9696->9696/tcp                                                      prowlarr
8f6ffd6e4021   ghcr.io/hotio/qbittorrent                            "/init"                  3 weeks ago      Up 20 hours              0.0.0.0:8080->8080/tcp, :::8080->8080/tcp                                                      qbittorrent
414d5f0cd298   ghcr.io/flaresolverr/flaresolverr                    "/usr/bin/dumb-init …"   3 weeks ago      Up 4 days                0.0.0.0:8191->8191/tcp, :::8191->8191/tcp, 8192/tcp                                            flaresolverr
97e492d35281   ghcr.io/hotio/overseerr                              "/init"                  4 weeks ago      Up 4 days                0.0.0.0:5055->5055/tcp, :::5055->5055/tcp                                                      overseerr
b5f6d78d266d   ghcr.io/hotio/radarr                                 "/init"                  4 weeks ago      Up 4 days                0.0.0.0:7878->7878/tcp, :::7878->7878/tcp                                                      radarr
1d975f63befd   ghcr.io/hotio/bazarr                                 "/init"                  4 weeks ago      Up 4 days                0.0.0.0:6767->6767/tcp, :::6767->6767/tcp                                                      bazarr
9d9576fcbe8a   ghcr.io/hotio/autoscan                               "/init"                  4 weeks ago      Up 4 days                0.0.0.0:3030->3030/tcp, :::3030->3030/tcp                                                      autoscan
e5ff333ef2ba   ghcr.io/hotio/tautulli                               "/init"                  4 weeks ago      Up 4 days                0.0.0.0:8181->8181/tcp, :::8181->8181/tcp                                                      tautulli
dd25bab20809   fmartinou/whats-up-docker                            "/usr/bin/entrypoint…"   6 weeks ago      Up 4 days                0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                                      wud
5e0131a34b93   ghcr.io/ajnart/homarr                                "sh ./scripts/run.sh"    2 months ago     Up 4 days (healthy)      0.0.0.0:7575->7575/tcp, :::7575->7575/tcp                                                      homarr
5a9968de65e1   louislam/dockge:latest                               "/usr/bin/dumb-init …"   4 months ago     Up 4 days (healthy)      0.0.0.0:5001->5001/tcp, :::5001->5001/tcp                                                      dockge

Does this happen for all files?

It looks me it does happen to all files.

janriedler commented 1 month ago

You need to reload the page in order to see the change (worked for me). For the mobile app you need to reload the timeline by pulling the view down twice.

backstab5983 commented 1 month ago

You need to reload the page in order to see the change (worked for me). For the mobile app you need to reload the timeline by pulling the view down twice.

Not working sadly, Immich is not changing the exif data of the file and neither creating or editing the .xmp sidecar file, so no change is detected even if refreshing the page, or restarting the container.

starbuck93 commented 1 month ago

Chiming in here with the same issue as echoed from the discord help channel.

A lot of my photos and videos can have the time changed, but there are a handful that cannot. Nothing interesting showed up in the logs either time. I posted my logs in the discord link ^

https://github.com/user-attachments/assets/740ea7df-96da-49b2-b3c3-ba9eadec5676

https://github.com/user-attachments/assets/dedec5d8-7443-4c7e-885b-09b03d43d6d0

WhiteWoodenWall commented 1 month ago

Same problem here. I have many photos uploaded directly to Immich which have completely wrong dates and no way to change them. Trying to edit via the GUI results in no error but also no change to the date/time.

However, if I download the asset, completely delete it from Immich, then reupload it, I am able to change the datetime with the newly uploaded image. The metadata also seems more accurate after reupload.

I initially uploaded all my assets from a Google Photos export via Immich-Go, not sure whether that could have caused an issue?

backstab5983 commented 1 month ago

However, if I download the asset, completely delete it from Immich, then reupload it, I am able to change the datetime with the newly uploaded image. The metadata also seems more accurate after reupload.

I can reproduce this. I also uploaded most my assets with Immich-Go

michelheusschen commented 1 month ago

Immich-go started uploading a sidecar file containing DateTimeOriginal in https://github.com/simulot/immich-go/pull/337. Immich considers this an override and will always use this date https://github.com/immich-app/immich/blob/b53bd8c525c9760871529334b26571f672eabaf0/server/src/services/metadata.service.ts#L498-L504

bo0tzz commented 1 month ago

We currently write metadata changes into the CreationDate field. We should probably use a higher priority one. https://github.com/immich-app/immich/blob/b53bd8c525c9760871529334b26571f672eabaf0/server/src/services/metadata.service.ts#L39-L49

backstab5983 commented 1 month ago

Immich-go started uploading a sidecar file containing DateTimeOriginal in simulot/immich-go#337.

Thanks for the clarification!

Do you guys think this should be reported in the Immich-Go repo? It seems to me quite a widely used tool, mentioned in the official Docs as well as a community project :)

bo0tzz commented 1 month ago

cc @simulot for good measure, but I don't think immich-go is doing anything wrong here

simulot commented 1 month ago

when Immich-go can determine the date of capture or GPS, it injects a virtual XMP with the relevant data. Maybe, this is linked with the incident

vbMatthew commented 1 month ago

This seems to only be associated with files uploaded with immich-go. I manually uploaded an image and had no problem with changing the date/time, but the file upload with immich-go can't be.

From the 'web client' side of things, the asset PUT call is made the PUT /api/assets/98e7c109-dbad-42ca-9a08-97c161aef073 and its return object includes the updated date time. However a follow up GET /api/assets/98e7c109-dbad-42ca-9a08-97c161aef073 call is made and that has the date/time with the original value.

This seems odd as https://github.com/immich-app/immich/blob/d0b3dd888b33a0e242291c7aff70d994c9db62e9/server/src/services/asset.service.ts#L158 appears to return the asset back from the repository? But I just started looking through the source.

simulot commented 1 month ago

Using the admin account: the date modification is immediately visible.

Using a regular account: the date change isn't immediately reflected on the UI. However the XMP file is updated. When refreshing the asset page, the date is correct.