immich-app / immich

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

Motion photos not working and log errors of "Asset media not found" #11680

Closed haroldfinch69 closed 1 month ago

haroldfinch69 commented 1 month ago

The bug

Motion photos have NOW stopped working and only display a red exclamation mark, in chrome desktop (Version 127.0.6533.99 (Official Build) (64-bit)) on Ubuntu 24.04. Motion pictures seem to work in the app (app version 1.111.0) and on the Chrome mobile app on Android 14.

This only for new videos uploaded, older motion photos still work on the web, mobile and app.

No changes have been made to the file structure of permissions.

The logs display the message HttpException(404) {"message":"Asset media not found","error":"Not Found","statusCode":404} when the play button on the photo is pressed

Here are the logs: https://pastebin.com/raw/Zz1qTRuJ

You can see the attempt to access the file from the desktop and the 404 error at 08/17/2024, 2:11:18 AM. I then connect from the app at: 08/17/2024, 2:11:32 AM

The OS that Immich Server is running on

Ubuntu 24.04

Version of Immich Server

V1.112.1

Version of Immich Mobile App

1.111.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.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ['start.sh', 'immich']
    volumes:
      - /mnt/nas/sync/immich_import:/mnt/nas/sync/immich_import
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 8000:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: ['start.sh', 'microservices']
    volumes:
      - ${EXTERNAL_LOCATION}:/usr/src/app/external
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    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:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e
    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

volumes:
  model-cache:

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=/mnt/nas/sync/Harry_Photoview
EXTERNAL_LOCATION=/mnt/nas/sync/immich_import
# The location where your database files are stored
DB_DATA_LOCATION=~/.config/immich/postgres

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

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

Reproduction steps

1.Click on Photo on web view
2.Go to Play Motion Photo Button

Relevant log output

immich_server            | [Nest] 17  - 08/10/2024, 3:06:01 AM   DEBUG [Api:LoggingInterceptor~up3rsxu8] GET /api/albums?assetId=aebba710-99c1-4783-a13d-4a3ff0614ea5 200 6.65ms ::ffff:192.168.0.33
immich_server            | [Nest] 17  - 08/10/2024, 3:06:24 AM   DEBUG [Api:HttpExceptionFilter~z0c80hdx] HttpException(404) {"message":"Asset media not found","error":"Not Found","statusCode":404}
immich_server            | [Nest] 17  - 08/10/2024, 3:06:24 AM   DEBUG [Api:LoggingInterceptor~z0c80hdx] GET /api/assets/6d43f776-3ff2-4cf5-85f1-d2b2b81ff8d4/thumbnail?size=preview&c=lU95Y799AGtMfjQV3c4M3qSRUJ4%3D 404 10.03ms ::ffff:192.168.0.33

Additional information

When I investigate the api calls for the motion pictures that aren't working they seem to generate a call "assets/916d40ae-59e6-46f8-8376-da003d01e564/thumbnail?size=preview&c=Cvml%2Fg4ckKR%2FxsUzksg1XpHT8tg%3D" if I take everything off from thumbnail onwards, I get a JSON response with a path to the mp4 of the live photo. The video exists at the location and plays.

I suspect somethhing has changed in the API calls or the linking of images to the videos.

haroldfinch69 commented 1 month ago

Reconverting the library to AV1 seems to have fixed this

schmitzkr commented 1 month ago

Reconverting the library to AV1 seems to have fixed this

What do you mean? Do you set AV1 as a codec not to be transcoded? or are you setting AV1 as the preferred transcoding codec? I have this issue as well, I wonder if this solution will work.