I
Immich2mo ago
Jonsch

PostgresError: operator does not exists

Hi I am trying to setup immich on k8s with cloudnative-pg I have followed this blog and followed the issues found in the helm repo.
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: immich-pg
namespace: immich
spec:
instances: 2
bootstrap:
initdb:
database: immich
owner: immich
postInitSQL:
- CREATE EXTENSION IF NOT EXISTS "vectors";
- CREATE EXTENSION IF NOT EXISTS "cube" CASCADE;
- CREATE EXTENSION IF NOT EXISTS "earthdistance" CASCADE;
storage:
size: 5Gi
imageName: ghcr.io/tensorchord/cloudnative-pgvecto.rs:16.5-v0.3.0
managed:
roles:
- name: immich
superuser: true
login: true
postgresql:
shared_preload_libraries:
- "vectors.so"
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: immich-pg
namespace: immich
spec:
instances: 2
bootstrap:
initdb:
database: immich
owner: immich
postInitSQL:
- CREATE EXTENSION IF NOT EXISTS "vectors";
- CREATE EXTENSION IF NOT EXISTS "cube" CASCADE;
- CREATE EXTENSION IF NOT EXISTS "earthdistance" CASCADE;
storage:
size: 5Gi
imageName: ghcr.io/tensorchord/cloudnative-pgvecto.rs:16.5-v0.3.0
managed:
roles:
- name: immich
superuser: true
login: true
postgresql:
shared_preload_libraries:
- "vectors.so"
The main things work except the ml jobs and searching then I get the error in the server:
[Nest] 8 - 05/06/2025, 9:30:36 PM ERROR [Microservices:{"id":"d65ceb22-7696-4cef-bc3d-cdcd19a8d615","source":"upload"}] Unable to run job handler (duplicateDetection/duplicate-detection): PostgresError: operator does not exist: vectors.vector <=> unknown
PostgresError: operator does not exist: vectors.vector <=> unknown
at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:790:26)
at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:476: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)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
[Nest] 8 - 05/06/2025, 9:30:36 PM ERROR [Microservices:{"id":"d65ceb22-7696-4cef-bc3d-cdcd19a8d615","source":"upload"}] Unable to run job handler (duplicateDetection/duplicate-detection): PostgresError: operator does not exist: vectors.vector <=> unknown
PostgresError: operator does not exist: vectors.vector <=> unknown
at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:790:26)
at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:476: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)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
had anybody anything similar or should I create an issue?
🏡 Frank Zhao
Immich
Notes on deploying Immich on k3s Kubernetes. I use the community Immich Helm chart with Cloudnative Postgres . Pre-requisites Set up Postgres When using the community Immich helm chart, the postgres subchart is deprecated, so we will need to set up our own postgres instances for Immich.
5 Replies
Immich
Immich2mo ago
:wave: Hey @Jonsch, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
Zeus
Zeus2mo ago
No need for an issue, this is a deployment related problem, not an immich bug I do not use this system but maybe someone else who does will have an idea
Jonsch
JonschOP2mo ago
Thats what I though and why i am here 🙂 Here are logs for the ml pod
[...]
[05/06/25 21:36:34] INFO Shutting down due to inactivity.
[05/06/25 21:36:34] INFO Shutting down
[05/06/25 21:36:34] INFO Waiting for application shutdown.
[05/06/25 21:36:34] INFO Application shutdown complete.
[05/06/25 21:36:34] INFO Finished server process [365]
[05/06/25 21:36:34] ERROR Worker (pid:365) was sent SIGINT!
[05/06/25 21:36:34] INFO Booting worker with pid: 414
[05/06/25 21:36:37] INFO Started server process [414]
[05/06/25 21:36:37] INFO Waiting for application startup.
[05/06/25 21:36:37] INFO Created in-memory cache with unloading after 300s
of inactivity.
[05/06/25 21:36:37] INFO Initialized request thread pool with 8 threads.
[05/06/25 21:36:37] INFO Application startup complete.
[...]
[05/06/25 21:36:34] INFO Shutting down due to inactivity.
[05/06/25 21:36:34] INFO Shutting down
[05/06/25 21:36:34] INFO Waiting for application shutdown.
[05/06/25 21:36:34] INFO Application shutdown complete.
[05/06/25 21:36:34] INFO Finished server process [365]
[05/06/25 21:36:34] ERROR Worker (pid:365) was sent SIGINT!
[05/06/25 21:36:34] INFO Booting worker with pid: 414
[05/06/25 21:36:37] INFO Started server process [414]
[05/06/25 21:36:37] INFO Waiting for application startup.
[05/06/25 21:36:37] INFO Created in-memory cache with unloading after 300s
of inactivity.
[05/06/25 21:36:37] INFO Initialized request thread pool with 8 threads.
[05/06/25 21:36:37] INFO Application startup complete.
Here some of the primary pg database
{"level":"info","ts":"2025-05-06T21:31:35.39686133Z","logger":"postgres","msg":"record","logging_pod":"immich-pg-2","record":{"log_time":"2025-05-06 21:31:35.396 UTC","user_name":"immich","database_name":"immich","process_id":"20150","connection_from":"fd00:cafe:1::2a25:49670","session_id":"681a7dbe.4eb6","session_line_num":"15","command_tag":"PARSE","session_start_time":"2025-05-06 21:23:10 UTC","virtual_transaction_id":"11/1319","transaction_id":"0","error_severity":"ERROR","sql_state_code":"42883","message":"operator does not exist: vectors.vector <=> unknown","hint":"No operator matches the given name and argument types. You might need to add explicit type casts.","query":"with \"cte\" as (select \"asset_faces\".\"id\", \"asset_faces\".\"personId\", face_search.embedding <=> $1 as \"distance\" from \"asset_faces\" inner join \"assets\" on \"assets\".\"id\" = \"asset_faces\".\"assetId\" inner join \"face_search\" on \"face_search\".\"faceId\" = \"asset_faces\".\"id\" left join \"person\" on \"person\".\"id\" = \"asset_faces\".\"personId\" where \"assets\".\"ownerId\" = any($2::uuid[]) and \"assets\".\"deletedAt\" is null and (\"person\".\"birthDate\" is null or \"person\".\"birthDate\" <= $3) order by face_search.embedding <=> $4 limit $5) select * from \"cte\" where \"cte\".\"distance\" <= $6","query_pos":"91","application_name":"postgres.js","backend_type":"client backend","query_id":"0"}}
{"level":"info","ts":"2025-05-06T21:35:54.110498811Z","logger":"postgres","msg":"record","logging_pod":"immich-pg-2","record":{"log_time":"2025-05-06 21:35:54.106 UTC","process_id":"27","session_id":"6819c0af.1b","session_line_num":"60","session_start_time":"2025-05-06 07:56:31 UTC","transaction_id":"0","error_severity":"LOG","sql_state_code":"00000","message":"checkpoint starting: time","backend_type":"checkpointer","query_id":"0"}}
{"level":"info","ts":"2025-05-06T21:31:35.39686133Z","logger":"postgres","msg":"record","logging_pod":"immich-pg-2","record":{"log_time":"2025-05-06 21:31:35.396 UTC","user_name":"immich","database_name":"immich","process_id":"20150","connection_from":"fd00:cafe:1::2a25:49670","session_id":"681a7dbe.4eb6","session_line_num":"15","command_tag":"PARSE","session_start_time":"2025-05-06 21:23:10 UTC","virtual_transaction_id":"11/1319","transaction_id":"0","error_severity":"ERROR","sql_state_code":"42883","message":"operator does not exist: vectors.vector <=> unknown","hint":"No operator matches the given name and argument types. You might need to add explicit type casts.","query":"with \"cte\" as (select \"asset_faces\".\"id\", \"asset_faces\".\"personId\", face_search.embedding <=> $1 as \"distance\" from \"asset_faces\" inner join \"assets\" on \"assets\".\"id\" = \"asset_faces\".\"assetId\" inner join \"face_search\" on \"face_search\".\"faceId\" = \"asset_faces\".\"id\" left join \"person\" on \"person\".\"id\" = \"asset_faces\".\"personId\" where \"assets\".\"ownerId\" = any($2::uuid[]) and \"assets\".\"deletedAt\" is null and (\"person\".\"birthDate\" is null or \"person\".\"birthDate\" <= $3) order by face_search.embedding <=> $4 limit $5) select * from \"cte\" where \"cte\".\"distance\" <= $6","query_pos":"91","application_name":"postgres.js","backend_type":"client backend","query_id":"0"}}
{"level":"info","ts":"2025-05-06T21:35:54.110498811Z","logger":"postgres","msg":"record","logging_pod":"immich-pg-2","record":{"log_time":"2025-05-06 21:35:54.106 UTC","process_id":"27","session_id":"6819c0af.1b","session_line_num":"60","session_start_time":"2025-05-06 07:56:31 UTC","transaction_id":"0","error_severity":"LOG","sql_state_code":"00000","message":"checkpoint starting: time","backend_type":"checkpointer","query_id":"0"}}
bo0tzz
bo0tzz2mo ago
I never remember the details of this stuff but I think you're probably missing ALTER SYSTEM SET search_path TO "$user", public, vectors;
Jonsch
JonschOP2mo ago
Yep that fixed it thanks

Did you find this page helpful?