-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Bug]: sqlite3.OperationalError: attempt to write a readonly database #1441
Comments
To make this issue more self-contained:
|
Are you running multiple processes / is some other process accessing chroma? |
Good question, @HammadB. This error does have the feel of a race condition, and it is entirely possible there were, what Ragna terms, multiple workers running at the same time. Maybe @pmeier can chime in here and give a little more architectural detail about Ragna because I'm not familiar with all of the internals. |
That could be the case. Depending on the setup, we might have ended up by a single Chroma client that is used by multiple threads. @peachkeel do you remember if you were running with multiple worker threads? If you still have access to the logs, scroll to the very top. There should be a log message on how many threads you started. |
I'm afraid those logs are long gone, @pmeier 😕 We haven't seen the error recently, but we're usually running in UI mode (single worker). |
Chroma is thread-safe, so long that you create a single client and pass on the ref to a number of threads, you shouldn't run into this problem. Issues start when you have multiple clients, e.g. you instantiate a new client in each thread, or you have multiple processes, each creating a separate Chroma client. |
In that case, I think Ragna is not at fault. Unless @peachkeel actually spawned multiple worker processes, i.e. invoking |
Well, @pmeier & @tazarov, if that's the case, I think it is likely that I'm at fault:
I'm pretty sure the Should Ragna create a lock file or pid file to prevent multiple processes from running with independent worker threads? |
No need as we have eliminated the task queue / worker: Quansight/ragna#205. SO if this indeed happened, because we had multiple clients from different processes, than this will not happen again. |
I'm going to close the issue in both repositories. Thanks everyone! |
For posterities sake:
|
What happened?
When adding embeddings to Chroma via Ragna, a RAG orchestration framework, the above error about an attempt to write to a readonly database was thrown. The error seems to originate from within the
chromadb
package.This bug was originally reported to Ragna as issue Quansight/ragna#190 and @pmeier, the maintainer there, suggested the issue be upstreamed here.
Versions
Chroma v0.4.15, Python 3.10.12, Ubuntu 22.04.3 LTS
Relevant log output
The text was updated successfully, but these errors were encountered: