{"record":{"id":"277f8257f185ae69","repo":"Mintplex-Labs/anything-llm","slug":"chromacloud-invalid-env-settings","errorCode":null,"errorMessage":"ChromaCloud::Invalid ENV settings","messagePattern":"ChromaCloud::Invalid ENV settings","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/vectorDbProviders/chromacloud/index.js","lineNumber":31,"sourceCode":"\n  get name() {\n    return \"ChromaCloud\";\n  }\n\n  /**\n   * Basic quota/limitations for Chroma Cloud for accounts. Does not lookup client-specific limits.\n   * @see https://docs.trychroma.com/cloud/quotas-limits\n   */\n  limits = {\n    maxEmbeddingDim: 4_096,\n    maxDocumentBytes: 16_384,\n    maxMetadataBytes: 4_096,\n    maxRecordsPerWrite: 300,\n  };\n\n  async connect() {\n    if (process.env.VECTOR_DB !== \"chromacloud\")\n      throw new Error(\"ChromaCloud::Invalid ENV settings\");\n\n    const client = new CloudClient({\n      apiKey: process.env.CHROMACLOUD_API_KEY,\n      tenant: process.env.CHROMACLOUD_TENANT,\n      database: process.env.CHROMACLOUD_DATABASE,\n    });\n\n    const isAlive = await client.heartbeat();\n    if (!isAlive)\n      throw new Error(\n        \"ChromaCloud::Invalid Heartbeat received - is the instance online?\"\n      );\n    return { client };\n  }\n\n  /**\n   * Chroma Cloud has some basic limitations on upserts to protect performance and latency.\n   * Local deployments do not have these limitations since they are self-hosted.","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/vectorDbProviders/chromacloud/index.js#L13-L49","documentation":"ChromaCloudVectorDb.connect() guards on process.env.VECTOR_DB !== 'chromacloud' and throws before building the CloudClient. The Chroma Cloud provider is only valid when the app-wide vector-db selection is chromacloud; using the class under any other VECTOR_DB value is a wiring error.","triggerScenarios":"Invoking ChromaCloudVectorDb methods while VECTOR_DB is unset or set to another provider ('chroma', 'lance', ...) - typically direct instantiation in custom code, or .env changed to/from chromacloud without a full restart.","commonSituations":"Migrating a deployment from local Chroma to Chroma Cloud (or back) and restarting only one process; scripts requiring the chromacloud provider without env setup; stale container env after editing docker-compose.","solutions":["Set VECTOR_DB=chromacloud in server/.env along with CHROMACLOUD_API_KEY, CHROMACLOUD_TENANT, CHROMACLOUD_DATABASE.","Restart every server/container so all processes agree on the value.","In custom code, go through the vector-db factory instead of requiring vectorDbProviders/chromacloud directly.","Print process.env.VECTOR_DB at runtime to confirm no stale value."],"exampleFix":"# before (.env)\nVECTOR_DB=chroma\n# but ChromaCloudVectorDb used directly -> throw\n\n# after (.env)\nVECTOR_DB=chromacloud\nCHROMACLOUD_API_KEY=<secret>\nCHROMACLOUD_TENANT=<tenant>\nCHROMACLOUD_DATABASE=<database>","handlingStrategy":"validation","validationCode":"function requireChromaCloud() {\n  if (process.env.VECTOR_DB !== 'chromacloud') {\n    throw new Error(\"VECTOR_DB must be 'chromacloud' to use ChromaCloudVectorDb.\");\n  }\n  for (const k of ['CHROMACLOUD_API_KEY','CHROMACLOUD_TENANT','CHROMACLOUD_DATABASE']) {\n    if (!process.env[k]) throw new Error(`${k} is required for Chroma Cloud.`);\n  }\n}","typeGuard":"function isChromaCloudConfigured() {\n  return process.env.VECTOR_DB === 'chromacloud' && !!process.env.CHROMACLOUD_API_KEY;\n}","tryCatchPattern":null,"preventionTips":["Migrate env (VECTOR_DB + three CHROMACLOUD_* vars) as one unit and restart everything.","Route provider selection through the factory keyed on VECTOR_DB, never direct requires."],"tags":["chroma-cloud","vector-db","env","configuration"],"backgroundTag":"env-config-mismatch","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}