Failed 1.95.0 upgrade #2991

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

Originally created by @ieure on GitHub (Apr 20, 2024).

The bug

The instructions for upgrading to v1.95.0 aren't working for me; I get an error from postgresql which I've seen no other reports about.

The OS that Immich Server is running on

Docker

Version of Immich Server

1.95.0

Version of Immich Mobile App

n/a

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

networks:
  immich:

volumes:
  immich-model-cache:

services:

  # IMMICH #

  immich-server:
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes: &immich-volumes
      - ./app/immich-server/data:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - /star/library/photo/ieure/Camera:/external/ieure/Camera:ro
      - /star/library/photo/ieure/Older:/external/ieure/Older:ro
    networks:
      - immich
    environment: &immich-environment
      - IMMICH_VERSION=release
      - DB_PASSWORD=REDACTED
      - DB_HOSTNAME=immich-db
      - DB_USERNAME=postgres
      - DB_DATABASE_NAME=immich
      - REDIS_HOSTNAME=immich-redis
    depends_on:
      - immich-redis
      - immich-db
    restart: always

  immich-microservices:
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes: *immich-volumes
    networks:
      - immich
    environment: *immich-environment
    depends_on:
      - immich-redis
      - immich-db
    restart: always

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

  immich-redis:
    image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a
    restart: always
    networks:
      - immich

  immich-db:
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: REDACTED
      POSTGRES_USER: postgres
      POSTGRES_DB: immich
    volumes:
      - ./app/immich-db/data:/var/lib/postgresql/data
    networks:
      - immich
    ports:
      - 5432:5432
    restart: always

Your .env content

None, I don't use it.

Reproduction steps

1. Run the commands in the v1.95.0 upgrade instructions.
2. Find that they fail on the `SELECT pgvectors_upgrade();` step, with the same problem outlined in #7302 and #7317.
3. Follow the guidance in #7317 and delete `pg_vectors` from my PostgreSQL data directory.
4. Run the rest of the commands and find that they fail with a duplicate key error:

:  duplicate key value violates unique constraint "pg_db_role_setting_databaseid_rol_index"
DETAIL:  Key (setdatabase, setrole)=(16384, 0) already exists.

Relevant log output

immich=# begin;
BEGIN
immich=*# CREATE SCHEMA IF NOT EXISTS vectors;
ALTER DATABASE "immich" SET search_path TO "$user", public, vectors;
SET search_path TO "$user", public, vectors;
UPDATE pg_catalog.pg_extension SET extversion = '0.1.11' WHERE extname = 'vectors';
UPDATE pg_catalog.pg_extension SET extrelocatable = true WHERE extname = 'vectors';
ALTER EXTENSION vectors SET SCHEMA vectors;
UPDATE pg_catalog.pg_extension SET extrelocatable = false WHERE extname = 'vectors';
ALTER EXTENSION vectors UPDATE TO '0.2.0';
NOTICE:  schema "vectors" already exists, skipping
CREATE SCHEMA
immich=*# commit;
ERROR:  duplicate key value violates unique constraint "pg_db_role_setting_databaseid_rol_index"
DETAIL:  Key (setdatabase, setrole)=(16384, 0) already exists.
immich=!# ERROR:  current transaction is aborted, commands ignored until end of transaction block
immich=!# ERROR:  current transaction is aborted, commands ignored until end of transaction block
immich=!# ERROR:  current transaction is aborted, commands ignored until end of transaction block
immich=!# ERROR:  current transaction is aborted, commands ignored until end of transaction block
immich=!# ERROR:  current transaction is aborted, commands ignored until end of transaction block
immich=!# ERROR:  current transaction is aborted, commands ignored until end of transaction block
immich=!# ROLLBACK

Additional information

The release notes indicate that I shouldn't have to do this if the immich user is a PostgreSQL superuser. It is a superuser, but it didn't do whatever it was supposed to.

Originally created by @ieure on GitHub (Apr 20, 2024). ### The bug The instructions for upgrading to v1.95.0 aren't working for me; I get an error from postgresql which I've seen no other reports about. ### The OS that Immich Server is running on Docker ### Version of Immich Server 1.95.0 ### Version of Immich Mobile App n/a ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML networks: immich: volumes: immich-model-cache: services: # IMMICH # immich-server: image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] volumes: &immich-volumes - ./app/immich-server/data:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - /star/library/photo/ieure/Camera:/external/ieure/Camera:ro - /star/library/photo/ieure/Older:/external/ieure/Older:ro networks: - immich environment: &immich-environment - IMMICH_VERSION=release - DB_PASSWORD=REDACTED - DB_HOSTNAME=immich-db - DB_USERNAME=postgres - DB_DATABASE_NAME=immich - REDIS_HOSTNAME=immich-redis depends_on: - immich-redis - immich-db restart: always immich-microservices: image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: [ "start.sh", "microservices" ] volumes: *immich-volumes networks: - immich environment: *immich-environment depends_on: - immich-redis - immich-db restart: always immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - immich-model-cache:/cache networks: - immich environment: *immich-environment restart: always immich-redis: image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a restart: always networks: - immich immich-db: image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: REDACTED POSTGRES_USER: postgres POSTGRES_DB: immich volumes: - ./app/immich-db/data:/var/lib/postgresql/data networks: - immich ports: - 5432:5432 restart: always ``` ### Your .env content ```Shell None, I don't use it. ``` ### Reproduction steps ```bash 1. Run the commands in the v1.95.0 upgrade instructions. 2. Find that they fail on the `SELECT pgvectors_upgrade();` step, with the same problem outlined in #7302 and #7317. 3. Follow the guidance in #7317 and delete `pg_vectors` from my PostgreSQL data directory. 4. Run the rest of the commands and find that they fail with a duplicate key error: : duplicate key value violates unique constraint "pg_db_role_setting_databaseid_rol_index" DETAIL: Key (setdatabase, setrole)=(16384, 0) already exists. ``` ### Relevant log output ```shell immich=# begin; BEGIN immich=*# CREATE SCHEMA IF NOT EXISTS vectors; ALTER DATABASE "immich" SET search_path TO "$user", public, vectors; SET search_path TO "$user", public, vectors; UPDATE pg_catalog.pg_extension SET extversion = '0.1.11' WHERE extname = 'vectors'; UPDATE pg_catalog.pg_extension SET extrelocatable = true WHERE extname = 'vectors'; ALTER EXTENSION vectors SET SCHEMA vectors; UPDATE pg_catalog.pg_extension SET extrelocatable = false WHERE extname = 'vectors'; ALTER EXTENSION vectors UPDATE TO '0.2.0'; NOTICE: schema "vectors" already exists, skipping CREATE SCHEMA immich=*# commit; ERROR: duplicate key value violates unique constraint "pg_db_role_setting_databaseid_rol_index" DETAIL: Key (setdatabase, setrole)=(16384, 0) already exists. immich=!# ERROR: current transaction is aborted, commands ignored until end of transaction block immich=!# ERROR: current transaction is aborted, commands ignored until end of transaction block immich=!# ERROR: current transaction is aborted, commands ignored until end of transaction block immich=!# ERROR: current transaction is aborted, commands ignored until end of transaction block immich=!# ERROR: current transaction is aborted, commands ignored until end of transaction block immich=!# ERROR: current transaction is aborted, commands ignored until end of transaction block immich=!# ROLLBACK ``` ### Additional information The release notes indicate that I shouldn't have to do this if the immich user is a PostgreSQL superuser. It is a superuser, but it didn't do whatever it was supposed to.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2991