getzep / zep

Zep | The Memory Foundation For Your AI Stack
https://help.getzep.com/ce
Apache License 2.0
2.65k stars 378 forks source link

[BUG] Unable to upgrade to any version from 0.17.0 to 0.21.0 using google cloud PostgreSQL sql: ERROR: type "xid8" does not exist (SQLSTATE 427040) #310

Closed koldoon closed 8 months ago

koldoon commented 8 months ago

Describe the bug Error and crash the application during startup

To Reproduce Trying to upgrade from 0.15.2 to 0.21.0

Logs time="2024-02-02T10:13:08Z" level=warning msg=".env file not found or unable to load. This warning can be ignored if Zep is run using docker compose with env_file defined or you are passing ENV variables." time="2024-02-02T10:13:08Z" level=info msg="Starting Zep server version 0.17.3-88d7882 (2023-11-01T22:47:29+0000)" time="2024-02-02T10:13:08Z" level=info msg="Log level set to: info" time="2024-02-02T10:13:09Z" level=error msg="error updating pgvector extension: ERROR: must be owner of extension vector (SQLSTATE=42501). this may happen if running on a managed service without rights to update extensions." time="2024-02-02T10:13:09Z" level=info msg="vector extension version is >= 0.5.0. hnsw indexing available" time="2024-02-02T10:13:09Z" level=info msg="there are no new migrations to run (database is up to date)" time="2024-02-02T10:13:09Z" level=warning msg="summary embedding dimensions are 1536, expected 0.\n migrating summary embedding column width to 0. this may result in loss of existing embedding vectors" time="2024-02-02T10:13:09Z" level=info msg="creating hnsw index on message_embedding.embedding if it does not exist" time="2024-02-02T10:13:09Z" level=info msg="created hnsw index successfully on message_embedding.embedding if it did not exist" time="2024-02-02T10:13:09Z" level=info msg="creating hnsw index on summary_embedding.embedding if it does not exist" time="2024-02-02T10:13:09Z" level=info msg="created hnsw index successfully on summary_embedding.embedding if it did not exist" time="2024-02-02T10:13:09Z" level=info msg="Using memory store: postgres" time="2024-02-02T10:13:09Z" level=info msg="Initializing tasks" time="2024-02-02T10:13:09Z" level=info msg="Adding handler" handler_name=message_summarizer topic=message_summarizer time="2024-02-02T10:13:09Z" level=info msg="message_summarizer task added to task router" time="2024-02-02T10:13:09Z" level=info msg="Adding handler" handler_name=message_token_count topic=message_token_count time="2024-02-02T10:13:09Z" level=info msg="message_token_count task added to task router" time="2024-02-02T10:13:09Z" level=info msg="Adding handler" handler_name=document_embedder topic=document_embedder time="2024-02-02T10:13:09Z" level=info msg="document_embedder task added to task router" time="2024-02-02T10:13:09Z" level=info msg="running task router" time="2024-02-02T10:13:09Z" level=info msg="Running router handlers" count=3 time="2024-02-02T10:13:09Z" level=info msg="Initializing subscriber schema" query="[ \n\t\tCREATE TABLE IF NOT EXISTS \"watermill_message_summarizer\" (\n\t\t\t\"offset\" SERIAL,\n\t\t\t\"uuid\" VARCHAR(36) NOT NULL,\n\t\t\t\"created_at\" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\"payload\" JSON DEFAULT NULL,\n\t\t\t\"metadata\" JSON DEFAULT NULL,\n\t\t\t\"transaction_id\" xid8 NOT NULL,\n\t\t\tPRIMARY KEY (\"transaction_id\", \"offset\")\n\t\t);\n\t \n\t\tCREATE TABLE IF NOT EXISTS \"watermill_offsets_message_summarizer\" (\n\t\tconsumer_group VARCHAR(255) NOT NULL,\n\t\toffset_acked BIGINT,\n\t\tlast_processed_transaction_id xid8 NOT NULL,\n\t\tPRIMARY KEY(consumer_group)\n\t)]" subscriber_id=01HNMMXMA2JEYKDSWAMAGTSCEG time="2024-02-02T10:13:09Z" level=info msg="Starting purge delete processor. Purging every 1m0s" time="2024-02-02T10:13:09Z" level=info msg="Web interface enabled" time="2024-02-02T10:13:09Z" level=info msg="Listening on: 0.0.0.0:8000" time="2024-02-02T10:13:09Z" level=info msg="Web UI available at: 0.0.0.0:8000/admin" time="2024-02-02T10:13:09Z" level=fatal msg="failed to run task router cannot subscribe topic message_summarizer: cound not initialize schema: ERROR: type \"xid8\" does not exist (SQLSTATE 42704)"

dfEnvironment (please complete the following information):

danielchalef commented 8 months ago

Hi @koldoon, Zep requires Postgres 15.4 or later. The xid type was introduced in Postgres 13.