relation "user_metadata" does not exist QueryFailedError: relation "user_metadata" does not exist #3440

Closed
opened 2026-02-05 08:28:12 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @teerameth on GitHub (Jun 11, 2024).

The bug

After immich server upgrading from 1.105 to 1.106.1, the following error showing up during login via web UI.
relation "user_metadata" does not exist QueryFailedError: relation "user_metadata" does not exist

The OS that Immich Server is running on

Ubuntu 22.04

Version of Immich Server

v1.106.1

Version of Immich Mobile App

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.transcoding.yml
      service: rkmpp
    volumes:
      - ${UPLOAD_LOCATION}/thumbs:/usr/src/app/upload/thumbs
      - ${UPLOAD_LOCATION}/profile:/usr/src/app/upload/profile
      - upload:/usr/src/app/upload/upload
      - library:/usr/src/app/upload/library
      - encoded-video:/usr/src/app/upload/encoded-video
      - /etc/localtime:/etc/localtime:ro
    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: armnn # 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:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900
    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}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT SUM(checksum_failures) 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:
  pgdata:
  model-cache:
  upload:
      driver: local
      driver_opts:
        type: cifs
        device: "//192.168.0.43/immich/upload"
  library:
      driver: local
      driver_opts:
        type: cifs
        device: "//192.168.0.43/immich/library"
  encoded-video:
      driver: local
      driver_opts:
        type: cifs
        device: "//192.168.0.43/immich/encoded-video"

Your .env content

UPLOAD_LOCATION=./library
DB_DATA_LOCATION=./postgres

IMMICH_VERSION=release

DB_PASSWORD=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

1. Bring server down with "docker compose down"
2. Modify existing docker-compose.yml file
    - remove immich-microservices container
    - Move extension hwaccel.transcoding.yml from old immich-microservices to immich_server
    - change image of immich_postgres & immich_redis according to provided docker-compose.yml)
3. Update server with "docker compose pull"
4. Start server with "docker compose up -d"
5. Login via immich web UI
...

Relevant log output

-11 12:22:16.001 UTC [135] STATEMENT:  SELECT DISTINCT "distinctAlias"."SessionEntity_id" AS "ids_SessionEntity_id" FROM (SELECT "SessionEntity"."id" AS "SessionEntity_id", "SessionEntity"."userId" AS "SessionEntity_userId", "SessionEntity"."createdAt" AS "SessionEntity_createdAt", "SessionEntity"."updatedAt" AS "SessionEntity_updatedAt", "SessionEntity"."deviceType" AS "SessionEntity_deviceType", "SessionEntity"."deviceOS" AS "SessionEntity_deviceOS", "SessionEntity__SessionEntity_user"."id" AS "SessionEntity__SessionEntity_user_id", "SessionEntity__SessionEntity_user"."name" AS "SessionEntity__SessionEntity_user_name", "SessionEntity__SessionEntity_user"."isAdmin" AS "SessionEntity__SessionEntity_user_isAdmin", "SessionEntity__SessionEntity_user"."email" AS "SessionEntity__SessionEntity_user_email", "SessionEntity__SessionEntity_user"."storageLabel" AS "SessionEntity__SessionEntity_user_storageLabel", "SessionEntity__SessionEntity_user"."oauthId" AS "SessionEntity__SessionEntity_user_oauthId", "SessionEntity__SessionEntity_user"."profileImagePath" AS "SessionEntity__SessionEntity_user_profileImagePath", "SessionEntity__SessionEntity_user"."shouldChangePassword" AS "SessionEntity__SessionEntity_user_shouldChangePassword", "SessionEntity__SessionEntity_user"."createdAt" AS "SessionEntity__SessionEntity_user_createdAt", "SessionEntity__SessionEntity_user"."deletedAt" AS "SessionEntity__SessionEntity_user_deletedAt", "SessionEntity__SessionEntity_user"."status" AS "SessionEntity__SessionEntity_user_status", "SessionEntity__SessionEntity_user"."updatedAt" AS "SessionEntity__SessionEntity_user_updatedAt", "SessionEntity__SessionEntity_user"."quotaSizeInBytes" AS "SessionEntity__SessionEntity_user_quotaSizeInBytes", "SessionEntity__SessionEntity_user"."quotaUsageInBytes" AS "SessionEntity__SessionEntity_user_quotaUsageInBytes", "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."userId" AS "469e6aa7ff79eff78f8441f91ba15bb07d3634dd_userId", "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."key" AS "469e6aa7ff79eff78f8441f91ba15bb07d3634dd_key", "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."value" AS "469e6aa7ff79eff78f8441f91ba15bb07d3634dd_value" FROM "sessions" "SessionEntity" LEFT JOIN "users" "SessionEntity__SessionEntity_user" ON "SessionEntity__SessionEntity_user"."id"="SessionEntity"."userId" AND ("SessionEntity__SessionEntity_user"."deletedAt" IS NULL)  LEFT JOIN "user_metadata" "469e6aa7ff79eff78f8441f91ba15bb07d3634dd" ON "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."userId"="SessionEntity__SessionEntity_user"."id" WHERE (("SessionEntity"."token" = $1))) "distinctAlias" ORDER BY "SessionEntity_id" ASC LIMIT 1
2024-06-11 12:22:16.010 UTC [132] ERROR:  relation "user_metadata" does not exist at character 2354

Additional information

No response

Originally created by @teerameth on GitHub (Jun 11, 2024). ### The bug After immich server upgrading from 1.105 to 1.106.1, the following error showing up during login via web UI. **relation "user_metadata" does not exist QueryFailedError: relation "user_metadata" does not exist** ### The OS that Immich Server is running on Ubuntu 22.04 ### Version of Immich Server v1.106.1 ### Version of Immich Mobile App - ### Platform with the issue - [X] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} extends: file: hwaccel.transcoding.yml service: rkmpp volumes: - ${UPLOAD_LOCATION}/thumbs:/usr/src/app/upload/thumbs - ${UPLOAD_LOCATION}/profile:/usr/src/app/upload/profile - upload:/usr/src/app/upload/upload - library:/usr/src/app/upload/library - encoded-video:/usr/src/app/upload/encoded-video - /etc/localtime:/etc/localtime:ro 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: armnn # 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:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900 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}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT SUM(checksum_failures) 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: pgdata: model-cache: upload: driver: local driver_opts: type: cifs device: "//192.168.0.43/immich/upload" library: driver: local driver_opts: type: cifs device: "//192.168.0.43/immich/library" encoded-video: driver: local driver_opts: type: cifs device: "//192.168.0.43/immich/encoded-video" ``` ### Your .env content ```Shell UPLOAD_LOCATION=./library DB_DATA_LOCATION=./postgres IMMICH_VERSION=release DB_PASSWORD=postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps ```bash 1. Bring server down with "docker compose down" 2. Modify existing docker-compose.yml file - remove immich-microservices container - Move extension hwaccel.transcoding.yml from old immich-microservices to immich_server - change image of immich_postgres & immich_redis according to provided docker-compose.yml) 3. Update server with "docker compose pull" 4. Start server with "docker compose up -d" 5. Login via immich web UI ... ``` ### Relevant log output ```shell -11 12:22:16.001 UTC [135] STATEMENT: SELECT DISTINCT "distinctAlias"."SessionEntity_id" AS "ids_SessionEntity_id" FROM (SELECT "SessionEntity"."id" AS "SessionEntity_id", "SessionEntity"."userId" AS "SessionEntity_userId", "SessionEntity"."createdAt" AS "SessionEntity_createdAt", "SessionEntity"."updatedAt" AS "SessionEntity_updatedAt", "SessionEntity"."deviceType" AS "SessionEntity_deviceType", "SessionEntity"."deviceOS" AS "SessionEntity_deviceOS", "SessionEntity__SessionEntity_user"."id" AS "SessionEntity__SessionEntity_user_id", "SessionEntity__SessionEntity_user"."name" AS "SessionEntity__SessionEntity_user_name", "SessionEntity__SessionEntity_user"."isAdmin" AS "SessionEntity__SessionEntity_user_isAdmin", "SessionEntity__SessionEntity_user"."email" AS "SessionEntity__SessionEntity_user_email", "SessionEntity__SessionEntity_user"."storageLabel" AS "SessionEntity__SessionEntity_user_storageLabel", "SessionEntity__SessionEntity_user"."oauthId" AS "SessionEntity__SessionEntity_user_oauthId", "SessionEntity__SessionEntity_user"."profileImagePath" AS "SessionEntity__SessionEntity_user_profileImagePath", "SessionEntity__SessionEntity_user"."shouldChangePassword" AS "SessionEntity__SessionEntity_user_shouldChangePassword", "SessionEntity__SessionEntity_user"."createdAt" AS "SessionEntity__SessionEntity_user_createdAt", "SessionEntity__SessionEntity_user"."deletedAt" AS "SessionEntity__SessionEntity_user_deletedAt", "SessionEntity__SessionEntity_user"."status" AS "SessionEntity__SessionEntity_user_status", "SessionEntity__SessionEntity_user"."updatedAt" AS "SessionEntity__SessionEntity_user_updatedAt", "SessionEntity__SessionEntity_user"."quotaSizeInBytes" AS "SessionEntity__SessionEntity_user_quotaSizeInBytes", "SessionEntity__SessionEntity_user"."quotaUsageInBytes" AS "SessionEntity__SessionEntity_user_quotaUsageInBytes", "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."userId" AS "469e6aa7ff79eff78f8441f91ba15bb07d3634dd_userId", "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."key" AS "469e6aa7ff79eff78f8441f91ba15bb07d3634dd_key", "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."value" AS "469e6aa7ff79eff78f8441f91ba15bb07d3634dd_value" FROM "sessions" "SessionEntity" LEFT JOIN "users" "SessionEntity__SessionEntity_user" ON "SessionEntity__SessionEntity_user"."id"="SessionEntity"."userId" AND ("SessionEntity__SessionEntity_user"."deletedAt" IS NULL) LEFT JOIN "user_metadata" "469e6aa7ff79eff78f8441f91ba15bb07d3634dd" ON "469e6aa7ff79eff78f8441f91ba15bb07d3634dd"."userId"="SessionEntity__SessionEntity_user"."id" WHERE (("SessionEntity"."token" = $1))) "distinctAlias" ORDER BY "SessionEntity_id" ASC LIMIT 1 2024-06-11 12:22:16.010 UTC [132] ERROR: relation "user_metadata" does not exist at character 2354 ``` ### Additional information _No response_
Author
Owner

@teerameth commented on GitHub (Jun 11, 2024):

I've just rollback to previous version by setting IMMICH_VERSION=v1.105.0 and everything work fine like before.

@teerameth commented on GitHub (Jun 11, 2024): I've just rollback to previous version by setting IMMICH_VERSION=v1.105.0 and everything work fine like before.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3440