Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgresError: relation "pg_vector_index_stat" does not exist after upgrade to v1.130.x #17145

Open
2 of 4 tasks
blockbasti opened this issue Mar 26, 2025 · 8 comments
Open
2 of 4 tasks

Comments

@blockbasti
Copy link

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

After upgrading to v1.130, immich server doesn't start anymore, because pg_vector_index_stat does not exist. A downgrade to v1.129 fixes the issue. Also a backup has been restored, which didn't fix the issue. Setting the permissions as stated in the docs doesn't help either, because the whole relation is gone.

The OS that Immich Server is running on

k3s 1.31 on Ubuntu 24.04

Version of Immich Server

v1.130

Version of Immich Mobile App

v1.129.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

-

Your .env content

-

Reproduction steps

  1. Have an existing immich installation with version v1.129
  2. Upgrade to v1.130

Relevant log output

Initializing Immich v1.130.2
Detected CPU Cores: 4
Starting api worker
Starting microservices worker
[Nest] 7  - 03/26/2025, 4:55:21 PM     LOG [Microservices:EventRepository] Initialized websocket server
Query failed : {
  durationMs: 2.2266209999997955,
  error: PostgresError: relation "pg_vector_index_stat" does not exist
      at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26)
      at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6)
      at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '42P01',
    position: '24',
    file: 'parse_relation.c',
    line: '1449',
    routine: 'parserOpenTable'
  },
  sql: 'SELECT idx_status FROM pg_vector_index_stat WHERE indexname = $1',
  params: [ 'clip_index' ]
}
Query failed : {
  durationMs: 0.7454499999994368,
  error: PostgresError: relation "pg_vector_index_stat" does not exist
      at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26)
      at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6)
      at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '42P01',
    position: '24',
    file: 'parse_relation.c',
    line: '1449',
    routine: 'parserOpenTable'
  },
  sql: 'SELECT idx_status FROM pg_vector_index_stat WHERE indexname = $1',
  params: [ 'face_index' ]
}

Additional information

No response

@alextran1502
Copy link
Contributor

@alextran1502
Copy link
Contributor

Are you on the same version of pgvecto.rs as the docker-compose file? v0.2.0

What is your postgres version?

@blockbasti
Copy link
Author

Hmm, can you try this?

https://immich.app/docs/administration/postgres-standalone#common-errors

ERROR: relation "pg_vector_index_stat" does not exist

Are you on the same version of pgvecto.rs as the docker-compose file? v0.2.0

What is your postgres version?

ghcr.io/tensorchord/cloudnative-pgvecto.rs:16-v0.3.0

@alextran1502
Copy link
Contributor

Did you update to 0.3.0 recently?

@blockbasti
Copy link
Author

Did you update to 0.3.0 recently?

Nope, has been running for a while. Also downgrading the image back to v.1.129.0 starts without issue.

@mertalev
Copy link
Contributor

There's really no change related to vector indices between 1.129.0 and 1.130.0. I feel like this has to be a deployment-related issue rather than something inherent to Immich.

@mertalev
Copy link
Contributor

FWIW I don't think those errors are why Immich is crashing. The errors are logged to console, but the errors are handled and this particular one can show up if there has never been a vector index created in this DB (i.e. it's completely fresh). But it wouldn't cause Immich to crash since it's caught.

@etnoy
Copy link
Contributor

etnoy commented Mar 28, 2025

I have the same error messages in my instance but they appear benign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants