Skip to content

[Bug]: Chroma fails to load persisted DB: Rust panic range start index XX out of range for slice length YY (metadata/segment mismatch) #5909

@king-66jack

Description

@king-66jack

What happened?

Has Chroma undergone a major version update? The library I built back in July still works, but the one I'm trying to create now is throwing errors instead.

Versions

chromadb1.0.15
Python 3.9.12
windows 11

Relevant log output

(base) PS C:\Users\18390\Desktop\debug> python .\serve.py
D:\miniconda3\lib\site-packages\jieba\_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
C:\Users\18390\Desktop\debug\serve.py:68: LangChainDeprecationWarning: The class `Chroma` was deprecated in LangChain 0.2.9 and will be removed in 1.0. An updated version of the class exists in the :class:`~langchain-chroma package and should be used instead. To use it run `pip install -U :class:`~langchain-chroma` and import as `from :class:`~langchain_chroma import Chroma``.
  vectordb = Chroma(persist_directory=persist_directory, embedding_function=get_embedding())
2025-11-25 10:55:46,236 - INFO - Anonymized telemetry enabled. See                     https://docs.trychroma.com/telemetry for more information.
thread '<unnamed>' panicked at rust\sqlite\src\db.rs:157:42:
range start index 10 out of range for slice of length 9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "C:\Users\18390\Desktop\debug\serve.py", line 323, in <module>
    get_retriever(DOMAIN)
  File "C:\Users\18390\Desktop\debug\serve.py", line 104, in get_retriever
    retriever = get_ensemble_retriever(domain, k=3)
  File "C:\Users\18390\Desktop\debug\serve.py", line 86, in get_ensemble_retriever
    bm25_retriever, vectordb_retriever = get_bm25_retriever(domain, k)
  File "C:\Users\18390\Desktop\debug\serve.py", line 68, in get_bm25_retriever
    vectordb = Chroma(persist_directory=persist_directory, embedding_function=get_embedding())
  File "D:\miniconda3\lib\site-packages\langchain_core\_api\deprecation.py", line 222, in warn_if_direct_instance
    return wrapped(self, *args, **kwargs)
  File "D:\miniconda3\lib\site-packages\langchain_community\vectorstores\chroma.py", line 122, in __init__
    self._client = chromadb.Client(_client_settings)
  File "D:\miniconda3\lib\site-packages\chromadb\__init__.py", line 379, in Client
    return ClientCreator(tenant=tenant, database=database, settings=settings)
  File "D:\miniconda3\lib\site-packages\chromadb\api\client.py", line 65, in __init__
    super().__init__(settings=settings)
  File "D:\miniconda3\lib\site-packages\chromadb\api\shared_system_client.py", line 19, in __init__
    SharedSystemClient._create_system_if_not_exists(self._identifier, settings)
  File "D:\miniconda3\lib\site-packages\chromadb\api\shared_system_client.py", line 32, in _create_system_if_not_exists
    new_system.start()
  File "D:\miniconda3\lib\site-packages\chromadb\config.py", line 471, in start
    component.start()
  File "D:\miniconda3\lib\site-packages\chromadb\api\rust.py", line 112, in start
    self.bindings = chromadb_rust_bindings.Bindings(
pyo3_runtime.PanicException: range start index 10 out of range for slice of length 9
(base) PS C:\Users\18390\Desktop\debug>

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions