chroma-core / chroma-core/chroma

[Bug]: KeyError when using multiple PersistentClient instances with different paths in the same process (Python 3.13)

Open
#7,253 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
29.3k
Forks
2.5k
Avg merge
1d 4h
Merged PRs (30d)
38

Description

### What happened?

``import chromadb``
``client1 = chromadb.PersistentClient(path="./db1")``
``client2 = chromadb.PersistentClient(path="./db2") # raises KeyError``

When multiple PersistentClient instances are created with different paths in the same process, the identifier generated from persist_directory is not normalised, making ``_identifier_to_system`` cache lookup fail with a ``KeyError``.

### Versions

Python 3.13
Chroma latest version
Windows OS

### Relevant log output

```shell
File "chromadb/api/shared_system_client.py", line 49, in _create_system_if_not_exists
return cls._identifier_to_system[identifier]
KeyError: ''
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.