{"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":null,"httpStatus":null,"severity":"error","filePath":"extensions/llamacpp-extension/src/index.ts","lineNumber":582,"sourceCode":"   * 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        // Set only around the actual fetch, and only when there is one to do:\n        // an install that is already present must not flash a pending state.\n        this.embedderBootstrapping = true\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    } finally {\n      // In `finally` so a thrown import cannot leave the checklist reporting\n      // \"downloading\" for the rest of the session.","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/extensions/llamacpp-extension/src/index.ts#L564-L600","documentation":"bootstrapDefaultEmbedder() in the llamacpp extension downloads the fallback embedding model (via downloadAll with modelPath FALLBACK_EMBEDDING_MODEL_URL) and then verifies the install with hasEmbedderInstalled(). Because a cancelled or stopped download resolves without throwing, this check is the real guard: if the install cannot be confirmed, the import is considered incomplete and this error is thrown so bootstrap does not record the one-shot done flag.","triggerScenarios":"The fallback embedding model download was cancelled, stopped, or failed mid-transfer, then hasEmbedderInstalled() still returns false; disk was full; the model files were deleted after download but before the check; a network interruption aborted the download silently.","commonSituations":"User quits the app during first-run model pre-install; flaky network kills the GGUF download; antivirus quarantines the downloaded model file; the models directory was cleared manually between runs.","solutions":["Check disk space and network connectivity, then restart the app so bootstrap retries the download","Verify the model files under the provider's models directory; delete any partial download so it re-downloads cleanly","Confirm the extension's data folder is not being wiped between runs (the one-shot flag must not be recorded before install)","Download the model manually via the UI/CLI and re-run bootstrap"],"exampleFix":"// before (silently resolves on cancel)\nawait downloadAll({ modelPath: FALLBACK_EMBEDDING_MODEL_URL })\n// after (check completion before recording done)\nawait downloadAll({ modelPath: FALLBACK_EMBEDDING_MODEL_URL })\nif (!(await this.hasEmbedderInstalled())) throw new Error('Import incomplete')","handlingStrategy":"retry","validationCode":"// before relying on bootstrap\nif (!(await extension.hasEmbedderInstalled())) await bootstrapDefaultEmbedder()","typeGuard":null,"tryCatchPattern":"try {\n  await bootstrapDefaultEmbedder()\n} catch (e) {\n  if (e.message.includes('did not complete')) {\n    await cleanPartialDownload(); await bootstrapDefaultEmbedder() // retry once\n  } else throw e\n}","preventionTips":["Stable network required for first-run model download","Ensure sufficient disk space before bootstrap","Never delete the provider models directory mid-install","Wrap bootstrap in a retry with backoff"],"tags":["download","model-import","bootstrap"],"backgroundTag":"download-failed","analyzedSha":"7205d770c1e097c3daf35a911176410e93bc5564","analyzedAt":"2026-09-17T14:27:30.100Z","contentChangedAt":"2026-09-17T14:27:30.100Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}