Code Monkey home page Code Monkey logo

Comments (4)

VoVAllen avatar VoVAllen commented on June 6, 2024

Sorry for the problem. This is likely due to the problem of NULL vector in the index which we fixed in 0.2.1. Another way to reset pgvecto.rs is to manually delete all the file under pgdata/pg_vectors. This will remove all the indexes there. Your data is in the postgres storage and won't be affected. Only indexes are deleted by this way. Then everything should work. You only need to do the REINDEX on all the vector columns

from pgvecto.rs.

reefland avatar reefland commented on June 6, 2024

I saw v0.2.1 was available this morning: ghcr.io/tensorchord/cloudnative-pgvecto.rs:16.2-v0.2.1. Upgraded to that:

postgres=# \c immich
You are now connected to database "immich" as user "postgres".

immich=# SELECT pgvectors_upgrade();
WARNING:  pgvecto.rs is upgraded. Restart PostgreSQL to take effects.
pgvectors_upgrade
-------------------

(1 row)
$ kubectl cnpg restart postgres16 -n cloudnative-pg
postgres16 restarted

I restarted it 2 more times. This is still postgres:

UTC","user_name":"app","database_name":"immich","process_id":"5399","connection_from":"10.42.4.226:39502","session_id":"65e71836.1517","session_line_num":"1","command_tag":"SELECT","session_start_time":"2024-03-05 13:03:50 UTC","virtual_transaction_id":"9/28","transaction_id":"0","error_severity":"ERROR","sql_state_code":"XX000","message":"called `Result::unwrap()` on an `Err` value: NoSuchType(\"vectors.vector_index_stat\")","query":"\n SELECT idx_status\n FROM pg_vector_index_stat\n WHERE indexname = $1","backend_type":"client backend","query_id":"0"}}

Immich, still crash looping on this:

[Nest] 7 - 03/05/2024, 1:07:15 PM WARN [DatabaseService] Could not run vector reindexing checks. If the extension was updated, please restart the Postgres instance.
/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219
throw new QueryFailedError_1.QueryFailedError(query, parameters, err);
^
QueryFailedError: called `Result::unwrap()` on an `Err` value: NoSuchType("vectors.vector_index_stat")
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 DataSource.query (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:350:20)
at async DatabaseRepository.shouldReindex (/usr/src/app/dist/infra/repositories/database.repository.js:127:25)
at async /usr/src/app/dist/domain/database/database.service.js:41:21
at async /usr/src/app/dist/infra/repositories/database.repository.js:185:23 {
query: '\n' +
' SELECT idx_status\n' +
' FROM pg_vector_index_stat\n' +
' WHERE indexname = $1',
parameters: [ 'clip_index' ],
driverError: error: called `Result::unwrap()` on an `Err` value: NoSuchType("vectors.vector_index_stat")
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 DataSource.query (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:350:20)
at async DatabaseRepository.shouldReindex (/usr/src/app/dist/infra/repositories/database.repository.js:127:25)
at async /usr/src/app/dist/domain/database/database.service.js:41:21
at async /usr/src/app/dist/infra/repositories/database.repository.js:185:23 {

Not sure what to try next.

from pgvecto.rs.

reefland avatar reefland commented on June 6, 2024

hmm... seems reindex database; did the trick.

immich=# \dx
List of installed extensions
Name      | Version |   Schema   |                                         Description
---------------+---------+------------+----------------------------------------------------------------------------------------------
cube          | 1.5     | public     | data type for multidimensional cubes
earthdistance | 1.1     | public     | calculate great-circle distances on the surface of the Earth
plpgsql       | 1.0     | pg_catalog | PL/pgSQL procedural language
uuid-ossp     | 1.1     | public     | generate universally unique identifiers (UUIDs)
vectors       | 0.2.1   | vectors    | vectors: Vector database plugin for Postgres, written in Rust, specifically designed for LLM
(5 rows)

immich=# reindex database;
REINDEX

Immich server restarted OK after that.

from pgvecto.rs.

cutecutecat avatar cutecutecat commented on June 6, 2024

Thanks for your response, we have seen it's not very clear for upgrading to v0.2.1.

We will add the step to REINDEX at our upgrading docs soon.

from pgvecto.rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.