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

Locally setup with Ollama and getting LanceError(IO) when trying to chat with an indexed document. #638

Open
ykiran opened this issue Jan 21, 2025 · 13 comments
Labels
bug Something isn't working

Comments

@ykiran
Copy link

ykiran commented Jan 21, 2025

Description

I've set up the latest version (0.9.9) locally with Ollama as the backend.
Using deepseek-r1:14b for the LLM and nomic-embed-text for the embeddings.
After successfully indexing any document/url and trying to chat, I get the following error:

RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression, found: ),
C:\Users\runneradmin.cargo\registry\src\index.crates.io-6f17d22bba15001f\lance-datafusion-0.22.0\src\sql.rs:100:8

This is the partial log from the console after typing in a prompt

User-id: 1, can see public conversations: True
Session reasoning type None use mindmap (default) use citation (default) language (default)
Session LLM
Reasoning class <class 'ktem.reasoning.simple.FullQAPipeline'>
Reasoning state {'app': {'regen': False}, 'pipeline': {}}
Thinking ...
Retrievers [DocumentRetrievalPipeline(DS=<kotaemon.storages.docstores.lancedb.LanceDBDocumentStore object at 0x000001C3E711C640>, FSPath=WindowsPath('D:/kotaemon-app_0911/kotaemon-app/ktem_app_data/user_data/files/index_1'), Index=<class 'ktem.index.file.index.IndexTable'>, Source=<class 'ktem.index.file.index.Source'>, VS=<kotaemon.storages.vectorstores.chroma.ChromaVectorStore object at 0x000001C3E70ECDF0>, get_extra_table=False, llm_scorer=LLMTrulensScoring(concurrent=True, normalize=10, prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x000001C3E56642B0>, system_prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x000001C3E5667D60>, top_k=3, user_prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x000001C3E56663E0>), mmr=False, rerankers=[CohereReranking(cohere_api_key='<COHERE_API_KEY>', model_name='rerank-multilingual-v2.0')], retrieval_mode='hybrid', top_k=10, user_id=1), GraphRAGRetrieverPipeline(DS=<theflow.base.unset_ object at 0x000001C390CD9F60>, FSPath=<theflow.base.unset_ object at 0x000001C390CD9F60>, Index=<class 'ktem.index.file.index.IndexTable'>, Source=<theflow.base.unset_ object at 0x000001C390CD9F60>, VS=<theflow.base.unset_ object at 0x000001C390CD9F60>, file_ids=[], user_id=<theflow.base.unset_ object at 0x000001C390CD9F60>), LightRAGRetrieverPipeline(DS=<theflow.base.unset_ object at 0x000001C390CD9F60>, FSPath=<theflow.base.unset_ object at 0x000001C390CD9F60>, Index=<class 'ktem.index.file.index.IndexTable'>, Source=<theflow.base.unset_ object at 0x000001C390CD9F60>, VS=<theflow.base.unset_ object at 0x000001C390CD9F60>, file_ids=[], search_type='local', user_id=<theflow.base.unset_ object at 0x000001C390CD9F60>)]
searching in doc_ids ['ed18e31a-40b9-44d2-8ec8-2c57dbdceede']
retrieval_kwargs: dict_keys(['do_extend', 'scope', 'filters'])
Number of requested results 100 is greater than number of elements in index 61, updating n_results = 61
Got 12 from vectorstore
Got 0 from docstore
Cohere API key not found. Skipping rerankings.
Got raw 10 retrieved documents
Traceback (most recent call last):
File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\queueing.py", line 575, in process_events
response = await route_utils.call_process_api(
File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api
output = await app.get_blocks().process_api(
File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\blocks.py", line 1923, in process_api
result = await self.call_function(

Image

Reproduction steps

1. Start Kotaemon and go to the local url
2. Upload and index any document or URL
3. Wait for the indexing process to complete
4. After the process, go to the chat interface and select the document from the dropdown in "File Collection"
5. Type in a prompt
6. Observe the result

Screenshots

Logs

User-id: 1, can see public conversations: True
Session reasoning type None use mindmap (default) use citation (default) language (default)
Session LLM
Reasoning class <class 'ktem.reasoning.simple.FullQAPipeline'>
Reasoning state {'app': {'regen': False}, 'pipeline': {}}
Thinking ...
Retrievers [DocumentRetrievalPipeline(DS=<kotaemon.storages.docstores.lancedb.LanceDBDocumentStore object at 0x000001C3E711C640>, FSPath=WindowsPath('D:/kotaemon-app_0911/kotaemon-app/ktem_app_data/user_data/files/index_1'), Index=<class 'ktem.index.file.index.IndexTable'>, Source=<class 'ktem.index.file.index.Source'>, VS=<kotaemon.storages.vectorstores.chroma.ChromaVectorStore object at 0x000001C3E70ECDF0>, get_extra_table=False, llm_scorer=LLMTrulensScoring(concurrent=True, normalize=10, prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x000001C3E56642B0>, system_prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x000001C3E5667D60>, top_k=3, user_prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x000001C3E56663E0>), mmr=False, rerankers=[CohereReranking(cohere_api_key='<COHERE_API_KEY>', model_name='rerank-multilingual-v2.0')], retrieval_mode='hybrid', top_k=10, user_id=1), GraphRAGRetrieverPipeline(DS=<theflow.base.unset_ object at 0x000001C390CD9F60>, FSPath=<theflow.base.unset_ object at 0x000001C390CD9F60>, Index=<class 'ktem.index.file.index.IndexTable'>, Source=<theflow.base.unset_ object at 0x000001C390CD9F60>, VS=<theflow.base.unset_ object at 0x000001C390CD9F60>, file_ids=[], user_id=<theflow.base.unset_ object at 0x000001C390CD9F60>), LightRAGRetrieverPipeline(DS=<theflow.base.unset_ object at 0x000001C390CD9F60>, FSPath=<theflow.base.unset_ object at 0x000001C390CD9F60>, Index=<class 'ktem.index.file.index.IndexTable'>, Source=<theflow.base.unset_ object at 0x000001C390CD9F60>, VS=<theflow.base.unset_ object at 0x000001C390CD9F60>, file_ids=[], search_type='local', user_id=<theflow.base.unset_ object at 0x000001C390CD9F60>)]
searching in doc_ids ['ed18e31a-40b9-44d2-8ec8-2c57dbdceede']
retrieval_kwargs: dict_keys(['do_extend', 'scope', 'filters'])
Number of requested results 100 is greater than number of elements in index 61, updating n_results = 61
Got 12 from vectorstore
Got 0 from docstore
Cohere API key not found. Skipping rerankings.
Got raw 10 retrieved documents
Traceback (most recent call last):
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\queueing.py", line 575, in process_events
    response = await route_utils.call_process_api(
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api
    output = await app.get_blocks().process_api(
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\blocks.py", line 1923, in process_api
    result = await self.call_function(
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\blocks.py", line 1520, in call_function
    prediction = await utils.async_iteration(iterator)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\utils.py", line 663, in async_iteration
    return await iterator.__anext__()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\utils.py", line 656, in __anext__
    return await anyio.to_thread.run_sync(
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\anyio\_backends\_asyncio.py", line 2461, in run_sync_in_worker_thread
    return await future
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\anyio\_backends\_asyncio.py", line 962, in run
    result = context.run(func, *args)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\utils.py", line 639, in run_sync_iterator_async
    return next(iterator)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\gradio\utils.py", line 801, in gen_wrapper
    response = next(iterator)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\ktem\pages\chat\__init__.py", line 1048, in chat_fn
    for response in pipeline.stream(chat_input, conversation_id, chat_history):
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\ktem\reasoning\simple.py", line 287, in stream
    docs, infos = self.retrieve(message, history)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\ktem\reasoning\simple.py", line 130, in retrieve
    retriever_docs = retriever_node(text=query)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\base.py", line 1097, in __call__
    raise e from None
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\base.py", line 1088, in __call__
    output = self.fl.exec(func, args, kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\backends\base.py", line 151, in exec
    return run(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\middleware.py", line 144, in __call__
    raise e from None
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\middleware.py", line 141, in __call__
    _output = self.next_call(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\middleware.py", line 117, in __call__
    return self.next_call(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\base.py", line 1017, in _runx
    return self.run(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\ktem\index\file\pipelines.py", line 174, in run
    docs = self.vector_retrieval(text=text, top_k=self.top_k, **retrieval_kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\base.py", line 1261, in exec
    return child(*args, **kwargs, __fl_runstates__=__fl_runstates__)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\base.py", line 1097, in __call__
    raise e from None
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\base.py", line 1088, in __call__
    output = self.fl.exec(func, args, kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\backends\base.py", line 151, in exec
    return run(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\middleware.py", line 144, in __call__
    raise e from None
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\middleware.py", line 141, in __call__
    _output = self.next_call(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\middleware.py", line 117, in __call__
    return self.next_call(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\theflow\base.py", line 1017, in _runx
    return self.run(*args, **kwargs)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\kotaemon\indices\vectorindex.py", line 269, in run
    linked_thumbnail_docs = self.doc_store.get(list(thumbnail_doc_ids))
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\kotaemon\storages\docstores\lancedb.py", line 109, in get
    .to_list()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\query.py", line 327, in to_list
    return self.to_arrow().to_pylist()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\query.py", line 1017, in to_arrow
    return self.to_batches().read_all()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\query.py", line 1029, in to_batches
    return self._table._execute_query(query)
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\table.py", line 2138, in _execute_query
    return LOOP.run(self._table._execute_query(query, batch_size))
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\background_loop.py", line 25, in run
    return asyncio.run_coroutine_threadsafe(future, self.loop).result()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\concurrent\futures\_base.py", line 458, in result
    return self.__get_result()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\concurrent\futures\_base.py", line 403, in __get_result
    raise self._exception
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\table.py", line 2886, in _execute_query
    table = await async_query.to_arrow()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\query.py", line 1567, in to_arrow
    batch_iter = await self.to_batches()
  File "D:\kotaemon-app_0911\kotaemon-app\install_dir\env\lib\site-packages\lancedb\query.py", line 1557, in to_batches
    return AsyncRecordBatchReader(await self._inner.execute(max_batch_length))
RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression, found: ), C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\lance-datafusion-0.22.0\src\sql.rs:100:8

Browsers

Firefox

OS

Windows

Additional information

No response

@ykiran ykiran added the bug Something isn't working label Jan 21, 2025
@ykiran
Copy link
Author

ykiran commented Jan 21, 2025

I mistyped the version; it is 0.9.11

@taprosoft
Copy link
Collaborator

@ykiran seems an error occurred when you index this document. Please delete it and upload again on the Files tab to see the error. You can try another document as well.

@petervines
Copy link

I have set up a new local install of Kotaemon using a local ollama model. All tests work and I can chat with the local model. I have set cohere for embeddings. When I upload a file (the Kotaemon README.md) and try to chat with it I get the same error.

Following the suggestion above I have uploaded the file via the Files tab and it is processed with no errors. I still get the same error.

Console Output

Session reasoning type None use mindmap False use citation (default) language (default)
Session LLM
Reasoning class <class 'ktem.reasoning.simple.FullQAPipeline'>
Reasoning state {'app': {'regen': False}, 'pipeline': {}}
Thinking ...
Retrievers [DocumentRetrievalPipeline(DS=<kotaemon.storages.docstores.lancedb.LanceDBDocumentStore object at 0x72205d5250f0>, FSPath=PosixPath('/home/peter/dev/aiapps/kotaemon/ktem_app_data/user_data/files/index_1'), Index=<class 'ktem.index.file.index.IndexTable'>, Source=<class 'ktem.index.file.index.Source'>, VS=<kotaemon.storages.vectorstores.chroma.ChromaVectorStore object at 0x72205d525000>, get_extra_table=False, llm_scorer=LLMTrulensScoring(concurrent=True, normalize=10, prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x72205da7dfc0>, system_prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x72205da7e050>, top_k=3, user_prompt_template=<kotaemon.llms.prompts.template.PromptTemplate object at 0x72205da7e800>), mmr=False, rerankers=[CohereReranking(cohere_api_key='xRN0vbWl1LGQEXPRiwRrIlk63Ti59zHWS7UTt3Cu', model_name='rerank-multilingual-v2.0')], retrieval_mode='hybrid', top_k=10, user_id=1), GraphRAGRetrieverPipeline(DS=<theflow.base.unset_ object at 0x722145f50070>, FSPath=<theflow.base.unset_ object at 0x722145f50070>, Index=<class 'ktem.index.file.index.IndexTable'>, Source=<theflow.base.unset_ object at 0x722145f50070>, VS=<theflow.base.unset_ object at 0x722145f50070>, file_ids=[], user_id=<theflow.base.unset_ object at 0x722145f50070>), LightRAGRetrieverPipeline(DS=<theflow.base.unset_ object at 0x722145f50070>, FSPath=<theflow.base.unset_ object at 0x722145f50070>, Index=<class 'ktem.index.file.index.IndexTable'>, Source=<theflow.base.unset_ object at 0x722145f50070>, VS=<theflow.base.unset_ object at 0x722145f50070>, file_ids=[], search_type='local', user_id=<theflow.base.unset_ object at 0x722145f50070>)]
searching in doc_ids ['5566d11b-a29e-420e-91ae-9421b9a0f472']
retrieval_kwargs: dict_keys(['do_extend', 'scope', 'filters'])
Number of requested results 100 is greater than number of elements in index 7, updating n_results = 7
Got 7 from vectorstore
Got 7 from docstore
Got raw 10 retrieved documents
Traceback (most recent call last):
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/queueing.py", line 575, in process_events
response = await route_utils.call_process_api(
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/route_utils.py", line 276, in call_process_api
output = await app.get_blocks().process_api(
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/blocks.py", line 1923, in process_api
result = await self.call_function(
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/blocks.py", line 1520, in call_function
prediction = await utils.async_iteration(iterator)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/utils.py", line 663, in async_iteration
return await iterator.anext()
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/utils.py", line 656, in anext
return await anyio.to_thread.run_sync(
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
return await future
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
result = context.run(func, *args)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/utils.py", line 639, in run_sync_iterator_async
return next(iterator)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/gradio/utils.py", line 801, in gen_wrapper
response = next(iterator)
File "/home/peter/dev/aiapps/kotaemon/libs/ktem/ktem/pages/chat/init.py", line 1048, in chat_fn
for response in pipeline.stream(chat_input, conversation_id, chat_history):
File "/home/peter/dev/aiapps/kotaemon/libs/ktem/ktem/reasoning/simple.py", line 287, in stream
docs, infos = self.retrieve(message, history)
File "/home/peter/dev/aiapps/kotaemon/libs/ktem/ktem/reasoning/simple.py", line 130, in retrieve
retriever_docs = retriever_node(text=query)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/base.py", line 1097, in call
raise e from None
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/base.py", line 1088, in call
output = self.fl.exec(func, args, kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/backends/base.py", line 151, in exec
return run(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/middleware.py", line 144, in call
raise e from None
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/middleware.py", line 141, in call
_output = self.next_call(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/middleware.py", line 117, in call
return self.next_call(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/base.py", line 1017, in _runx
return self.run(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/libs/ktem/ktem/index/file/pipelines.py", line 174, in run
docs = self.vector_retrieval(text=text, top_k=self.top_k, **retrieval_kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/base.py", line 1261, in exec
return child(*args, **kwargs, fl_runstates=fl_runstates)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/base.py", line 1097, in call
raise e from None
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/base.py", line 1088, in call
output = self.fl.exec(func, args, kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/backends/base.py", line 151, in exec
return run(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/middleware.py", line 144, in call
raise e from None
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/middleware.py", line 141, in call
_output = self.next_call(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/middleware.py", line 117, in call
return self.next_call(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/theflow/base.py", line 1017, in _runx
return self.run(*args, **kwargs)
File "/home/peter/dev/aiapps/kotaemon/libs/kotaemon/kotaemon/indices/vectorindex.py", line 269, in run
linked_thumbnail_docs = self.doc_store.get(list(thumbnail_doc_ids))
File "/home/peter/dev/aiapps/kotaemon/libs/kotaemon/kotaemon/storages/docstores/lancedb.py", line 109, in get
.to_list()
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/query.py", line 327, in to_list
return self.to_arrow().to_pylist()
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/query.py", line 1017, in to_arrow
return self.to_batches().read_all()
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/query.py", line 1029, in to_batches
return self._table._execute_query(query)
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/table.py", line 2138, in _execute_query
return LOOP.run(self._table._execute_query(query, batch_size))
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/background_loop.py", line 25, in run
return asyncio.run_coroutine_threadsafe(future, self.loop).result()
File "/home/peter/.local/share/uv/python/cpython-3.10.16-linux-x86_64-gnu/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "/home/peter/.local/share/uv/python/cpython-3.10.16-linux-x86_64-gnu/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/table.py", line 2886, in _execute_query
table = await async_query.to_arrow()
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/query.py", line 1567, in to_arrow
batch_iter = await self.to_batches()
File "/home/peter/dev/aiapps/kotaemon/.venv/lib/python3.10/site-packages/lancedb/query.py", line 1557, in to_batches
return AsyncRecordBatchReader(await self._inner.execute(max_batch_length))
RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression, found: ), /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lance-datafusion-0.22.0/src/sql.rs:100:8

@taprosoft
Copy link
Collaborator

@petervines if possible please try Docker installation method as well. I suspect this might have to do with some file permission issue. I will investigate the local install script in more detail.

@petervines
Copy link

@petervines if possible please try Docker installation method as well. I suspect this might have to do with some file permission issue. I will investigate the local install script in more detail.

It works with the docker installation method.

@EthanRush
Copy link

EthanRush commented Jan 21, 2025

Also seeing this issue on my local setup with local models. Normal chats work fine, but attempting to pull from documents causes the same lance SQL parser error.

Windows 11

Conda Env
Python 3.10
kotaemon 0.9.11
LLM: llama3.3:70b
Embeddings: nomic-embed-text
No GraphRAG api key

Edit:
Temporary workaround for me was to switch the KH_DOCSTORE type value in flowsettings.py to SimpleFileDocument Store and reupload my files.

@taprosoft
Copy link
Collaborator

@petervines @EthanRush @ykiran

Can you confirm if local Ollama work with linux-based setup like this Colab example ?
I am trying to pinpoint if the problem is specific-OS or environment related.

@tsainio
Copy link

tsainio commented Jan 23, 2025

@petervines @EthanRush @ykiran

Can you confirm if local Ollama work with linux-based setup like this Colab example ? I am trying to pinpoint if the problem is specific-OS or environment related.

I am getting the same error with Ollama on a Linux machine after using the local install script (not Docker). The file(s) were uploaded to the File Collection. Chatting without any files selected in File Collection works fine.

RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression, found: ), /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lance-datafusion-0.22.0/src/sql.rs:100:8

@taprosoft
Copy link
Collaborator

In general, it is hard to pin-point the issue without reproducing it from my side. You can re-run the Colab setup to verify the package versions / ollama setup process to compare with your local machine. My test so far with Colab setup with Linux installation script is still working as expected.

@chourabieure
Copy link

chourabieure commented Jan 23, 2025

Hi !

I have the same issue with a simple setup, ollama locally
I think i have found where the code i breaking, seems to come from this file :
libs/kotaemon/kotaemon/indices/vectorindex.py
line 265 : linked_thumbnail_docs = self.doc_store.get(list(thumbnail_doc_ids))

i managed to fix the error with adding this guard :

if not thumbnail_doc_ids:
    return []

But it doen't seems to search in files anymore ..

the thumbnail_doc_ids seems to be empty while using .md files

I really need to make this RAG work, hope this can be solved ASAP

(PS : Im using MACOS)

@maruyamayasuaki
Copy link

I am trying to run Kotaemon locally using the following Docker command:

docker run \
-e GRADIO_SERVER_NAME=0.0.0.0 \
-e GRADIO_SERVER_PORT=7860 \
-v ./ktem_app_data:/app/ktem_app_data \
-p 7860:7860 -it --rm \
ghcr.io/cinnamon/kotaemon:main-ollama

After running this, I can successfully log into Kotaemon, and the test connection with Ollama works for both LLM and Embedding. I also switched the File Collection to use Ollama.

However, when trying to proceed, I encounter the following error:

RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression

Has anyone else experienced this issue, or does anyone know a possible solution?

Thanks in advance!

(PS : Im using MACOS)

@AndreiChirap
Copy link

I am trying to run Kotaemon locally using the following Docker command:

docker run \
-e GRADIO_SERVER_NAME=0.0.0.0 \
-e GRADIO_SERVER_PORT=7860 \
-v ./ktem_app_data:/app/ktem_app_data \
-p 7860:7860 -it --rm \
ghcr.io/cinnamon/kotaemon:main-ollama

After running this, I can successfully log into Kotaemon, and the test connection with Ollama works for both LLM and Embedding. I also switched the File Collection to use Ollama.

However, when trying to proceed, I encounter the following error:

RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression

Has anyone else experienced this issue, or does anyone know a possible solution?

Thanks in advance!

(PS : Im using MACOS)

I managed to get around this error by changing the flowsettings.py file like this:

 KH_DOCSTORE = {
     # "__type__": "kotaemon.storages.ElasticsearchDocumentStore",
-    # "__type__": "kotaemon.storages.SimpleFileDocumentStore",
-    "__type__": "kotaemon.storages.LanceDBDocumentStore",
+    "__type__": "kotaemon.storages.SimpleFileDocumentStore",
+    # "__type__": "kotaemon.storages.LanceDBDocumentStore",
     "path": str(KH_USER_DATA_DIR / "docstore"),
 }

@volunteerism
Copy link

Hi I have the same problem with each file.
I installed with docker, with local ollama embedding model.

Console output

25-02-23 22:30:07 Session reasoning type complex use mindmap True use citation highlight language zh
2025-02-23 22:30:07 Session LLM 百度 r1
2025-02-23 22:30:07 Reasoning class <class 'ktem.reasoning.simple.FullDecomposeQAPipeline'>
2025-02-23 22:30:08 Reasoning state {'app': {'regen': False}, 'pipeline': {}}
2025-02-23 22:30:08 Thinking ...
2025-02-23 22:30:08 Chosen rewrite pipeline DecomposeQuestionPipeline(
2025-02-23 22:30:08 (llm): ChatOpenAI(api_key=bce-v3/ALTAK-vj..., base_url=https://qianfan..., frequency_penalty=None, logit_bias=None, logprobs=None, max_retries=None, max_retries_=2, max_tokens=None, model=deepseek-r1, n=1, organization=None, presence_penalty=None, stop=None, temperature=None, timeout=None, tool_choice=None, tools=None, top_logprobs=None, top_p=None)
2025-02-23 22:30:08 )
2025-02-23 22:30:55 INFO:httpx:HTTP Request: POST https://qianfan.baidubce.com/v2/chat/completions "HTTP/1.1 200 OK"
2025-02-23 22:30:55 Rewrite result []
2025-02-23 22:30:55 searching in doc_ids ['21590fac-f239-4c54-bce1-1e2441c82e70']
2025-02-23 22:30:55 retrieval_kwargs: dict_keys(['do_extend', 'scope', 'filters'])
2025-02-23 22:30:58 INFO:httpx:HTTP Request: POST http://host.docker.internal:11434/v1/embeddings "HTTP/1.1 200 OK"
2025-02-23 22:30:59 Got 95 from vectorstore
2025-02-23 22:30:59 Got 0 from docstore
2025-02-23 22:31:58 Got raw 10 retrieved documents

2025-02-23 22:31:59 Traceback (most recent call last):
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 575, in process_events
2025-02-23 22:31:59 response = await route_utils.call_process_api(
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 276, in call_process_api
2025-02-23 22:31:59 output = await app.get_blocks().process_api(
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1923, in process_api
2025-02-23 22:31:59 result = await self.call_function(
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1520, in call_function
2025-02-23 22:31:59 prediction = await utils.async_iteration(iterator)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 663, in async_iteration
2025-02-23 22:31:59 return await iterator.anext()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 656, in anext
2025-02-23 22:31:59 return await anyio.to_thread.run_sync(
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
2025-02-23 22:31:59 return await get_async_backend().run_sync_in_worker_thread(
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
2025-02-23 22:31:59 return await future
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
2025-02-23 22:31:59 result = context.run(func, *args)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 639, in run_sync_iterator_async
2025-02-23 22:31:59 return next(iterator)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 801, in gen_wrapper
2025-02-23 22:31:59 response = next(iterator)
2025-02-23 22:31:59 File "/app/libs/ktem/ktem/pages/chat/init.py", line 1309, in chat_fn
2025-02-23 22:31:59 for response in pipeline.stream(chat_input, conversation_id, chat_history):
2025-02-23 22:31:59 File "/app/libs/ktem/ktem/reasoning/simple.py", line 537, in stream
2025-02-23 22:31:59 docs, infos = self.retrieve(message, history)
2025-02-23 22:31:59 File "/app/libs/ktem/ktem/reasoning/simple.py", line 130, in retrieve
2025-02-23 22:31:59 retriever_docs = retriever_node(text=query)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1097, in call
2025-02-23 22:31:59 raise e from None
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1088, in call
2025-02-23 22:31:59 output = self.fl.exec(func, args, kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/backends/base.py", line 151, in exec
2025-02-23 22:31:59 return run(*args, **kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 144, in call
2025-02-23 22:31:59 raise e from None
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 141, in call
2025-02-23 22:31:59 _output = self.next_call(*args, **kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 117, in call
2025-02-23 22:31:59 return self.next_call(*args, **kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1017, in _runx
2025-02-23 22:31:59 return self.run(*args, **kwargs)
2025-02-23 22:31:59 File "/app/libs/ktem/ktem/index/file/pipelines.py", line 174, in run
2025-02-23 22:31:59 docs = self.vector_retrieval(text=text, top_k=self.top_k, **retrieval_kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1261, in exec
2025-02-23 22:31:59 return child(*args, **kwargs, fl_runstates=fl_runstates)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1097, in call
2025-02-23 22:31:59 raise e from None
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1088, in call
2025-02-23 22:31:59 output = self.fl.exec(func, args, kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/backends/base.py", line 151, in exec
2025-02-23 22:31:59 return run(*args, **kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 144, in call
2025-02-23 22:31:59 raise e from None
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 141, in call
2025-02-23 22:31:59 _output = self.next_call(*args, **kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 117, in call
2025-02-23 22:31:59 return self.next_call(*args, **kwargs)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1017, in _runx
2025-02-23 22:31:59 return self.run(*args, **kwargs)
2025-02-23 22:31:59 File "/app/libs/kotaemon/kotaemon/indices/vectorindex.py", line 274, in run
2025-02-23 22:31:59 linked_thumbnail_docs = self.doc_store.get(list(thumbnail_doc_ids))
2025-02-23 22:31:59 File "/app/libs/kotaemon/kotaemon/storages/docstores/lancedb.py", line 109, in get
2025-02-23 22:31:59 .to_list()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 327, in to_list
2025-02-23 22:31:59 return self.to_arrow().to_pylist()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1017, in to_arrow
2025-02-23 22:31:59 return self.to_batches().read_all()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1029, in to_batches
2025-02-23 22:31:59 return self._table._execute_query(query)
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/table.py", line 2138, in _execute_query
2025-02-23 22:31:59 return LOOP.run(self._table._execute_query(query, batch_size))
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/background_loop.py", line 25, in run
2025-02-23 22:31:59 return asyncio.run_coroutine_threadsafe(future, self.loop).result()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result
2025-02-23 22:31:59 return self.__get_result()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
2025-02-23 22:31:59 raise self._exception
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/table.py", line 2886, in _execute_query
2025-02-23 22:31:59 table = await async_query.to_arrow()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1567, in to_arrow
2025-02-23 22:31:59 batch_iter = await self.to_batches()
2025-02-23 22:31:59 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1557, in to_batches
2025-02-23 22:31:59 return AsyncRecordBatchReader(await self.inner.execute(max_batch_length))
2025-02-23 22:31:59 RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression, found: ), /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lance-datafusion-0.22.0/src/sql.rs:100:8
2025-02-23 22:38:15 use_quick_index_mode False
2025-02-23 22:38:15 reader_mode docling
2025-02-23 22:38:15 Chunk size: None, chunk overlap: None
2025-02-23 22:38:15 Using reader TxtReader()
2025-02-23 22:38:15 Got 0 page thumbnails
2025-02-23 22:38:15 Adding documents to doc store
2025-02-23 22:38:17 Getting embeddings for 6 nodes
2025-02-23 22:38:20 INFO:httpx:HTTP Request: POST http://host.docker.internal:11434/v1/embeddings "HTTP/1.1 200 OK"
2025-02-23 22:38:20 Adding embeddings to vector store
2025-02-23 22:38:20 indexing step took 5.317862510681152
2025-02-23 22:40:05 Session reasoning type complex use mindmap True use citation highlight language zh
2025-02-23 22:40:05 Session LLM 百度 r1
2025-02-23 22:40:05 Reasoning class <class 'ktem.reasoning.simple.FullDecomposeQAPipeline'>
2025-02-23 22:40:05 Reasoning state {'app': {'regen': False}, 'pipeline': {}}
2025-02-23 22:40:05 Thinking ...
2025-02-23 22:40:05 Chosen rewrite pipeline DecomposeQuestionPipeline(
2025-02-23 22:40:05 (llm): ChatOpenAI(api_key=bce-v3/ALTAK-vj..., base_url=https://qianfan..., frequency_penalty=None, logit_bias=None, logprobs=None, max_retries=None, max_retries
=2, max_tokens=None, model=deepseek-r1, n=1, organization=None, presence_penalty=None, stop=None, temperature=None, timeout=None, tool_choice=None, tools=None, top_logprobs=None, top_p=None)
2025-02-23 22:40:05 )
2025-02-23 22:40:52 INFO:httpx:HTTP Request: POST https://qianfan.baidubce.com/v2/chat/completions "HTTP/1.1 200 OK"
2025-02-23 22:40:53 Rewrite result []
2025-02-23 22:40:53 searching in doc_ids ['84d03d97-d7e3-44c5-b4e9-5cb76f43bfb7']
2025-02-23 22:40:53 retrieval_kwargs: dict_keys(['do_extend', 'scope', 'filters'])
2025-02-23 22:40:53 INFO:httpx:HTTP Request: POST http://host.docker.internal:11434/v1/embeddings "HTTP/1.1 200 OK"
2025-02-23 22:40:54 Got 6 from vectorstore
2025-02-23 22:40:54 Got 0 from docstore
2025-02-23 22:41:01 Got raw 6 retrieved documents
2025-02-23 22:41:01 Traceback (most recent call last):
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 575, in process_events
2025-02-23 22:41:01 response = await route_utils.call_process_api(
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 276, in call_process_api
2025-02-23 22:41:01 output = await app.get_blocks().process_api(
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1923, in process_api
2025-02-23 22:41:01 result = await self.call_function(
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1520, in call_function
2025-02-23 22:41:01 prediction = await utils.async_iteration(iterator)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 663, in async_iteration
2025-02-23 22:41:01 return await iterator.anext()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 656, in anext
2025-02-23 22:41:01 return await anyio.to_thread.run_sync(
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
2025-02-23 22:41:01 return await get_async_backend().run_sync_in_worker_thread(
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
2025-02-23 22:41:01 return await future
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
2025-02-23 22:41:01 result = context.run(func, *args)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 639, in run_sync_iterator_async
2025-02-23 22:41:01 return next(iterator)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 801, in gen_wrapper
2025-02-23 22:41:01 response = next(iterator)
2025-02-23 22:41:01 File "/app/libs/ktem/ktem/pages/chat/init.py", line 1309, in chat_fn
2025-02-23 22:41:01 for response in pipeline.stream(chat_input, conversation_id, chat_history):
2025-02-23 22:41:01 File "/app/libs/ktem/ktem/reasoning/simple.py", line 537, in stream
2025-02-23 22:41:01 docs, infos = self.retrieve(message, history)
2025-02-23 22:41:01 File "/app/libs/ktem/ktem/reasoning/simple.py", line 130, in retrieve
2025-02-23 22:41:01 retriever_docs = retriever_node(text=query)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1097, in call
2025-02-23 22:41:01 raise e from None
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1088, in call
2025-02-23 22:41:01 output = self.fl.exec(func, args, kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/backends/base.py", line 151, in exec
2025-02-23 22:41:01 return run(*args, **kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 144, in call
2025-02-23 22:41:01 raise e from None
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 141, in call
2025-02-23 22:41:01 _output = self.next_call(*args, **kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 117, in call
2025-02-23 22:41:01 return self.next_call(*args, **kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1017, in _runx
2025-02-23 22:41:01 return self.run(*args, **kwargs)
2025-02-23 22:41:01 File "/app/libs/ktem/ktem/index/file/pipelines.py", line 174, in run
2025-02-23 22:41:01 docs = self.vector_retrieval(text=text, top_k=self.top_k, **retrieval_kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1261, in exec
2025-02-23 22:41:01 return child(*args, **kwargs, fl_runstates=fl_runstates)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1097, in call
2025-02-23 22:41:01 raise e from None
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1088, in call
2025-02-23 22:41:01 output = self.fl.exec(func, args, kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/backends/base.py", line 151, in exec
2025-02-23 22:41:01 return run(*args, **kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 144, in call
2025-02-23 22:41:01 raise e from None
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 141, in call
2025-02-23 22:41:01 _output = self.next_call(*args, **kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/middleware.py", line 117, in call
2025-02-23 22:41:01 return self.next_call(*args, **kwargs)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/theflow/base.py", line 1017, in _runx
2025-02-23 22:41:01 return self.run(*args, **kwargs)
2025-02-23 22:41:01 File "/app/libs/kotaemon/kotaemon/indices/vectorindex.py", line 274, in run
2025-02-23 22:41:01 linked_thumbnail_docs = self.doc_store.get(list(thumbnail_doc_ids))
2025-02-23 22:41:01 File "/app/libs/kotaemon/kotaemon/storages/docstores/lancedb.py", line 109, in get
2025-02-23 22:41:01 .to_list()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 327, in to_list
2025-02-23 22:41:01 return self.to_arrow().to_pylist()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1017, in to_arrow
2025-02-23 22:41:01 return self.to_batches().read_all()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1029, in to_batches
2025-02-23 22:41:01 return self._table._execute_query(query)
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/table.py", line 2138, in _execute_query
2025-02-23 22:41:01 return LOOP.run(self._table._execute_query(query, batch_size))
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/background_loop.py", line 25, in run
2025-02-23 22:41:01 return asyncio.run_coroutine_threadsafe(future, self.loop).result()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result
2025-02-23 22:41:01 return self.__get_result()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
2025-02-23 22:41:01 raise self._exception
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/table.py", line 2886, in _execute_query
2025-02-23 22:41:01 table = await async_query.to_arrow()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1567, in to_arrow
2025-02-23 22:41:01 batch_iter = await self.to_batches()
2025-02-23 22:41:01 File "/usr/local/lib/python3.10/site-packages/lancedb/query.py", line 1557, in to_batches
2025-02-23 22:41:01 return AsyncRecordBatchReader(await self._inner.execute(max_batch_length))
2025-02-23 22:41:01 RuntimeError: lance error: LanceError(IO): sql parser error: Expected: an expression, found: ), /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lance-datafusion-0.22.0/src/sql.rs:100:8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants