[BUG] live photo video asset of motion photos in external library incorrectly marked offline #2768

Closed
opened 2026-02-05 07:01:17 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @Ynng on GitHub (Apr 6, 2024).

The bug

Immich creates live photo video assets for motion photos found in external libraries.

These video assets are marked as offline incorrectly after every full scan.

This happens as the handleQueueAssetRefresh function determines a file to be offline if they do not exist in the import path of the library.

The video assets sit in /encoded-video instead of the external library, and are thus marked offline.

A simple fix might be creating a new mechanism specific to live photos to keep these files "online".

8f981b6052/server/src/services/library.service.ts (L616-L617)

8f981b6052/server/src/services/library.service.ts (L630)

The OS that Immich Server is running on

Fedora Linux 37

Version of Immich Server

v1.101.0

Version of Immich Mobile App

v1.101.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

# See:
# - https://immich.app/docs/developer/setup
# - https://immich.app/docs/developer/troubleshooting

name: immich-dev

x-server-build: &server-common
  image: immich-server-dev:latest
  build:
    context: ../
    dockerfile: server/Dockerfile
    target: dev
  restart: always
  volumes:
    - ../server:/usr/src/app
    - ../open-api:/usr/src/open-api
    - ${UPLOAD_LOCATION}/photos:/usr/src/app/upload
    - ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload/upload
    - /usr/src/app/node_modules
    - /etc/localtime:/etc/localtime:ro
    - ${EXTERNAL_PATH}:/usr/src/app/external
  env_file:
    - .env
  ulimits:
    nofile:
      soft: 1048576
      hard: 1048576

services:
  immich-server:
    container_name: immich_server_dev
    command: ['/usr/src/app/bin/immich-dev', 'immich']
    <<: *server-common
    ports:
      - 3001:3001
      - 9230:9230
    depends_on:
      - redis
      - database

  immich-microservices:
    container_name: immich_microservices_dev
    command: ['/usr/src/app/bin/immich-dev', 'microservices']
    <<: *server-common
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    ports:
      - 9231:9230
    depends_on:
      - database
      - immich-server

  immich-web:
    container_name: immich_web_dev
    image: immich-web-dev:latest
    build:
      context: ../web
    command: ['/usr/src/app/bin/immich-web']
    env_file:
      - .env
    ports:
      - 2283:3000
      - 24678:24678
    volumes:
      - ../web:/usr/src/app
      - ../open-api/:/usr/src/open-api/
      - /usr/src/app/node_modules
    # ulimits:
    #   nofile:
    #     soft: 1048576
    #     hard: 1048576
    restart: unless-stopped
    depends_on:
      - immich-server

  immich-machine-learning:
    container_name: immich_machine_learning_dev
    image: immich-machine-learning-dev:latest
    # extends:
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference
    build:
      context: ../machine-learning
      dockerfile: Dockerfile
      args:
        - DEVICE=cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference
    ports:
      - 3003:3003
    volumes:
      - ../machine-learning:/usr/src/app
      - model-cache:/cache
    env_file:
      - .env
    depends_on:
      - database
    restart: unless-stopped

  redis:
    container_name: immich_redis_dev
    image: redis:6.2-alpine@sha256:3fcb624d83a9c478357f16dc173c58ded325ccc5fd2a4375f3916c04cc579f70

  database:
    container_name: immich_postgres_dev
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - ${UPLOAD_LOCATION}/postgres:/var/lib/postgresql/data
    ports:
      - 5432:5432

  # set IMMICH_METRICS=true in .env to enable metrics
  # immich-prometheus:
  #   container_name: immich_prometheus
  #   ports:
  #     - 9090:9090
  #   image: prom/prometheus
  #   volumes:
  #     - ./prometheus.yml:/etc/prometheus/prometheus.yml
  #     - prometheus-data:/prometheus

  # first login uses admin/admin
  # add data source for http://immich-prometheus:9090 to get started
  # immich-grafana:
  #   container_name: immich_grafana
  #   command: ['./run.sh', '-disable-reporting']
  #   ports:
  #     - 3000:3000
  #   image: grafana/grafana:10.3.3-ubuntu
  #   volumes:
  #     - grafana-data:/var/lib/grafana

volumes:
  model-cache:
  prometheus-data:
  grafana-data:

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

# 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=postgres

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

REDIS_HOSTNAME=immich_redis_dev
EXTERNAL_PATH=./library/external

Reproduction steps

1. Add an external library
2. Add a MVIMG or MP format android motion photo to the external library. Only the jpg, not the mp4
3. On the admin settings page, "scan new library files" for the external library
4. At this point, the live photo should show up in your library and function correctly.
5. Revisit the admin settings page, click "force re-scan all library files"
6. In a database GUI, observe how all video assets in the library with original path in `upload/encoded-video` be marked offline

Additional information

No response

Originally created by @Ynng on GitHub (Apr 6, 2024). ### The bug Immich creates live photo video assets for motion photos found in external libraries. These video assets are marked as offline incorrectly after every full scan. This happens as the `handleQueueAssetRefresh` function determines a file to be offline if they do not exist in the import path of the library. The video assets sit in `/encoded-video` instead of the external library, and are thus marked offline. A simple fix might be creating a new mechanism specific to live photos to keep these files "online". https://github.com/immich-app/immich/blob/8f981b60529140af839171dc052bc49784c73911/server/src/services/library.service.ts#L616-L617 https://github.com/immich-app/immich/blob/8f981b60529140af839171dc052bc49784c73911/server/src/services/library.service.ts#L630 ### The OS that Immich Server is running on Fedora Linux 37 ### Version of Immich Server v1.101.0 ### Version of Immich Mobile App v1.101.0 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # See: # - https://immich.app/docs/developer/setup # - https://immich.app/docs/developer/troubleshooting name: immich-dev x-server-build: &server-common image: immich-server-dev:latest build: context: ../ dockerfile: server/Dockerfile target: dev restart: always volumes: - ../server:/usr/src/app - ../open-api:/usr/src/open-api - ${UPLOAD_LOCATION}/photos:/usr/src/app/upload - ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload/upload - /usr/src/app/node_modules - /etc/localtime:/etc/localtime:ro - ${EXTERNAL_PATH}:/usr/src/app/external env_file: - .env ulimits: nofile: soft: 1048576 hard: 1048576 services: immich-server: container_name: immich_server_dev command: ['/usr/src/app/bin/immich-dev', 'immich'] <<: *server-common ports: - 3001:3001 - 9230:9230 depends_on: - redis - database immich-microservices: container_name: immich_microservices_dev command: ['/usr/src/app/bin/immich-dev', 'microservices'] <<: *server-common # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding ports: - 9231:9230 depends_on: - database - immich-server immich-web: container_name: immich_web_dev image: immich-web-dev:latest build: context: ../web command: ['/usr/src/app/bin/immich-web'] env_file: - .env ports: - 2283:3000 - 24678:24678 volumes: - ../web:/usr/src/app - ../open-api/:/usr/src/open-api/ - /usr/src/app/node_modules # ulimits: # nofile: # soft: 1048576 # hard: 1048576 restart: unless-stopped depends_on: - immich-server immich-machine-learning: container_name: immich_machine_learning_dev image: immich-machine-learning-dev:latest # extends: # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference build: context: ../machine-learning dockerfile: Dockerfile args: - DEVICE=cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference ports: - 3003:3003 volumes: - ../machine-learning:/usr/src/app - model-cache:/cache env_file: - .env depends_on: - database restart: unless-stopped redis: container_name: immich_redis_dev image: redis:6.2-alpine@sha256:3fcb624d83a9c478357f16dc173c58ded325ccc5fd2a4375f3916c04cc579f70 database: container_name: immich_postgres_dev image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - ${UPLOAD_LOCATION}/postgres:/var/lib/postgresql/data ports: - 5432:5432 # set IMMICH_METRICS=true in .env to enable metrics # immich-prometheus: # container_name: immich_prometheus # ports: # - 9090:9090 # image: prom/prometheus # volumes: # - ./prometheus.yml:/etc/prometheus/prometheus.yml # - prometheus-data:/prometheus # first login uses admin/admin # add data source for http://immich-prometheus:9090 to get started # immich-grafana: # container_name: immich_grafana # command: ['./run.sh', '-disable-reporting'] # ports: # - 3000:3000 # image: grafana/grafana:10.3.3-ubuntu # volumes: # - grafana-data:/var/lib/grafana volumes: model-cache: prometheus-data: grafana-data: ``` ### 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=./library # 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=postgres # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres_dev DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis_dev EXTERNAL_PATH=./library/external ``` ### Reproduction steps ```bash 1. Add an external library 2. Add a MVIMG or MP format android motion photo to the external library. Only the jpg, not the mp4 3. On the admin settings page, "scan new library files" for the external library 4. At this point, the live photo should show up in your library and function correctly. 5. Revisit the admin settings page, click "force re-scan all library files" 6. In a database GUI, observe how all video assets in the library with original path in `upload/encoded-video` be marked offline ``` ### Additional information _No response_
OVERLORD added the 🗄️serverexternal-library labels 2026-02-05 07:01:17 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2768