Updating from v106.4 breaks the immich-server and microservices #3973

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

Originally created by @MadFisa on GitHub (Jul 27, 2024).

The bug

Trying to update immich to any version beyond v1.106.4 results in immich-server and microservices getting stuck in a loop. I was trying to update to the latest releaser version (v1.110.0) from v1.106.4 . The server wouldn't start. Manually rolled back version by version to see if the error disappers, but seems to work only with v1.106.4.

The OS that Immich Server is running on

Debian Bookworm

Version of Immich Server

v1.106.4

Version of Immich Mobile App

v1.109.0

Platform with the issue

  • Server
  • Web
  • Mobile

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:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - 2283: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:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.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:
      - stack.env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    restart: always

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=/data/data1/immich_photos/
DB_DATA_LOCATION=/srv/immich_db/
IMMICH_VERSION=release
DB_PASSWORD=jsbMF
DB_USERNAME=asifmp
DB_DATABASE_NAME=immich
IMMICH_VERSION=v1.106.4

Reproduction steps

1. The server was on version v1.106.4
2. Tried updating to latest release version
3. Server and microservice on bootloop
...

Relevant log output

Node.js v20.14.0
api worker exited with code 1
Detected CPU Cores: 4
Starting api worker
[Nest] 18  - 07/27/2024, 5:51:57 PM     LOG [Api:EventRepository] Initialized websocket server
Migration "AddFaceSearchRelation1718486162779" failed, error: missing chunk number 1 for toast value 58419 in pg_toast_17002
QueryFailedError: missing chunk number 1 for toast value 58419 in pg_toast_17002
    at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9)
    at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17)
    at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35)
    at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9)
    at async /usr/src/app/dist/services/database.service.js:134:17
    at async /usr/src/app/dist/repositories/database.repository.js:177:23 {
  query: '\n' +
    '            INSERT INTO face_search("faceId", embedding)\n' +
    '            SELECT id, embedding\n' +
    '            FROM asset_faces faces',
  parameters: undefined,
  driverError: error: missing chunk number 1 for toast value 58419 in pg_toast_17002
      at /usr/src/app/node_modules/pg/lib/client.js:526:17
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)
      at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9)
      at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17)
      at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35)
      at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9)
      at async /usr/src/app/dist/services/database.service.js:134:17
      at async /usr/src/app/dist/repositories/database.repository.js:177:23 {
    length: 132,
    severity: 'ERROR',
    code: 'XX001',
    detail: undefined,
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'heaptoast.c',
    line: '784',
    routine: 'heap_fetch_toast_slice'
  },
  length: 132,
  severity: 'ERROR',
  code: 'XX001',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'heaptoast.c',
  line: '784',
  routine: 'heap_fetch_toast_slice'
}
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^
QueryFailedError: missing chunk number 1 for toast value 58419 in pg_toast_17002
    at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9)
    at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17)
    at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35)
    at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9)
    at async /usr/src/app/dist/services/database.service.js:134:17
    at async /usr/src/app/dist/repositories/database.repository.js:177:23 {
  query: '\n' +
    '            INSERT INTO face_search("faceId", embedding)\n' +
    '            SELECT id, embedding\n' +
    '            FROM asset_faces faces',
  parameters: undefined,
  driverError: error: missing chunk number 1 for toast value 58419 in pg_toast_17002
      at /usr/src/app/node_modules/pg/lib/client.js:526:17
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)
      at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9)
      at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17)
      at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35)
      at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9)
      at async /usr/src/app/dist/services/database.service.js:134:17
      at async /usr/src/app/dist/repositories/database.repository.js:177:23 {
    length: 132,
    severity: 'ERROR',
    code: 'XX001',
    detail: undefined,
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'heaptoast.c',
    line: '784',
    routine: 'heap_fetch_toast_slice'
  },
  length: 132,
  severity: 'ERROR',
  code: 'XX001',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'heaptoast.c',
  line: '784',
  routine: 'heap_fetch_toast_slice'
}

Additional information

No response

Originally created by @MadFisa on GitHub (Jul 27, 2024). ### The bug Trying to update immich to any version beyond v1.106.4 results in immich-server and microservices getting stuck in a loop. I was trying to update to the latest releaser version (v1.110.0) from v1.106.4 . The server wouldn't start. Manually rolled back version by version to see if the error disappers, but seems to work only with v1.106.4. ### The OS that Immich Server is running on Debian Bookworm ### Version of Immich Server v1.106.4 ### Version of Immich Mobile App v1.109.0 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # 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: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - stack.env ports: - 2283: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: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - stack.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: - stack.env restart: always redis: container_name: immich_redis image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672 restart: always database: container_name: immich_postgres image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data restart: always volumes: model-cache: ``` ### Your .env content ```Shell UPLOAD_LOCATION=/data/data1/immich_photos/ DB_DATA_LOCATION=/srv/immich_db/ IMMICH_VERSION=release DB_PASSWORD=jsbMF DB_USERNAME=asifmp DB_DATABASE_NAME=immich IMMICH_VERSION=v1.106.4 ``` ### Reproduction steps ```bash 1. The server was on version v1.106.4 2. Tried updating to latest release version 3. Server and microservice on bootloop ... ``` ### Relevant log output ```shell Node.js v20.14.0 api worker exited with code 1 Detected CPU Cores: 4 Starting api worker [Nest] 18 - 07/27/2024, 5:51:57 PM LOG [Api:EventRepository] Initialized websocket server Migration "AddFaceSearchRelation1718486162779" failed, error: missing chunk number 1 for toast value 58419 in pg_toast_17002 QueryFailedError: missing chunk number 1 for toast value 58419 in pg_toast_17002 at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35) at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9) at async /usr/src/app/dist/services/database.service.js:134:17 at async /usr/src/app/dist/repositories/database.repository.js:177:23 { query: '\n' + ' INSERT INTO face_search("faceId", embedding)\n' + ' SELECT id, embedding\n' + ' FROM asset_faces faces', parameters: undefined, driverError: error: missing chunk number 1 for toast value 58419 in pg_toast_17002 at /usr/src/app/node_modules/pg/lib/client.js:526:17 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25) at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35) at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9) at async /usr/src/app/dist/services/database.service.js:134:17 at async /usr/src/app/dist/repositories/database.repository.js:177:23 { length: 132, severity: 'ERROR', code: 'XX001', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'heaptoast.c', line: '784', routine: 'heap_fetch_toast_slice' }, length: 132, severity: 'ERROR', code: 'XX001', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'heaptoast.c', line: '784', routine: 'heap_fetch_toast_slice' } node:internal/process/promises:289 triggerUncaughtException(err, true /* fromPromise */); ^ QueryFailedError: missing chunk number 1 for toast value 58419 in pg_toast_17002 at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35) at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9) at async /usr/src/app/dist/services/database.service.js:134:17 at async /usr/src/app/dist/repositories/database.repository.js:177:23 { query: '\n' + ' INSERT INTO face_search("faceId", embedding)\n' + ' SELECT id, embedding\n' + ' FROM asset_faces faces', parameters: undefined, driverError: error: missing chunk number 1 for toast value 58419 in pg_toast_17002 at /usr/src/app/node_modules/pg/lib/client.js:526:17 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25) at async AddFaceSearchRelation1718486162779.up (/usr/src/app/dist/migrations/1718486162779-AddFaceSearchRelation.js:18:9) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:265:35) at async DatabaseRepository.runMigrations (/usr/src/app/dist/repositories/database.repository.js:169:9) at async /usr/src/app/dist/services/database.service.js:134:17 at async /usr/src/app/dist/repositories/database.repository.js:177:23 { length: 132, severity: 'ERROR', code: 'XX001', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'heaptoast.c', line: '784', routine: 'heap_fetch_toast_slice' }, length: 132, severity: 'ERROR', code: 'XX001', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'heaptoast.c', line: '784', routine: 'heap_fetch_toast_slice' } ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3973