[OMEGA-326] chroma knowledge indexing fails under Landlock during compaction - #307
Conversation
…s-under-landlock-during-compaction
…s-under-landlock-during-compaction
…s-under-landlock-during-compaction
| # siblings - and lib_chromadb.py opens its own client with the literal | ||
| # "./chroma_db". Matching that literal here (rather than resolving to an | ||
| # absolute path) keeps both clients on the same Chroma "system" (see #295). | ||
| DB_PATH = os.environ.get("CHROMA_DB_PATH", "./chroma_db") |
There was a problem hiding this comment.
This makes the DB path depend on cwd — before it was resolved relative to this file, so it worked from anywhere. Fine for the container and the README install since both cd to the PeTTa root, but anywhere else the os.makedirs below just creates an empty DB and the agent comes up with no memory, silently. Could we log the abspath when the client opens so that's at least visible?
Also, did you check whether the REFER change on its own fixes it? The reporter tested both together, so I can't tell if this part is doing any work.
There was a problem hiding this comment.
Good point, agree. I'll add the abspath logging 👍
As for REFER - as I mentioned, I was unable to reproduce the issue, so I cannot check this unfortunately.
But yeah, I'm assuming that ChromaDB compaction could resolve that with REFER access only, so the changes related to DB_PATH may not be necessary at all here, and we can just leave it as it was before - I suggest we do it this way.
| # siblings - and lib_chromadb.py opens its own client with the literal | ||
| # "./chroma_db". Matching that literal here (rather than resolving to an | ||
| # absolute path) keeps both clients on the same Chroma "system" (see #295). | ||
| DB_PATH = os.environ.get("CHROMA_DB_PATH", "./chroma_db") |
There was a problem hiding this comment.
lib_chromadb hardcodes ./chroma_db and has no env override, so setting CHROMA_DB_PATH to anything else puts the two clients back on separate systems — same bug as #295, since Chroma keys the system off the raw persist_directory string. Should we just drop the override here, or have it error when it isn't ./chroma_db?
There was a problem hiding this comment.
I don't think so, I think it would be better to just leave it as it was before.
… the resolved path
…s-under-landlock-during-compaction
|
Tested: images v0.1.15, v0.1.18, and What I checked
The cause is not the missing REFERControl run: The difference that matters is in the policy file: read_only:
- - /dev/shm
read_write:
+ - /var/tmp
+ - /dev/shmChroma writes to shared memory during compaction, and Verdict: the change does not address the cause of this issue. The bug is real and was fixed in |
Description
Although I was unable to reproduce the issue itself, both causes described in the issue were confirmed and verified in the code:
policy.pydid not includeAccessFs.REFER(required by Chroma for reparent/rename operations during compaction under Landlock), whilerag.pyandlib_chromadb.pyopenedPersistentClientusing different literal paths (/PeTTa/chroma_dbvs./chroma_db) for the same directory - ChromaDB 1.5.9 treats these as two different "systems".Applied the fixes proposed in the issue.
How Has This Been Tested?
Checklist