janhq/jan · error · Error

Import of "${FALLBACK_EMBEDDING_MODEL_ID}" did not complete

Error message

Import of "${FALLBACK_EMBEDDING_MODEL_ID}" did not complete

What it means

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.

Source

Thrown at extensions/llamacpp-extension/src/index.ts:642

   * the +1 embedding slot from its first start instead of importing the model
   * mid-session on the first RAG call. Runs after the router is up so the
   * download never delays chat availability; the import's preset refresh then
   * resizes models_max via an idle restart (nothing is loaded yet at startup).
   * The persisted flag keeps this from resurrecting a model the user deleted,
   * and is only set on success so a failed download retries next launch.
   */
  private async bootstrapDefaultEmbedder(): Promise<void> {
    try {
      if (await getBackendSetting(EMBEDDER_BOOTSTRAP_KEY)) return
      if (!(await this.hasEmbedderInstalled())) {
        await this.import(FALLBACK_EMBEDDING_MODEL_ID, {
          modelPath: FALLBACK_EMBEDDING_MODEL_URL,
        })
        // A stopped or cancelled download resolves without throwing, so the
        // install has to be confirmed before the one-shot flag is recorded --
        // otherwise bootstrap marks itself done and never retries.
        if (!(await this.hasEmbedderInstalled())) {
          throw new Error(
            `Import of "${FALLBACK_EMBEDDING_MODEL_ID}" did not complete`
          )
        }
        logger.info(
          `Pre-installed fallback embedding model "${FALLBACK_EMBEDDING_MODEL_ID}" at startup`
        )
      }
      await setBackendSetting(EMBEDDER_BOOTSTRAP_KEY, 'true')
      this.embedderBootstrapError = undefined
    } catch (e) {
      this.embedderBootstrapError = e instanceof Error ? e.message : String(e)
      logger.warn(
        'Fallback embedder bootstrap failed (will import on demand):',
        e
      )
    }
  }

View on GitHub (pinned to fad3f12a14)

Solutions

  1. Restart the application — bootstrapDefaultEmbedder only marks the EMBEDDER_BOOTSTRAP_KEY flag after confirmed success, so it will retry on next launch.
  2. Check network connectivity and ensure the FALLBACK_EMBEDDING_MODEL_URL is reachable.
  3. Verify the Jan data folder is writable and has sufficient free disk space.
  4. Manually import the embedding model via the UI to populate it outside the bootstrap path.
Defensive patterns

Strategy: retry

Validate before calling

// Check if embedder is already installed before relying on bootstrap
const installed = await extension.hasEmbedderInstalled()
if (!installed) {
  // bootstrap will run; ensure network and disk are ready first
}

Try / catch

try {
  await extension.bootstrapDefaultEmbedder()
} catch (e) {
  // embedderBootstrapError is set internally; check it and retry
  if (extension.embedderBootstrapError) {
    await extension.bootstrapDefaultEmbedder() // retry once
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of janhq/jan@fad3f12a14 (2026-08-12). Data as JSON: /api/errors/1654811b2378c7b9. Report an issue: GitHub.