{"record":{"id":"1654811b2378c7b9","repo":"janhq/jan","slug":"import-of-fallback-embedding-model-id-did-not","errorCode":null,"errorMessage":"Import of \"${FALLBACK_EMBEDDING_MODEL_ID}\" did not complete","messagePattern":"Import of \"(.+?)\" did not complete","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/llamacpp-extension/src/index.ts","lineNumber":642,"sourceCode":"   * the +1 embedding slot from its first start instead of importing the model\n   * mid-session on the first RAG call. Runs after the router is up so the\n   * download never delays chat availability; the import's preset refresh then\n   * resizes models_max via an idle restart (nothing is loaded yet at startup).\n   * The persisted flag keeps this from resurrecting a model the user deleted,\n   * and is only set on success so a failed download retries next launch.\n   */\n  private async bootstrapDefaultEmbedder(): Promise<void> {\n    try {\n      if (await getBackendSetting(EMBEDDER_BOOTSTRAP_KEY)) return\n      if (!(await this.hasEmbedderInstalled())) {\n        await this.import(FALLBACK_EMBEDDING_MODEL_ID, {\n          modelPath: FALLBACK_EMBEDDING_MODEL_URL,\n        })\n        // A stopped or cancelled download resolves without throwing, so the\n        // install has to be confirmed before the one-shot flag is recorded --\n        // otherwise bootstrap marks itself done and never retries.\n        if (!(await this.hasEmbedderInstalled())) {\n          throw new Error(\n            `Import of \"${FALLBACK_EMBEDDING_MODEL_ID}\" did not complete`\n          )\n        }\n        logger.info(\n          `Pre-installed fallback embedding model \"${FALLBACK_EMBEDDING_MODEL_ID}\" at startup`\n        )\n      }\n      await setBackendSetting(EMBEDDER_BOOTSTRAP_KEY, 'true')\n      this.embedderBootstrapError = undefined\n    } catch (e) {\n      this.embedderBootstrapError = e instanceof Error ? e.message : String(e)\n      logger.warn(\n        'Fallback embedder bootstrap failed (will import on demand):',\n        e\n      )\n    }\n  }\n","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/extensions/llamacpp-extension/src/index.ts#L624-L660","documentation":"Thrown during bootstrapDefaultEmbedder when the fallback embedding model import is invoked but the model is not confirmed installed afterward. The import() call for a stopped or cancelled download resolves without throwing, so hasEmbedderInstalled() is checked as a second gate. If it returns false, the bootstrap is considered incomplete.","triggerScenarios":"The fallback embedding model download was cancelled, stopped, or silently failed; the download resolved (no throw) but the model files were not written to disk; disk was full during model extraction; the model URL was unreachable and import() resolved in a degraded state.","commonSituations":"User cancels or closes the app during the first-run embedder bootstrap; network drop during download leaves the model partially written; antivirus quarantining the downloaded model file; Jan data folder on a read-only or full volume.","solutions":["Restart the application — bootstrapDefaultEmbedder only marks the EMBEDDER_BOOTSTRAP_KEY flag after confirmed success, so it will retry on next launch.","Check network connectivity and ensure the FALLBACK_EMBEDDING_MODEL_URL is reachable.","Verify the Jan data folder is writable and has sufficient free disk space.","Manually import the embedding model via the UI to populate it outside the bootstrap path."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Check if embedder is already installed before relying on bootstrap\nconst installed = await extension.hasEmbedderInstalled()\nif (!installed) {\n  // bootstrap will run; ensure network and disk are ready first\n}","typeGuard":null,"tryCatchPattern":"try {\n  await extension.bootstrapDefaultEmbedder()\n} catch (e) {\n  // embedderBootstrapError is set internally; check it and retry\n  if (extension.embedderBootstrapError) {\n    await extension.bootstrapDefaultEmbedder() // retry once\n  }\n}","preventionTips":["Ensure the Jan data folder is on a writable volume with adequate space before first run.","Pre-import the fallback embedding model via the UI in controlled deployments.","Monitor embedderBootstrapError after startup to detect and surface bootstrap failures to the user."],"tags":["embedding-model","bootstrap","download","first-run","typescript"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}