Closed SuberSeb closed 2 months ago
After running the queries, did you restart the database?
After running the queries, did you restart the database?
yy and the entire stack multiple times. I'm not sure what I'm doing wrong
This is the whole script that I tried to apply last time:
SET search_path TO "$user", public, vectors; DROP INDEX face_index; ALTER TABLE asset_faces ALTER COLUMN embedding SET DATA TYPE real[];
DROP INDEX clip_index; ALTER TABLE smart_search ALTER COLUMN embedding SET DATA TYPE real[];
DROP EXTENSION vectors;
CREATE EXTENSION vectors
ALTER TABLE asset_faces ALTER COLUMN embedding SET DATA TYPE vector(512);
Can you capture the whole logs when the server starting up?
Can you capture the whole logs when the server starting up?
Here it is https://pastebin.com/K9z2fLHg
Following command is executed successfully under postgres
user but not under immich-user
(I have a separate user for database access):
CREATE TABLE face_search ("faceId" uuid PRIMARY KEY REFERENCES asset_faces(id) ON DELETE CASCADE, embedding vector(512) NOT NULL);
Under immich-user
I got an error with vector (from the above).
What I'm doing wrong? Maybe permissions issue?
I changed user from the immich-user
to the postgres
just for testing reasons. And now immich is working ok. I'm not sure where the issue is but it's looks like permissions.
Anyway it's a bad practice to run immich connection to the db via postgres
user.
@alextran1502 maybe u have some ideas?
Changed back to the immich-user
and it's still working. Seems like a particular migration permissions issue? I'm not sure.
I've been getting the same problem although in my .env DB_USERNAME is already postgres. Haven't had much chance to test anything out yet
Have the same issue, will try to switch to postgres user.
This appears to be very similar to what we have in this other thread: https://github.com/imagegenius/docker-immich/issues/395 Running a few of the commands there helped fix mine.
I restored a backup from before the upgrade and then upgraded again and it's worked this time.
First let me say I like Immich and thank you for improving it! I don't like upgrading immich because mobile app refuses to work only to spend hour debugging ML features that I don't use so server can start.
Since my experience with building CloudNative PG image with vectors extensions and debugging several issues with that extensions from broken upgrades and access issues. I don't consider vectors extension mature product. My DB was untouched running Immich 1.101.0 cleanly installed vectors 0.2.1 on pg 16.2. But todays migration running as immich user did not work because of access rights to internals of vectors extension 😖
If you are still set on changing ML design please make all ML tables droppable and if they are missing on server start just recreate them. And/or anything using vectors.vector type. The extension cleanly installed 0.2.1 did not work with this migration under psql immich user.
Please use full column names when moving data between tables with same column names and dropping them after. Ommiting them leads to different and more confusing errors
https://github.com/immich-app/immich/blob/main/server/src/migrations/1718486162779-AddFaceSearchRelation.ts#L36-L42
SELECT id, embedding
refers to face_search.embedding when run second time
await queryRunner.query(`
INSERT INTO face_search("faceId", embedding)
SELECT id, embedding
FROM asset_faces faces`);
}
await queryRunner.query(`ALTER TABLE asset_faces DROP COLUMN IF EXISTS embedding`);
@werwolfby Running grant helped me despite the fact I had clean install of vectors 0.2.1 (because deb does not include last line of finalize.sql) https://github.com/tensorchord/pgvecto.rs/blob/152f94aceaf9480dd8012e9901721ecd140d7f10/src/sql/finalize.sql#L1011
psql immich # as postgres
immich=> GRANT USAGE ON SCHEMA vectors TO immich;
immich=> GRANT SELECT ON TABLE pg_vector_index_stat TO PUBLIC;
The bug
After updating 1.106.4 => 1.107.2 immich-server container can't start anymore.
I'm running pgvectro postgres image from the official docker-compose, no any changes to the db was made recently. I've tried to update to 0.2.1 but no luck. Vectors extension is installed and updated.
Solutions from this thread didn't help https://github.com/immich-app/immich/issues/10767
The OS that Immich Server is running on
Unraid 6.12.10
Version of Immich Server
v1.107.2
Version of Immich Mobile App
v1.107.2
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Relevant log output
Additional information
Tried
but not working still