chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
15.25k stars 1.28k forks source link

[Bug]: Getting Sqlite 3 Runtime Error while trying to run python 3.11.4 with Chromadb 0.4.4 on Docker container #934

Open Rasika-Deodhar opened 1 year ago

Rasika-Deodhar commented 1 year ago

What happened?

I am trying to deploy an application with Python 3.11.4 backend which uses Chromadb 0.4.4. However, I am getting an sqlite3 unsupported version error when I try calling it using AzureChatOpenAI endpoint. This happens specifically when I am trying to deploy this on a docker container. It runs fine on local machine.

Code for reproduction after deployment:

I have my code in 3 parts:

  1. Creating a AzureChatOpenAI endpoint using langchain.

    from langchain.chat_models import AzureChatOpenAI 
    openai = AzureChatOpenAI()
    embeddings = OpenAIEmbeddings()
  2. Storing into a vectorstore using ChromaDb.

It fails on Chroma.from_documents(texts, embeddings).

    texts = 'some texts from a document'
    db = Chroma.from_documents(texts, embeddings) 
    retriever = db.as_retriever(search_type='similarity')
  1. Retrieving responses from the AzureChatOpenAI endpoint.

    qa = ConversationalRetrievalChain.from_llm(openai, retriever)

Versions

### Environment on Docker Container Running on Ubuntu - Linux 5.10.16.3-microsoft-standard x86_64 x86_64 x86_64 GNU/Linux and latest Chroma 0.4.4

Tried with Chroma 0.4.2 as well - but didn't work.

Error log images:

image001

image002

image003

image004

Other Fixes Tried:

Fixes tried

  1. Followed the documentation from the error log : https://docs.trychroma.com/troubleshooting#sqlite. Added installation in docker image.
  2. Tried forced installations of sqlite4 and sqlite5 in docker-api file.
  3. Added sqlite import in my script similar to what is mentioned here - https://community.render.com/t/your-system-has-an-unsupported-version-of-sqlite3-chroma-requires-sqlite3-3-35-0/13807

Relevant log output

No response

jeffchuber commented 1 year ago

@Rasika-Deodhar is it possible to use python 3.10 - we use python:3.10-slim-bookworm as the base docker image and it works well.

deshraj commented 1 year ago

Running into the same issue. Would be great if the chroma devs can resolve this issue and make it work for other docker images.

Rasika-Deodhar commented 1 year ago

@Rasika-Deodhar is it possible to use python 3.10 - we use python:3.10-slim-bookworm as the base docker image and it works well.

Thanks a lot for you response. I am afraid I cannot use the earlier version of Python, as it may not align with the compatibility requirements of the other langchain libraries we are aiming to incorporate.

emilesilvis commented 1 year ago

Seeing the same issue with base image python:3.11.3.

emilesilvis commented 1 year ago

Using version 0.3.29 of chromadb seems to work (as per https://community.render.com/t/your-system-has-an-unsupported-version-of-sqlite3-chroma-requires-sqlite3-3-35-0/13807/6).

HammadB commented 1 year ago

@emilesilvis Older versions of chroma don't use sqlite and therefore won't have this issue.

@Rasika-Deodhar can you share how you are swapping the pysqlite binary in? It seems like thats not working for you.

Toysoldier34 commented 11 months ago

On MacOS using Chroma 0.4.17 and I run into the SQLite 3 version issue on multiple versions of Python and haven't found one that resolves it, including 3.10.10, 3.10.13, 3.11.6.