{"record":{"id":"2162b1d72b872ab3","repo":"abhigyanpatwari/GitNexus","slug":"assessment-message-local-embedding-runtime-blocked","errorCode":null,"errorMessage":"assessment.message (local embedding runtime blocked/unloadable)","messagePattern":"assessment\\.message \\(local embedding runtime blocked/unloadable\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/embeddings-sync.ts","lineNumber":128,"sourceCode":"\n    // The vector column is FLOAT[N] fixed when the index was built, and the\n    // pipeline deletes each batch's stale rows immediately before inserting the\n    // replacements — so a width change here deletes rows it cannot re-insert.\n    // `analyze` forces a full rebuild on the same mismatch; only a rebuild can\n    // retype the column, so this writer refuses instead. An absent recorded\n    // width is not a mismatch (see `embeddingDimsMismatch`).\n    if (embeddingDimsMismatch(meta.embeddingDims, EMBEDDING_DIMS)) {\n      throw new Error(\n        `Cannot sync embeddings: this index stores FLOAT[${meta.embeddingDims}] vectors, ` +\n          `but this run embeds at ${EMBEDDING_DIMS} dimensions. ` +\n          'Run `gitnexus analyze --embeddings --force` to rebuild the column at the new width.',\n      );\n    }\n\n    if (!isHttpMode()) {\n      const assessment = assessLocalEmbeddingRuntime();\n      if (assessment.status === 'blocked' || assessment.status === 'prefix-unloadable') {\n        throw new Error(assessment.message);\n      }\n      if (assessment.status === 'needs-install') {\n        cliInfo(`Local embedding runtime is not installed.`);\n        cliInfo(`Downloading it now from your npm registry into ${getEmbeddingRuntimeDir()} …`);\n        try {\n          await installEmbeddingRuntime(\n            {},\n            getEmbeddingInstallTimeoutMs(ANALYZE_EMBEDDING_INSTALL_TIMEOUT_MS),\n          );\n        } catch (err) {\n          throw new Error(\n            `Could not install the embedding runtime: ${err instanceof Error ? err.message : String(err)}\\n\\n` +\n              localEmbeddingStackMissingMessage(),\n          );\n        }\n      }\n    }\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/cli/embeddings-sync.ts#L110-L146","documentation":"In non-HTTP mode the local embedding runtime is assessed before syncing. Status 'blocked' or 'prefix-unloadable' means the local native/onnx runtime cannot be loaded or is blocked on this platform, so embeddings cannot be produced locally and the command aborts with the assessment's message.","triggerScenarios":"Running embeddings sync without HTTP mode configured while the local runtime is unusable — missing native binaries, unsupported platform/arch, corrupted runtime install directory (getEmbeddingRuntimeDir), or a runtime whose module prefix fails to load.","commonSituations":"Alpine/ musl or unusual architectures lacking prebuilt onnxruntime binaries; a partially-failed `needs-install` download left a broken runtime; security software blocking native module loading; Node version incompatibility with the native module.","solutions":["Reinstall the local runtime: delete getEmbeddingRuntimeDir() contents and re-run so the command re-downloads it.","Switch to HTTP mode (configure an HTTP embedding endpoint) to bypass the local runtime entirely.","Check the assessment message for the blocked reason — often an unsupported platform/arch; use a supported Node version/OS.","Verify no antivirus/permissions policy is preventing the native module under the runtime dir from loading.","Run `gitnexus analyze --embeddings` once to trigger the runtime install flow and surface any install errors directly."],"exampleFix":"// before\n$ gitnexus embeddings-sync .   # Error: local runtime blocked/unloadable\n// after\n$ rm -rf \"$(gitnexus config embedding-runtime-dir)\"   # or the runtime dir path\n$ gitnexus embeddings-sync .   # re-downloads runtime\n// alternative: configure HTTP embedding endpoint instead of local runtime","handlingStrategy":"fallback","validationCode":"// Pre-flight the local runtime before syncing (non-HTTP mode):\nif (!process.env.EMBEDDING_HTTP_ENDPOINT) {\n  const dir = getEmbeddingRuntimeDir();\n  if (!existsSync(dir) || isEmptyDir(dir)) {\n    await installEmbeddingRuntime(); // or rm -rf the dir and let the CLI reinstall\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await gitnexus.embeddingsSync(repo);\n} catch (err) {\n  if (/blocked|unloadable/.test(err.message)) {\n    // Option A: reinstall the local runtime\n    await reinstallEmbeddingRuntime();\n    // Option B: fall back to HTTP embedding mode\n    process.env.EMBEDDING_HTTP_ENDPOINT = 'http://localhost:11434';\n    await gitnexus.embeddingsSync(repo);\n  } else throw err;\n}","preventionTips":["Run `gitnexus analyze --embeddings` once on a new machine to install/verify the runtime before scripting syncs.","Prefer HTTP embedding mode in containers/CI where native binaries are unreliable.","Check the runtime install directory after failed installs and clear it before retrying.","Confirm your Node version and platform/arch have supported prebuilt native binaries.","Ensure security policies (antivirus, sandboxing) allow loading native modules from the runtime dir."],"tags":["embeddings","native-runtime","environment","onnx"],"backgroundTag":"module-init-failed","analyzedSha":"ac9a4e9abd8fd3058c070b72c23402a4f887929a","analyzedAt":"2026-09-15T23:29:44.066Z","contentChangedAt":"2026-09-15T23:29:44.066Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}