Album : Wrong date range display ("fileCreatedAt" not updated/set correctly) #5113

Closed
opened 2026-02-05 11:09:11 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @davidXire on GitHub (Jan 9, 2025).

The bug

Hello

I have several albums with a date range issue for the photos.
For example:

  • I have an album whose timeline (scroll) shows photos from August 9th to August 16th, 2016.
  • The album summary indicates "Jan 28, 2018 - Jan 11, 2023 • 333 items". This issue impacts the grouping of albums by year.
    image

The OS that Immich Server is running on

Debian 12

Version of Immich Server

v1.124

Version of Immich Mobile App

v1.124

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich-app

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - /mnt/elrond/photo:/mnt/media/elrond:ro
    extends:
       file: hwaccel.yml
       service: hwaccel
    env_file:
      - .env
    ports:
      - 2283:2283
    depends_on:
      - redis
      - database
    restart: always


  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
#    command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:%                                                                                                                                              
beelink immich-

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=./data/library

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

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=********
DB_PASSWORD=********

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

#LOG_LEVEL=debug

Reproduction steps

...

Relevant log output

No response

Additional information

No response

Originally created by @davidXire on GitHub (Jan 9, 2025). ### The bug Hello I have several albums with a date range issue for the photos. For example: - I have an album whose timeline (scroll) shows photos from August 9th to August 16th, 2016. - The album summary indicates "Jan 28, 2018 - Jan 11, 2023 • 333 items". This issue impacts the grouping of albums by year. ![image](https://github.com/user-attachments/assets/7d32c441-be36-4c6f-999b-db2c5f1adb27) ### The OS that Immich Server is running on Debian 12 ### Version of Immich Server v1.124 ### Version of Immich Mobile App v1.124 ### Platform with the issue - [ ] Server - [X] Web - [X] Mobile ### Your docker-compose.yml content ```YAML name: immich-app services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - /mnt/elrond/photo:/mnt/media/elrond:ro extends: file: hwaccel.yml service: hwaccel env_file: - .env ports: - 2283:2283 depends_on: - redis - database restart: always immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always database: container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 # command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"] env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - pgdata:/var/lib/postgresql/data restart: always volumes: pgdata: model-cache:% beelink immich- ``` ### Your .env content ```Shell # 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=./data/library # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secrets for postgres and typesense. You should change these to random passwords TYPESENSE_API_KEY=******** DB_PASSWORD=******** # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis #LOG_LEVEL=debug ``` ### Reproduction steps 1. 2. 3. ... ### Relevant log output _No response_ ### Additional information _No response_
OVERLORD added the external-librarydate-time labels 2026-02-05 11:09:11 +03:00
Author
Owner

@bo0tzz commented on GitHub (Jan 9, 2025):

#14824

@bo0tzz commented on GitHub (Jan 9, 2025): #14824
Author
Owner

@C-Otto commented on GitHub (Jan 25, 2025):

The album dates are derived from the oldest/youngest asset's fileCreatedAt. It seems this value is not set correctly, which is also the case in #15151. Can you provide some information about how these files were created/added? Is some app involved in the process, or did you only use the web interface? Do you use sidecar files (XMP)? Did you manually update date/time/zone information?

@C-Otto commented on GitHub (Jan 25, 2025): The album dates are derived from the oldest/youngest asset's `fileCreatedAt`. It seems this value is not set correctly, which is also the case in #15151. Can you provide some information about how these files were created/added? Is some app involved in the process, or did you only use the web interface? Do you use sidecar files (XMP)? Did you manually update date/time/zone information?
Author
Owner

@davidXire commented on GitHub (Jan 25, 2025):

The photos are rendered with Lightroom, therefore after the actual capture date.
I have no XMP file. No manual change.

@davidXire commented on GitHub (Jan 25, 2025): The photos are rendered with Lightroom, therefore after the actual capture date. I have no XMP file. No manual change.
Author
Owner

@C-Otto commented on GitHub (Jan 25, 2025):

How did Immich get to learn about those photos, i.e. what's the workflow? Web/App upload, external library, tools/plugins/api calls? Did the issue appear right away, or could this be related to (manually triggered?) jobs?

@C-Otto commented on GitHub (Jan 25, 2025): How did Immich get to learn about those photos, i.e. what's the workflow? Web/App upload, external library, tools/plugins/api calls? Did the issue appear right away, or could this be related to (manually triggered?) jobs?
Author
Owner

@davidXire commented on GitHub (Jan 25, 2025):

Photos are loaded via an external library through an NFS mount on the machine. Photos are automatically updated with the Immich system. I work directly on Lightroom on the NAS mount. I render directly to the remote directory. All photos are affected, even the oldest ones that I have never re-rendered with Immich.
I can provide metadata of photo file if you want

@davidXire commented on GitHub (Jan 25, 2025): Photos are loaded via an external library through an NFS mount on the machine. Photos are automatically updated with the Immich system. I work directly on Lightroom on the NAS mount. I render directly to the remote directory. All photos are affected, even the oldest ones that I have never re-rendered with Immich. I can provide metadata of photo file if you want
Author
Owner

@C-Otto commented on GitHub (Jan 25, 2025):

I think I know the code that is triggered here, I'll try to find how this might (not) affect the fileCreatedAt property. Thanks!

@C-Otto commented on GitHub (Jan 25, 2025): I think I know the code that is triggered here, I'll try to find how this might (not) affect the `fileCreatedAt` property. Thanks!
Author
Owner

@davidXire commented on GitHub (Jan 25, 2025):

Thanks! Feel free to ask if you have any other questions.

@davidXire commented on GitHub (Jan 25, 2025): Thanks! Feel free to ask if you have any other questions.
Author
Owner

@C-Otto commented on GitHub (Jan 25, 2025):

10e518db42/server/src/services/library.service.ts (L497-L524)

When Immich is instructed to check a single asset in an external library, for example because the file system hinted at a change, the asset's fileCreatedAt is overwritten with the modification time of the file on disk (that's the date you saved the file in Lightroom). If it stays that way, that's an issue, as the fileCreatedAt property is assumed to contain the date the photo has been taken.

However, this should also trigger a sidecar discovery (and then, metadata extraction) job for the file/asset. The metadata extraction job is only triggered if the sidecar discovery job does not fail. According to the code it should not fail in the situation you described.

Do you have pending "metadata extraction" jobs? Can you trigger a change to an image that currently is shown correctly, and observe behavior and logs for me?

@C-Otto commented on GitHub (Jan 25, 2025): https://github.com/immich-app/immich/blob/10e518db427ddcffae27832c43043678587fe3a7/server/src/services/library.service.ts#L497-L524 When Immich is instructed to check a single asset in an external library, for example because the file system hinted at a change, the asset's `fileCreatedAt` is overwritten with the modification time of the file on disk (that's the date you saved the file in Lightroom). If it stays that way, that's an issue, as the `fileCreatedAt` property is assumed to contain the date the photo has been taken. However, this should also trigger a sidecar discovery (and then, metadata extraction) job for the file/asset. The metadata extraction job is only triggered if the sidecar discovery job does not fail. According to the code it should not fail in the situation you described. Do you have pending "metadata extraction" jobs? Can you trigger a change to an image that currently is shown correctly, and observe behavior and logs for me?
Author
Owner

@C-Otto commented on GitHub (Jan 25, 2025):

In #15151 the issue seems to be the same: external library, change applied to file, fileCreatedAt is not updated as intended.

@C-Otto commented on GitHub (Jan 25, 2025): In #15151 the issue seems to be the same: external library, change applied to file, `fileCreatedAt` is not updated as intended.
Author
Owner

@C-Otto commented on GitHub (Jan 25, 2025):

If possible, try to run the following SQL query for an image that doesn't show up in the right place. Replace XXX by the asset ID (this is shown in the URL if you view the asset full screen). Take care not to delete the trailing ', the query ends with '".

docker exec -it immich_postgres psql -U postgres immich -c "select \"fileCreatedAt\",\"fileModifiedAt\",\"localDateTime\", \"createdAt\",\"updatedAt\",\"dateTimeOriginal\",asset_job_status.\"metadataExtractedAt\" from assets left join exif on (assets.id = exif.\"assetId\") left join asset_job_status on (assets.id = asset_job_status.\"assetId\") where assets.id = 'XXX'"
@C-Otto commented on GitHub (Jan 25, 2025): If possible, try to run the following SQL query for an image that doesn't show up in the right place. Replace `XXX` by the asset ID (this is shown in the URL if you view the asset full screen). Take care not to delete the trailing `'`, the query ends with `'"`. ``` docker exec -it immich_postgres psql -U postgres immich -c "select \"fileCreatedAt\",\"fileModifiedAt\",\"localDateTime\", \"createdAt\",\"updatedAt\",\"dateTimeOriginal\",asset_job_status.\"metadataExtractedAt\" from assets left join exif on (assets.id = exif.\"assetId\") left join asset_job_status on (assets.id = asset_job_status.\"assetId\") where assets.id = 'XXX'" ```
Author
Owner

@C-Otto commented on GitHub (Jan 25, 2025):

Please continue in #15640.

@C-Otto commented on GitHub (Jan 25, 2025): Please continue in #15640.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5113