{"record":{"id":"9f947a6436d2a2d8","repo":"janhq/jan","slug":"vector-db-extension-not-available","errorCode":null,"errorMessage":"Vector DB extension not available","messagePattern":"Vector DB extension not available","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/rag-extension/src/index.ts","lineNumber":445,"sourceCode":"  ): Promise<{\n    filesProcessed: number\n    chunksInserted: number\n    files: AttachmentFileInfo[]\n  }> {\n    if (!threadId || !Array.isArray(files) || files.length === 0) {\n      return { filesProcessed: 0, chunksInserted: 0, files: [] }\n    }\n\n    // Respect feature flag: do nothing when disabled\n    if (this.config.enabled === false) {\n      return { filesProcessed: 0, chunksInserted: 0, files: [] }\n    }\n\n    const vec = window.core?.extensionManager.get(\n      ExtensionTypeEnum.VectorDB\n    ) as unknown as VectorDBExtension\n    if (!vec?.createCollection || !vec?.insertChunks) {\n      throw new Error('Vector DB extension not available')\n    }\n\n    // Load settings\n    const s = this.config\n    const maxSize = (s?.enabled === false ? 0 : s?.maxFileSizeMB) || undefined\n    const chunkSize = s?.chunkSizeChars as number | undefined\n    const chunkOverlap = s?.overlapChars as number | undefined\n\n    let totalChunks = 0\n    const processedFiles: AttachmentFileInfo[] = []\n\n    for (const f of files) {\n      if (!f?.path) continue\n      if (maxSize && f.size && f.size > maxSize * 1024 * 1024) {\n        throw new Error(\n          `File '${f.name}' exceeds size limit (${f.size} bytes > ${maxSize} MB).`\n        )\n      }","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/extensions/rag-extension/src/index.ts#L427-L463","documentation":"Thrown by RAGExtension.ingestAttachments() (thread-level ingestion) when the resolved VectorDB extension is missing OR lacks createCollection/insertChunks. This is a different capability check than project-level: it requires the foundational vector-db methods. Without them, no thread collection can be created or populated, so the call aborts before the file loop.","triggerScenarios":"Calling ingestAttachments(threadId, files) when vector-db-extension is not registered, crashed, or is a stripped-down build missing createCollection/insertChunks; ExtensionTypeEnum.VectorDB resolves to a different extension than expected.","commonSituations":"vector-db-extension disabled while rag-extension is enabled; extension failed to load due to a missing native dependency (e.g. sqlite-vec); partial upgrade left an incompatible extension installed.","solutions":["Enable and load vector-db-extension (verify via window.core.extensionManager.get(ExtensionTypeEnum.VectorDB)).","Reinstall/update vector-db-extension so createCollection and insertChunks are present.","Check the extension's startup log for a native-binding load failure.","Guard the caller: skip RAG ingestion and degrade to plain LLM context when the extension is unavailable."],"exampleFix":"// before\nawait rag.ingestAttachments(threadId, files)\n\n// after\nconst vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as any\nif (!vec?.createCollection || !vec?.insertChunks) {\n  logger.warn('Vector DB unavailable; attachments will not be indexed')\n  return { filesProcessed: 0, chunksInserted: 0, files: [] }\n}\nawait rag.ingestAttachments(threadId, files)","handlingStrategy":"type-guard","validationCode":"const vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as any\nconst ok = vec && typeof vec.createCollection === 'function' && typeof vec.insertChunks === 'function'\nif (!ok) {\n  // degrade RAG or prompt to enable/update the extension\n}","typeGuard":"function hasCoreVectorDB(vec: unknown): vec is { createCollection: Function; insertChunks: Function } {\n  const v = vec as any\n  return !!v && typeof v.createCollection === 'function' && typeof v.insertChunks === 'function'\n}","tryCatchPattern":null,"preventionTips":["Ensure vector-db-extension is enabled whenever rag-extension is enabled.","Verify extension registration at startup.","Gracefully disable RAG UI when the vector DB is unavailable."],"tags":["rag","vector-db","extension","thread"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}