weaviate / Verba

Retrieval Augmented Generation (RAG) chatbot powered by Weaviate
BSD 3-Clause "New" or "Revised" License
4.86k stars 505 forks source link

query failed #196

Open huzaifa0505 opened 1 month ago

huzaifa0505 commented 1 month ago

i have completed with all the work, connected the verba with OLLAMA embedder and uploaded the documents on verba 1 but when i am asking the querry from that docs it is facing this issue and not giving the answer of query given i have pasted the error below, can anyone help on this?

[[-0.5941087 -0.10167141 -0.6369917 ... -0.5234859 -0.14651886   0.56666654]] ⚠ Query failed: 'data' INFO:   127.0.0.1:52288 - "POST /api/query HTTP/1.1" 200 OK 2

thomashacker commented 1 month ago

Interesting, thanks for the issue! We'll have a look

JochenKanta commented 1 month ago

same here: Query failed: 'NoneType' object is not iterable

OS Ubuntu 24.04

Verba installed via pip add. OLLAMA llama3:70b Python 3.12.3

also the Overview is hanging and not showing any details

image

houssam7737 commented 3 weeks ago

Same here as well. Exact same issue. Confirmed Ollama server is working correctly and can interact with the model via the terminal. I get that error on Verba both with Ollama AND with my openAI key ... no logs or error can be seen from the verba server beyond that one

ArmanBM commented 2 weeks ago

Same Issue here with win11, docker My logs:

(myenv) E:...\Verba>docker compose up time="2024-06-18T15:20:43+03:30" level=warning msg="The \"COHERE_API_KEY\" variable is not set. Defaulting to a blank string." time="2024-06-18T15:20:43+03:30" level=warning msg="The \"OLLAMA_MODEL\" variable is not set. Defaulting to a blank string." time="2024-06-18T15:20:43+03:30" level=warning msg="The \"OLLAMA_EMBED_MODEL\" variable is not set. Defaulting to a blank string." time="2024-06-18T15:20:43+03:30" level=warning msg="The \"UNSTRUCTURED_API_KEY\" variable is not set. Defaulting to a blank string." time="2024-06-18T15:20:43+03:30" level=warning msg="The \"UNSTRUCTURED_API_URL\" variable is not set. Defaulting to a blank string." time="2024-06-18T15:20:43+03:30" level=warning msg="The \"GITHUB_TOKEN\" variable is not set. Defaulting to a blank string." time="2024-06-18T15:20:43+03:30" level=warning msg="The \"COHERE_API_KEY\" variable is not set. Defaulting to a blank string." [+] Running 3/3 ✔ Network verba_default Created 0.0s ✔ Container verba-weaviate-1 Created 0.1s ✔ Container verba-verba-1 Created 0.1s Attaching to verba-1, weaviate-1 weaviate-1 | {"action":"startup","default_vectorizer_module":"none","level":"info","msg":"the default vectorizer modules is set to \"none\", as a result all new schema classes without an explicit vectorizer setting, will use this vectorizer","time":"2024-06-18T11:50:43Z"} weaviate-1 | {"action":"startup","auto_schema_enabled":true,"level":"info","msg":"auto schema enabled setting is set to \"true\"","time":"2024-06-18T11:50:43Z"} weaviate-1 | {"level":"info","msg":"No resource limits set, weaviate will use all available memory and CPU. To limit resources, set LIMIT_RESOURCES=true","time":"2024-06-18T11:50:43Z"} weaviate-1 | {"level":"warning","msg":"Multiple vector spaces are present, GraphQL Explore and REST API list objects endpoint module include params has been disabled as a result.","time":"2024-06-18T11:50:43Z"} weaviate-1 | {"action":"grpc_startup","level":"info","msg":"grpc server listening at [::]:50051","time":"2024-06-18T11:50:43Z"} weaviate-1 | {"action":"restapi_management","level":"info","msg":"Serving weaviate at http://[::]:8080","time":"2024-06-18T11:50:43Z"} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_cache_text2vec_cohere_h8d6d8kdLnN0 in 2.015701ms","time":"2024-06-18T11:50:44Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:44Z","took":64600} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_cache_minilm_azcCKeziv3AZ in 44.680905ms","time":"2024-06-18T11:50:44Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:44Z","took":88900} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_chunk_text2vec_openai_d6tvOmo1UU7j in 45.285605ms","time":"2024-06-18T11:50:44Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:44Z","took":94600} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_chunk_minilm_o0bXDw2xfFvO in 45.779305ms","time":"2024-06-18T11:50:44Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:44Z","took":119400} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_suggestion_b9WiazF0jXQ1 in 88.792909ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":122100} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_document_text2vec_cohere_jGfFpdka86iH in 89.65201ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":74600} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_cache_text2vec_openai_sDDxZTWDVcLQ in 94.575411ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_chunk_text2vec_cohere_nKlxG7SKm2FD in 94.766511ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":84700} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":131900} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_document_minilm_jwMxtXxMrvU9 in 90.67361ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_document_text2vec_openai_HtZ6JjVPUVsm in 93.73201ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":105900} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":145300} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_chunk_ollama_459gPvD5FP6V in 95.952111ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_cache_ollama_gUuJyL8Nqnqu in 95.604711ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":92900} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":120100} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_document_ollama_lx0WljQD6OuN in 95.456611ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"level":"info","msg":"Completed loading shard verba_config_4IHgCecPRCU1 in 90.97811ms","time":"2024-06-18T11:50:45Z"} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":99700} weaviate-1 | {"action":"hnsw_vector_cache_prefill","count":3000,"index_id":"main","level":"info","limit":1000000000000,"msg":"prefilled vector cache","time":"2024-06-18T11:50:45Z","took":100800} weaviate-1 | {"action":"telemetry_push","level":"info","msg":"telemetry started","payload":"\u0026{MachineID:4c5d6804-58fd-400a-aa85-103e5b7b31c0 Type:INIT Version:1.24.2 Modules:generative-openai,qna-openai,text2vec-cohere,text2vec-openai NumObjects:0 OS:linux Arch:amd64}","time":"2024-06-18T11:50:45Z"} verba-1 | INFO: Will watch for changes in these directories: ['/Verba'] verba-1 | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) verba-1 | INFO: Started reloader process [1] using WatchFiles verba-1 | INFO: Started server process [8] verba-1 | INFO: Waiting for application startup. verba-1 | INFO: Application startup complete. verba-1 | ℹ Setting up client verba-1 | ℹ No Auth information provided verba-1 | ✔ Connected to Weaviate verba-1 | ℹ Setting up components verba-1 | ℹ Retrieve Config From Weaviate verba-1 | ✔ Config Saved in Weaviate verba-1 | ℹ Setting READER to BasicReader verba-1 | ℹ Setting CHUNKER to TokenChunker verba-1 | ℹ Setting EMBEDDER to OllamaEmbedder verba-1 | ℹ Setting RETRIEVER to WindowRetriever verba-1 | ℹ Setting GENERATOR to GPT3 verba-1 | INFO: 127.0.0.1:47102 - "HEAD / HTTP/1.1" 200 OK verba-1 | INFO: 127.0.0.1:52984 - "HEAD / HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:52988 - "GET / HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:52988 - "GET /static/media/2b3f1035ed87a788-s.p.woff2 HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53018 - "GET /static/media/4049f3f580e14086-s.p.woff2 HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53004 - "GET /static/media/3d9ea938b6afa941-s.p.woff2 HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53028 - "GET /static/css/172a34703121a5c4.css HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "GET /static/css/7af5f0c0467cb98b.css HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53052 - "GET /static/media/c9a5bc6a7c948fb0-s.p.woff2 HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53028 - "GET /static/chunks/webpack-f7ec7a24106fdb21.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "GET /static/chunks/fd9d1056-13318e87e7edaf08.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53018 - "GET /static/chunks/main-app-6d8fe3bc29305481.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53004 - "GET /static/chunks/bc9c3264-d07564fa5e9c78e4.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53052 - "GET /static/chunks/23-5e3f67a9ac794630.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:52988 - "GET /static/chunks/737dfa3e-71fd4aa07f7d84a6.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53028 - "GET /static/chunks/ec3863c0-51ee858d5ca1a7f6.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53052 - "GET /static/chunks/12038df7-6e0eda258325d644.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "GET /static/chunks/39aecf79-4a889f14de9b85cb.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53018 - "GET /static/chunks/9081a741-61a1020146c5d975.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53028 - "GET /static/chunks/93854f56-29cce777bbb44957.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:52988 - "GET /static/chunks/3627521c-57ae5a9df6c7e5b9.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53052 - "GET /static/chunks/558-ac85fa7667d15ac6.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "GET /static/chunks/app/page-16df460a1ae52a69.js HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53052 - "GET /api/health HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "GET /icon.ico HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "GET /api/health HTTP/1.1" 200 OK verba-1 | ℹ Config Retrieved verba-1 | INFO: 172.23.0.1:53044 - "GET /api/config HTTP/1.1" 200 OK verba-1 | INFO: ('172.23.0.1', 53062) - "WebSocket /ws/generate_stream" [accepted] verba-1 | INFO: connection open verba-1 | ✔ Config Saved in Weaviate verba-1 | ℹ Setting READER to BasicReader verba-1 | ℹ Setting CHUNKER to TokenChunker verba-1 | ℹ Setting EMBEDDER to OllamaEmbedder verba-1 | ℹ Setting RETRIEVER to WindowRetriever verba-1 | ℹ Setting GENERATOR to GPT3 verba-1 | INFO: 172.23.0.1:53044 - "POST /api/set_config HTTP/1.1" 200 OK verba-1 | INFO: 127.0.0.1:53074 - "HEAD / HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "POST /api/suggestions HTTP/1.1" 200 OK verba-1 | INFO: 172.23.0.1:53044 - "POST /api/suggestions HTTP/1.1" 200 OK verba-1 | ✔ Received query: hi verba-1 | ⚠ Query failed: 'NoneType' object is not iterable verba-1 | INFO: 172.23.0.1:53044 - "POST /api/query HTTP/1.1" 200 OK verba-1 | INFO: 127.0.0.1:47890 - "HEAD / HTTP/1.1" 200 OK verba-1 | INFO: 127.0.0.1:47902 - "HEAD / HTTP/1.1" 200 OK

fkhaller commented 1 week ago

It looks like error is coming from here : https://github.com/weaviate/Verba/blob/412331cbab2f88cc94c8ec531f3a8dca38572808/goldenverba/server/api.py#L286-L302

Seems like manager.retrieve_chunks([payload.query]) is returning None for chunks instead of a list, so it is not iterable on line 301.

fkhaller commented 1 week ago

My mistake it looks like this error is deeper then that. So it looks like this is happening here: https://github.com/weaviate/Verba/blob/412331cbab2f88cc94c8ec531f3a8dca38572808/goldenverba/components/retriever/WindowRetriever.py#L70 It looks like when Weavite query returns no chunks then query_results["data"]["Get"][chunk_class] is None. I added a check for None here and it correctly propagates back up and then fails up here and says no chunks were returned: https://github.com/weaviate/Verba/blob/412331cbab2f88cc94c8ec531f3a8dca38572808/goldenverba/server/api.py#L307-L315 So that will help make the error more clear that if you do not have any chunks then the system will not work, but does not fix the system.

I guess this leads to the question : Why are no chunks being returned?

fkhaller commented 1 week ago

I figured this out for myself at least. I looks like although I had Ollama install I had not pulled down llama3. I guess the issue here is that there is no error that states that the model you configured in the env variable actually exists.

scottious commented 1 week ago

I get the same error if my user prompt is too big. Reducing the size allows it to work.