{"record":{"id":"f91d8fcc5ef970b3","repo":"chroma-core/chroma","slug":"not-implemented-f91d8f","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"rust/sysdb/src/sysdb.rs","lineNumber":237,"sourceCode":"        match self {\n            SysDb::Grpc(grpc) => grpc.get_collections(options).await,\n            SysDb::Sqlite(sqlite) => sqlite.get_collections(options).await,\n            SysDb::Test(test) => test.get_collections(options).await,\n        }\n    }\n\n    pub async fn get_collection_by_crn(\n        &mut self,\n        tenant_resource_name: String,\n        database: String,\n        name: String,\n    ) -> Result<Collection, GetCollectionByCrnError> {\n        match self {\n            SysDb::Grpc(grpc) => {\n                grpc.get_collection_by_crn(tenant_resource_name, database, name)\n                    .await\n            }\n            SysDb::Sqlite(_) => unimplemented!(),\n            SysDb::Test(test) => {\n                test.get_collection_by_crn(tenant_resource_name, database, name)\n                    .await\n            }\n        }\n    }\n\n    pub async fn count_collections(\n        &mut self,\n        tenant: String,\n        database: Option<DatabaseName>,\n    ) -> Result<usize, CountCollectionsError> {\n        // TODO(Sanket): optimize sqlite and test implementation.\n        match self {\n            SysDb::Grpc(grpc) => grpc.count_collections(tenant, database).await,\n            SysDb::Sqlite(sqlite) => Ok(sqlite\n                .get_collections(GetCollectionsOptions {\n                    tenant: Some(tenant),","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/rust/sysdb/src/sysdb.rs#L219-L255","documentation":"SysDb::get_collection_by_crn dispatches on the backend enum: Grpc and Test variants forward the call, but the Sqlite variant executes unimplemented!(), which panics (not an error value). get_collection_by_crn is a newer CRN-based (collection resource name) lookup that has only been implemented for the gRPC sysdb; calling it on the embedded/single-process SQLite sysdb kills the task/thread with a panic that unwinds as 'not implemented'.","triggerScenarios":"Any code path that resolves a collection by CRN (tenant resource name + database + collection name) while running against the embedded SysDb::Sqlite backend — e.g. a single-node Rust server binary configured with the sqlite sysdb instead of the gRPC sysdb, or a test harness that uses the sqlite variant and then exercises CRN routing.","commonSituations":"Running the distributed/CRN-aware control plane against a local dev configuration that kept sqlite for simplicity; upgrading to a version where CRN lookups exist but the sqlite backend was never extended; integration tests sharing code with production routing logic hitting the unsupported branch.","solutions":["Route CRN lookups to the gRPC backend: configure the Rust server/sysdb client to use SysDb::Grpc (point it at a running sysdb service) instead of the embedded sqlite variant.","For single-process sqlite deployments, avoid CRN-based resolution — use the non-CRN collection lookup APIs that the sqlite backend does implement.","If you own the sqlite backend, implement get_collection_by_crn for SysDb::Sqlite (translate tenant/database/name to the existing sqlite query) instead of leaving unimplemented!().","As a stopgap in tests, inject SysDb::Test with a mock that implements get_collection_by_crn so the panic path is never reached."],"exampleFix":"// before\n// sqlite-backed sysdb + CRN lookup -> panics: not implemented\nlet col = sysdb.get_collection_by_crn(tenant, db, name).await; // SysDb::Sqlite(_) hits unimplemented!()\n\n// after\n// guard the call by backend capability\nif matches!(sysdb, SysDb::Sqlite(_)) {\n    return Err(anyhow::anyhow!(\"CRN lookup requires the gRPC sysdb backend\"));\n}\nlet col = sysdb.get_collection_by_crn(tenant, db, name).await?;","handlingStrategy":"validation","validationCode":"// Before any CRN lookup, assert the backend supports it.\nfn ensure_crn_lookup_supported(sysdb: &SysDb) -> anyhow::Result<()> {\n    if matches!(sysdb, SysDb::Sqlite(_)) {\n        anyhow::bail!(\"get_collection_by_crn is only implemented for the gRPC sysdb backend\");\n    }\n    Ok(())\n}\n\nensure_crn_lookup_supported(&sysdb)?;\nlet collection = sysdb.get_collection_by_crn(tenant, db, name).await?;","typeGuard":"fn supports_get_collection_by_crn(sysdb: &SysDb) -> bool {\n    !matches!(sysdb, SysDb::Sqlite(_))\n}","tryCatchPattern":"// unimplemented!() panics, it does not return Err — catch_unwind is the only catch:\nlet result = std::panic::catch_unwind(std::assert_unwind_safe(|| {\n    futures::executor::block_on(sysdb.get_collection_by_crn(t, d, n))\n}));\nmatch result {\n    Ok(Ok(col)) => { /* use collection */ }\n    Ok(Err(e)) => { /* real GetCollectionByCrnError */ }\n    Err(panic) => { /* 'not implemented' from Sqlite variant — fix config, don't retry */ }\n}","preventionTips":["Choose the gRPC sysdb backend whenever the code path uses CRN-based routing.","Add a startup capability check that matches on the SysDb variant and refuses CRN features on Sqlite.","In tests, inject a SysDb::Test mock implementing get_collection_by_crn instead of the sqlite variant.","Search the codebase for unimplemented!/todo! in enum-dispatch arms before shipping a new backend variant — each is a latent panic."],"tags":["rust","sysdb","panic","unimplemented","sqlite","grpc","chroma"],"backgroundTag":"unimplemented-feature-panic","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}