{"record":{"id":"3dc671e6d73d9ec7","repo":"Hmbown/CodeWhale","slug":"checksum-manifest-is-missing-assetname","errorCode":null,"errorMessage":"Checksum manifest is missing ${assetName}","messagePattern":"Checksum manifest is missing (.+?)","errorType":"exception","errorClass":"NonRetryableError","httpStatus":null,"severity":"error","filePath":"npm/codewhale/scripts/install.js","lineNumber":1195,"sourceCode":"    const from = sourceLabel ? ` from ${sourceLabel}` : \"\";\n    throw new NonRetryableError(`Checksum manifest is missing ${assetName}${from}`);\n  }\n  const actual = await sha256File(filePath);\n  if (actual !== expected) {\n    // Bytes are corrupted; another fetch is unlikely to help without a fix\n    // upstream. Mark non-retryable. Never mix a locked source's bytes with\n    // another source's manifest.\n    const from = sourceLabel ? ` from ${sourceLabel}` : \"\";\n    throw new NonRetryableError(\n      `Checksum mismatch for ${assetName}${from}: expected ${expected}, got ${actual}`,\n    );\n  }\n}\n\nasync function checksumMatches(filePath, assetName, checksums) {\n  const expected = checksums.get(assetName);\n  if (!expected) {\n    throw new NonRetryableError(`Checksum manifest is missing ${assetName}`);\n  }\n  const actual = await sha256File(filePath);\n  return actual === expected;\n}\n\nfunction formatSourceReceipt(source, version) {\n  return [\n    `source=${source.id}`,\n    `label=${source.label}`,\n    `base=${source.baseUrl}`,\n    `version=${version}`,\n    \"\",\n  ].join(\"\\n\");\n}\n\nasync function writeSourceReceipt(targetPath, source, version) {\n  await writeFile(`${targetPath}.source`, formatSourceReceipt(source, version), \"utf8\");\n}","sourceCodeStart":1177,"sourceCodeEnd":1213,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/npm/codewhale/scripts/install.js#L1177-L1213","documentation":"`checksumMatches` is the boolean (non-throwing for mismatch) variant used for probing; but like `verifyChecksum` it still requires the asset to exist in the manifest and throws this NonRetryableError when the asset name has no digest entry. It cannot return false for a missing entry because 'missing' and 'mismatch' are treated as distinct conditions.","triggerScenarios":"Calling `checksumMatches(filePath, assetName, checksums)` with an assetName key not present in the parsed manifest map.","commonSituations":"Comparing a differently named asset (e.g. with/without a version prefix or .tar.gz suffix) against the manifest; calling the probe with a checksums map parsed from the wrong release.","solutions":["Confirm the exact asset key by printing `Array.from(checksums.keys())` and use an exact matching name.","Parse the manifest from the same release the asset was downloaded from.","Normalize the asset name (strip/append version or extension) to match the manifest entries."],"exampleFix":"// before\nconst ok = await checksumMatches(file, \"codewhale-linux\", checksums);\n// after\nconst ok = await checksumMatches(file, \"codewhale-linux-x64.tar.gz\", checksums);","handlingStrategy":"validation","validationCode":"if (!checksums.has(assetName)) {\n  throw new Error(`Key ${assetName} not in manifest; available: ${[...checksums.keys()].join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exact manifest key names (print checksums.keys() to confirm).","Parse the manifest from the same release as the downloaded asset.","Wrap checksumMatches calls with a has() check."],"tags":["npm","installer","checksum","manifest","lookup"],"backgroundTag":"checksum-mismatch","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}