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

unexpected EOF - At statement 0: -- Enable HTTP extension #1868

Open
ali-adm opened this issue Oct 21, 2024 · 1 comment
Open

unexpected EOF - At statement 0: -- Enable HTTP extension #1868

ali-adm opened this issue Oct 21, 2024 · 1 comment

Comments

@ali-adm
Copy link

ali-adm commented Oct 21, 2024

Hi there!
I would be grateful if someone could tell me how to solve the following problem:
When doing a clean install on a host with Ubuntu 22.04.4 LTS, an error occurs:

Seeding globals from roles.sql....
Applying migration 20240108234540_setup.sql...
Stopping containers...
unexpected EOF
At statement 0: -- Enable HTTP extension
create extension http with schema extensions
Try rerunning the command with --debug to troubleshoot the error.

When running in debug mode - the terminal hangs, but the containers start. The supabase administration works, but I haven't checked it much, but the chatbot-ui itself on port 3000 crashes immediately after pressing the registration button. Although the user in the database seems to appear. And does not work. I looked at the tables in the database - there are only a third of what is specified in the migration files.
In general, it is clear that migration is slowed down almost at the very beginning.
Help, kind people!
By the way, on the whole Internet - only habr has an open case on this problem. There are no answers.

PS. Some later.
So far, it's all coming down to:
postgres=> CREATE EXTENSION vector;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

When running Setting up initial schema and migration 20240108234540_setup.sql. - error occurs create extension http:
1 -- Enable HTTP extension
2 create extension http with schema extensions;

If handled created - CREATE EXTENSION http; - see above.
3
4 -- Enable vector extension
5 create extension vector with schema extensions;

@M0ns1gn0r
Copy link

Looks like I found the reason. The problem is caused by postgres failing to create the vector extension. This seems to be happening on CPUs without the AVX instruction set.

So you have to either change the CPU type or do the following (understanding that you lose some functionality):

  1. in 20240108234540_setup.sql comment out create extension vector with schema extensions;
  2. in in 20240108234540_setup.sql comment out
     /*
     local_embedding vector(384), -- 384 works for local w/ Xenova/all-MiniLM-L6-v2
     openai_embedding vector(1536), -- 1536 for OpenAI
    */

    ...

    /*
    CREATE INDEX file_items_embedding_idx ON file_items
      USING hnsw (openai_embedding vector_cosine_ops);
    
    CREATE INDEX file_items_local_embedding_idx ON file_items
      USING hnsw (local_embedding vector_cosine_ops);
    */

    ...

   -- FUNCTIONS --
   /*
   ...the entire functions code...
   */
  1. in app\api\retrieval\retrieve\route.ts comment out the code that calls await supabaseAdmin.rpc("match_file_items_openai" and await supabaseAdmin.rpc("match_file_items_local"

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