#Issue with pgvecto.rs

1 messages · Page 1 of 1 (latest)

tidal sorrelBOT
#

:wave: Hey @calm sphinx,

Thanks for reaching out to us. Please follow the recommended actions below; this will help us be more effective in our support effort and leave more time for building Immich immich.

References

Checklist

  1. :blue_square: I have verified I'm on the latest release(note that mobile app releases may take some time).
  2. :blue_square: I have read applicable release notes.
  3. :blue_square: I have reviewed the FAQs for known issues.
  4. :blue_square: I have reviewed Github for known issues.
  5. :blue_square: I have tried accessing Immich via local ip (without a custom reverse proxy).
  6. :blue_square: I have uploaded the relevant logs, docker compose, and .env files using the buttons below or the /upload command.
  7. :blue_square: I have tried an incognito window, 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)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

acoustic oxide
#

You changed the CLIP model, so the asset_faces table shouldn't have anything to do with this

hazy portal
#

When you changed the model, there should have been a log saying something like “database expects 512 dimensions, but new model expects X dimensions” followed by something like “updated database dimension size”. Do you see those logs?

#

Yeah that’s the issue then. Try switching to another model (e.g. the default) to force the smart search table to be updated again, then change it back

#

No need to run a clip job before changing it back

#

The index query is this:

CREATE INDEX clip_index ON smart_search
          USING vectors (embedding cosine_ops) WITH (options = $$
          [indexing.hnsw]
          m = 16
          ef_construction = 300
          $$)
#

Yeah that won’t work because the column type needs to change to the new dimension size, so existing vectors with a different dimension size need to be removed first

feral flume
#

I seem to be having the same issue. However, when attempting to run the index query I get

ERROR: pgvecto.rs: pgvecto.rs: IPC connection is closed unexpected. ADVICE: The error is raisen by background worker errors. Please check the full Postgresql log to get more information.
#

Checking the logs of postgres I get

2024-01-04 20:49:26.596 UTC [1655862] immich@immich ERROR:  pgvecto.rs: pgvecto.rs: IPC connection is closed unexpected.
    ADVICE: The error is raisen by background worker errors. Please check the full Postgresql log to get more information.
2024-01-04 20:49:26.596 UTC [1655862] immich@immich STATEMENT:  CREATE INDEX clip_index ON smart_search
        USING vectors (embedding cosine_ops) WITH (options = $$
              [indexing.hnsw]
              m = 16
              ef_construction = 300
              $$)
#

I tried to manually run the query. Immich is running inside kubernetes using the helm chart.

My postgres 12 server is running on a seperate server for other instances. I have manually built, installed, and enabled the pgvecto.rs extension on that server.

acoustic oxide
#

You should use 14 or up

feral flume
#

can confirm that upgrading Postgres to 16 has resolved this issue. Thank you guys 👍

feral flume
#

Should I write an issue about it not saying that Postgres 12 isn’t supported? A warning check or a plain error regarding incompatible version may be handy for debugging Immich

acoustic oxide
#

We already have a version check for the pgvecto.rs extension, it wouldn't hurt to also add a postgres version check to that.