QueryFailedError: access method "hnsw" does not exist #3875

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

Originally created by @Symbiot78 on GitHub (Jul 14, 2024).

The bug

updated to latest version. Error as title.

The OS that Immich Server is running on

debian

Version of Immich Server

1.107.0

Version of Immich Mobile App

not relevant

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

#
# 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
      - /srv/backup/icloud:/sources
      - /srv/backup/new_rag:/new_rag
    env_file:
      - .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:
  #   #   file: hwaccel.yml
  #   #   service: hwaccel
  #   command: [ "start.sh", "microservices" ]
  #   volumes:
  #     - ${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
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - /srv/storage0a/portainer/docker/immich-app/pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  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=/srv/photos

# 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
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

update

Relevant log output

internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'indexcmds.c',
    line: '841',
    routine: 'DefineIndex'
  },
  length: 94,
  severity: 'ERROR',
  code: '42704',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'indexcmds.c',
  line: '841',
  routine: 'DefineIndex'
}
node:internal/process/promises:391
    triggerUncaughtException(err, true /* fromPromise */);
    ^
QueryFailedError: access method "hnsw" does not exist
    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:39: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:136:17
    at async /usr/src/app/dist/repositories/database.repository.js:177:23 {
  query: '\n' +
    '      CREATE INDEX IF NOT EXISTS clip_index ON smart_search\n' +
    '      USING hnsw (embedding vector_cosine_ops)\n' +
    '      WITH (ef_construction = 300, m = 16)',
  parameters: undefined,
  driverError: error: access method "hnsw" does not exist
      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:39: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:136:17
      at async /usr/src/app/dist/repositories/database.repository.js:177:23 {
    length: 94,
    severity: 'ERROR',
    code: '42704',
    detail: undefined,
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'indexcmds.c',
    line: '841',
    routine: 'DefineIndex'
  },
  length: 94,
  severity: 'ERROR',
  code: '42704',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'indexcmds.c',
  line: '841',
  routine: 'DefineIndex'
}
Node.js v20.15.1
api worker exited with code 1
Detected CPU Cores: 4
Starting api worker
Starting microservices worker
[Nest] 7  - 07/14/2024, 7:43:40 AM     LOG [Microservices:EventRepository] Initialized websocket server

Additional information

Tried solutions here:

https://github.com/immich-app/immich/issues/10767

https://github.com/immich-app/immich/issues/10984

https://github.com/immich-app/immich/discussions/7392#discussioncomment-8580344

none seem to help me get past the error. I may not be doing the solutions right of course - but I believe I am.

Originally created by @Symbiot78 on GitHub (Jul 14, 2024). ### The bug updated to latest version. Error as title. ### The OS that Immich Server is running on debian ### Version of Immich Server 1.107.0 ### Version of Immich Mobile App not relevant ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" # # 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 - /srv/backup/icloud:/sources - /srv/backup/new_rag:/new_rag env_file: - .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: # # file: hwaccel.yml # # service: hwaccel # command: [ "start.sh", "microservices" ] # volumes: # - ${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 image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a restart: always database: container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - /srv/storage0a/portainer/docker/immich-app/pgdata:/var/lib/postgresql/data restart: always volumes: pgdata: model-cache: ``` ### 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=/srv/photos # 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 DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash update ``` ### Relevant log output ```shell internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'indexcmds.c', line: '841', routine: 'DefineIndex' }, length: 94, severity: 'ERROR', code: '42704', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'indexcmds.c', line: '841', routine: 'DefineIndex' } node:internal/process/promises:391 triggerUncaughtException(err, true /* fromPromise */); ^ QueryFailedError: access method "hnsw" does not exist 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:39: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:136:17 at async /usr/src/app/dist/repositories/database.repository.js:177:23 { query: '\n' + ' CREATE INDEX IF NOT EXISTS clip_index ON smart_search\n' + ' USING hnsw (embedding vector_cosine_ops)\n' + ' WITH (ef_construction = 300, m = 16)', parameters: undefined, driverError: error: access method "hnsw" does not exist 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:39: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:136:17 at async /usr/src/app/dist/repositories/database.repository.js:177:23 { length: 94, severity: 'ERROR', code: '42704', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'indexcmds.c', line: '841', routine: 'DefineIndex' }, length: 94, severity: 'ERROR', code: '42704', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'indexcmds.c', line: '841', routine: 'DefineIndex' } Node.js v20.15.1 api worker exited with code 1 Detected CPU Cores: 4 Starting api worker Starting microservices worker [Nest] 7 - 07/14/2024, 7:43:40 AM LOG [Microservices:EventRepository] Initialized websocket server ``` ### Additional information Tried solutions here: https://github.com/immich-app/immich/issues/10767 https://github.com/immich-app/immich/issues/10984 https://github.com/immich-app/immich/discussions/7392#discussioncomment-8580344 none seem to help me get past the error. I may not be doing the solutions right of course - but I believe I am.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3875