chroma-core / chroma-core/chroma

[Bug]: Chroma DB PersistentClient object is not cleared after destroying the collection and directory

Open
#6,499 3 comments 0 reactions 1 assignee Claimed by @kylediaz View on GitHub
bug
Dominant language
Rust
Stars
29.3k
Forks
2.5k
Avg merge
1d 4h
Merged PRs (30d)
38

Description

### What happened?

Using the `Chroma.PersistenClient()` object to manage the in memory vectors on Langflow. Upon destroying the Chroma collection and then deleting the directory, recreating the directory and creating Vector data inside of it throws `Database error: error returned from database: (code: 1032) attempt to write a readonly database`.

This looks like it is a dangling pointer/zombie lock error where in the internal pointer cleanup wasn't performed correctly.
We got around this by forcing the system to create a Fresh Chroma client every time and now reusing older ones. But this required using private methods which shouldn't be the case for users. Ended up using: `del SharedSystemClient._identifier_to_system[path_key]` to delete the pointer to the earlier instance if it's present and then creating a new `PersistentClient()`. Do we have this tracked for a fix that does internal cleanup as expected?

### Versions

Python `3.13.12`, chromadb `1.4.1`, MacOS Sequoia `15.4.1`

### Relevant log output

```shell
Job ca348605-f5b2-481f-b789-5dcb55514473 failed with unexpected error: Database error: error returned from database: (code: 1032) attempt to write a readonly database
```

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.