{"record":{"id":"a43d12e2db716243","repo":"abhigyanpatwari/GitNexus","slug":"analysis-not-finalized-missing-meta-metadata-for-resolved-at","errorCode":null,"errorMessage":"Analysis not finalized: missing ${'meta'} metadata for ${resolved} at ${storagePath} (registry: ${getGlobalRegistryPath()})","messagePattern":"Analysis not finalized: missing (.+?) metadata for (.+?) at (.+?) \\(registry: (.+?)\\)","errorType":"exception","errorClass":"AnalysisNotFinalizedError","httpStatus":null,"severity":"error","filePath":"gitnexus/src/storage/repo-manager.ts","lineNumber":1469,"sourceCode":" * The optional `resolvedStoragePath` carries the exact slot used by the\n * analysis. Omitting it preserves the legacy local-resolution behavior for\n * direct callers.\n */\nexport const assertAnalysisFinalized = async (\n  repoPath: string,\n  resolvedStoragePath?: string,\n): Promise<void> => {\n  const resolved = path.resolve(repoPath);\n  const storagePath =\n    resolvedStoragePath === undefined\n      ? getStoragePaths(resolved).storagePath\n      : validateConfiguredStoragePath(resolvedStoragePath);\n  const metaPath = path.join(storagePath, INDEX_METADATA_FILE);\n\n  try {\n    await fs.access(metaPath);\n  } catch {\n    throw new AnalysisNotFinalizedError(resolved, storagePath, 'meta', getGlobalRegistryPath());\n  }\n\n  const canonicalRepoPath = canonicalizePath(resolved);\n  const canonicalStoragePath = canonicalizePath(storagePath);\n  const registeredAtStoragePath = (await readRegistryStrict()).some(\n    (entry) =>\n      registryPathEquals(canonicalizePath(entry.path), canonicalRepoPath) &&\n      registryPathEquals(canonicalizePath(entry.storagePath), canonicalStoragePath),\n  );\n  if (!registeredAtStoragePath) {\n    throw new AnalysisNotFinalizedError(\n      resolved,\n      storagePath,\n      'registry-entry',\n      getGlobalRegistryPath(),\n    );\n  }\n};","sourceCodeStart":1451,"sourceCodeEnd":1487,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/storage/repo-manager.ts#L1451-L1487","documentation":"AnalysisNotFinalizedError with kind 'meta' means the index metadata file (INDEX_METADATA_FILE) could not be found at the selected storagePath, so the repository has no completed analysis receipt there. The manager throws rather than guessing, telling you where it looked and which registry it consulted.","triggerScenarios":"Calling a finalize/read path (e.g. ensureAnalysisFinalized) after fs.access on path.join(storagePath, INDEX_METADATA_FILE) fails — the metadata file does not exist at that storage directory.","commonSituations":"Running query/serve/register against a repo whose analyze never completed; the storage directory was moved or GITNEXUS_STORAGE_PATH points at the wrong slot; the repo was analyzed with a different storage configuration than the current one; the .gitnexus directory was deleted or cleaned.","solutions":["Run `gitnexus analyze` (optionally with the same storagePath) to produce the metadata file.","Verify storagePath / GITNEXUS_STORAGE_PATH points at the directory where analysis actually ran.","Re-analyze if a previous run was interrupted before finalization.","Check the registry path in the message to confirm you are consulting the expected registry."],"exampleFix":"// before\nawait readIndex(repo); // no meta at /wrong/slot\n// after\nawait analyze({ repo, storagePath: \"/wrong/slot\" });\nawait readIndex(repo);","handlingStrategy":"validation","validationCode":"import { access } from \"fs/promises\";\ntry {\n  await access(path.join(storagePath, \"index-meta.json\"));\n} catch {\n  await analyze({ repoPath, storagePath }); // finalize analysis before consuming\n}","typeGuard":null,"tryCatchPattern":"try {\n  await readIndex(repoPath, { storagePath });\n} catch (err) {\n  if (err instanceof AnalysisNotFinalizedError && err.kind === \"meta\") {\n    await analyze({ repoPath, storagePath });\n    await readIndex(repoPath, { storagePath });\n  } else throw err;\n}","preventionTips":["Always run analyze before query/serve/register on a repo.","Verify GITNEXUS_STORAGE_PATH points at the slot used during analysis.","Don't delete .gitnexus or the external slot while the repo is registered.","Check interrupted analyze runs and re-run them."],"tags":["analysis","metadata","file-not-found","storage"],"backgroundTag":"file-not-found","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"}