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

[Bug] Upgrade failed: Failed to run migrations #602

Open
ThanatosDi opened this issue Jun 4, 2024 · 2 comments
Open

[Bug] Upgrade failed: Failed to run migrations #602

ThanatosDi opened this issue Jun 4, 2024 · 2 comments

Comments

@ThanatosDi
Copy link
Contributor

Describe the bug
When I upgrade Appflowy-Cloud from 0.4.x to 0.5.3
I already pull new docker image and git pull repository.
run docker compose up -d to recreate container.

appflowy_cloud log

Error: Failed to initialize application state: Failed to run migrations: while executing migrations: error returned from database: extension "vector" is not available

postgres log

2024-06-04 09:06:22.439 UTC [42] ERROR:  extension "vector" is not available
2024-06-04 09:06:22.439 UTC [42] DETAIL:  Could not open extension control file "/usr/share/postgresql/16/extension/vector.control": No such file or directory.
2024-06-04 09:06:22.439 UTC [42] HINT:  The extension must first be installed on the system where PostgreSQL is running.
2024-06-04 09:06:22.439 UTC [42] STATEMENT:  -- Add migration script here
CREATE EXTENSION IF NOT EXISTS vector;

-- create table to store collab embeddings
CREATE TABLE IF NOT EXISTS af_collab_embeddings
(
    fragment_id TEXT NOT NULL PRIMARY KEY,
    oid TEXT NOT NULL,
    partition_key INTEGER NOT NULL,
    content_type INTEGER NOT NULL,
    indexed_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT (NOW()),
    content TEXT,
    embedding VECTOR(1536),
    FOREIGN KEY (oid, partition_key) REFERENCES af_collab (oid, partition_key) ON DELETE CASCADE
);

CREATE INDEX IF NOT EXISTS af_collab_embeddings_similarity_idx ON af_collab_embeddings USING hnsw (embedding vector_cosine_ops);
2024-06-04 09:06:22.439 UTC [42] LOG:  could not receive data from client: Connection reset by peer

It possable miss the "pgvector" extension, but I don't have any idea how to install the extension for postgres.

Screenshots
image

image

Server :

  • OS: DSM(Synology NAS)
  • Version: 7.2
  • Docker version: Docker version 20.10.23, build 876964a
@ThanatosDi
Copy link
Contributor Author

oh, It my bad
I forgot build the postgres image.
It possable that build a postgres image for NAS mechine, that NAS can pull the image to start postgres without build.

@speed2exe
Copy link
Collaborator

thanks for reporting the issue, i saw this and might be helpful to you.
https://hub.docker.com/r/tensorchord/pgvecto-rs

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

2 participants