QuivrHQ / quivr

Open-source RAG Framework for building GenAI Second Brains 🧠 Build productivity assistant (RAG) ⚡️🤖 Chat with your docs (PDF, CSV, ...) & apps using Langchain, GPT 3.5 / 4 turbo, Private, Anthropic, VertexAI, Ollama, LLMs, Groq that you can share with users ! Efficient retrieval augmented generation framework
https://quivr.com
Other
35.98k stars 3.49k forks source link

supabase start - unexpected EOF - At statement 0: create extension if not exists "vector" with schema "public" #2001

Open No-Work-Team opened 8 months ago

No-Work-Team commented 8 months ago

What happened?

After I submitted the "supabase start" command I get the following messages: /Quivr$ supabase start Skipping migration local_20240107152745_ollama.sql... (file name must match pattern "_name.sql") Applying migration 20240103173626_init.sql... unexpected EOF At statement 0: create extension if not exists "vector" with schema "public"

Relevant log output

No response

Twitter / LinkedIn details

No response

dosubot[bot] commented 8 months ago

🤖

Hey @No-Work-Team! 👋

I'm Dosu, a friendly bot who's here to lend a helping hand with bugs, answer your questions, and guide you on contributing. While we wait for a human maintainer, I'm all yours. Let's navigate the tech labyrinth together! 🚀

The "unexpected EOF" error you're encountering typically indicates a syntax error in your SQL script. The error is happening at the statement:

create extension if not exists "vector" with schema "public" ;

This suggests that PostgreSQL is unable to find an extension named "vector". PostgreSQL extensions are additional packages that provide extra functionality. Some common extensions include "pgcrypto", "uuid-ossp", "hstore", and others.

If "vector" is a custom extension that you or your team has developed, ensure it's correctly installed in your PostgreSQL database. If it's not a custom extension, you might need to double-check the name, as there isn't a standard PostgreSQL extension named "vector".

If you intended to use "vector" as a data type, please note that PostgreSQL doesn't have a "vector" data type. Depending on your needs, you might want to use an array or another suitable data type.

Regarding the purpose of the "vector" extension in the Quivr codebase, it's used for log management and data routing as part of the Vector project, an open-source utility for building observability pipelines. The vector.yml file is a configuration file for Vector, defining sources, transforms, and sinks for logs and other data.

If you continue to experience issues, please provide more details about your setup and the steps you're taking so I can assist you further.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

phoenix19792013 commented 8 months ago

i have the same issue

root@wass-Standard-PC-i440FX-PIIX-1996:~/Quivr# supabase start Skipping migration local_20240107152745_ollama.sql... (file name must match pattern "_name.sql") Applying migration 20240103173626_init.sql... unexpected EOF
At statement 0: create extension if not exists "vector" with schema "public" Try rerunning the command with --debug to troubleshoot the error.

ghost commented 7 months ago

I have the same issue! when I try to manually run 20240103173626_init.sql, whole supabase terminate

Is there a specific package I need to install?

dastaj commented 7 months ago

the same - any solutions?

dblinick commented 6 months ago

I will add to this thread - Did anyone manage to get it resolved?

Techno-Trek commented 5 months ago

Same problem.

Applying migration 20240103173626_init.sql... unexpected EOF
At statement 0: create extension if not exists "vector" with schema "public"

bioshazard commented 4 months ago

I get this on a fresh clone. Logs report an illegal instruction:

$ docker logs supabase_db_secondbrain -f
...
 2024-05-11 10:05:17.049 UTC [10] LOG:  server process (PID 983) was terminated by signal 4: Illegal instruction
 2024-05-11 10:05:17.049 UTC [10] DETAIL:  Failed process was running: 
        -- source: dashboard
        -- user: self host
        -- date: 2024-05-11T10:05:16.745Z

        create extension vector
        with
          schema extensions;

 2024-05-11 10:05:17.049 UTC [10] LOG:  terminating any other active server processes
 2024-05-11 10:05:17.055 UTC [10] LOG:  all server processes terminated; reinitializing
 2024-05-11 10:05:17.124 UTC [984] LOG:  database system was interrupted; last known up at 2024-05-11 10:01:26 UTC
 ...

And that is the documented way to enable pgvector per the Supabase docs: https://supabase.com/docs/guides/database/extensions/pgvector?queryGroups=database-method&database-method=sql

I even tested this on a fresh folder after supabase db init. I suspect this is not a quivr issue.

bioshazard commented 4 months ago

Ok... so my suspicion now is that "Illegal instruction" refers to the CPU instruction set being incompatible with PG Vector. I was running this on an older machine with a CPU that does not have AVX instruction set. That has given me trouble in the past with embedding stuff so I think everyone in this thread is running it on a CPU without AVX. Going to try to run this on my newer machine to verify. Even old versions of supabase have this error on that machine. This can never be fixed unless you can find a way to run a version of pgvector that does not require AVX support. Just a theory though, but makes perfect sense if it is the case.

You can check if you have avx and avx2 on linux with:

bios@old-machine$ cat /proc/cpuinfo  | grep -oe ...avx... | sort | uniq
bios@old-machine$ 
bioshazard commented 4 months ago

Yep. Confirmed. It works perfectly fine on my newer machine with AVX support. That's gotta be it. Hope this helps.

bios@new-machine$ cat /proc/cpuinfo  | grep -oe ...avx... | sort | uniq
i1 avx2 s
ve avx f1
bios@new-machine$
Niskeletor commented 4 months ago

Hello there! as @bioshazard said , I encountered the same issue while emulating a VM with Proxmox. My CPU was set to x86-64-v2-AES, and I received the exact same "Illegal instruction" error.

In my case, I resolved the issue by changing the CPU emulation to host. Now everything works correctly.

My processor is: 12 x Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz.

I hope this can help

FrancescoMasaia commented 3 months ago

Same problem with Proxmox, solved using the right cpu vendor instead of the generic one.

piyush-saurabh commented 2 months ago

Same issue with Ubuntu VM running on Proxmox. Changed the CPU to 'host' and it worked!

super25k commented 1 month ago

Same issue with Ubuntu VM running on Proxmox. Changed the CPU to 'host' and it worked!

This worked for me too.