{"record":{"id":"0e2881c398b35eab","repo":"facebook/flow","slug":"failed-to-find-shasum256-txt-line-containing-flo","errorCode":null,"errorMessage":"Failed to find SHASUM256.txt line containing ${flowBinRelativePath}","messagePattern":"Failed to find SHASUM256\\.txt line containing (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts","lineNumber":98,"sourceCode":"  } catch (err: any) {\n    logger.info(`Unable to verify SHASUM256.txt.sign:\\n${err.message}`);\n    return readFile(path.join(extensionPath, 'PAST_FLOW_BIN_SHASUMS.txt'));\n  }\n}\n\nfunction getShasum(\n  shasums: string,\n  flowBinDirName: string,\n  flowBinName: string,\n): string {\n  const flowBinRelativePath = `${flowBinDirName}/${flowBinName}`;\n  // eslint-disable-next-line require-unicode-regexp\n  const shasumLines = shasums.split(/\\r?\\n/);\n  const shasumLine = shasumLines.find((line) =>\n    line.includes(flowBinRelativePath),\n  );\n  if (!shasumLine) {\n    throw new Error(\n      `Failed to find SHASUM256.txt line containing ${flowBinRelativePath}`,\n    );\n  }\n  return shasumLine.slice(0, 64);\n}\n\nexport default async function getVerifiedFlowBinPath(\n  flowBinModulePath: string,\n  logger: Logger,\n): Promise<string> {\n  await access(flowBinModulePath);\n  try {\n    const shasums = await getShasums(flowBinModulePath, logger);\n\n    // successfully verified SHASUM256.txt, now we can use it to verify the flow binary\n    const { flowBinDirName, flowBinName } =\n      await getFlowBinRelativePath(flowBinModulePath);\n    const flowBinPath = path.join(","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/facebook/flow/blob/d1341dac899a79c027762f6b423d896045287620/packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts#L80-L116","documentation":"With a checksums file loaded, getShasum searches it for a line containing `<platformDir>/<binaryName>` (e.g. flow-linux64-v0.230.0/flow). If no line mentions that exact relative path it throws — the shasums file does not cover the found binary.","triggerScenarios":"flow-bin's SHASUM256.txt (or the PAST_FLOW_BIN_SHASUMS.txt fallback) has no entry for the platform dir + binary present on disk — version skew between the binary dir and the checksums file, or a manually substituted binary.","commonSituations":"Mixed-version installs where the platform dir was copied from another flow-bin version; hand-patched node_modules; the fallback file not covering newer binaries.","solutions":["Reinstall flow-bin cleanly so dir and checksums ship together: `npm ci` or remove node_modules/flow-bin and reinstall","Pin exact matching versions of the extension and flow-bin","If you package flow-bin yourself, include a SHASUM256.txt line for every platform dir you ship"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function shasumHasEntry(\n  shasums: string,\n  flowBinDirName: string,\n  flowBinName: string,\n): boolean {\n  const rel = `${flowBinDirName}/${flowBinName}`;\n  return shasums\n    .split(/\\r?\\n/)\n    .some((line) => line.includes(rel));\n}","typeGuard":null,"tryCatchPattern":"try {\n  const shasum = getShasum(shasums.toString(), dirName, binName);\n} catch (err) {\n  if (/Failed to find SHASUM256.txt line/.test(err.message)) {\n    // dir/checksums version skew: reinstall flow-bin cleanly\n  } else throw err;\n}","preventionTips":["Never mix platform dirs from different flow-bin versions","Use npm ci for reproducible installs","Cover every shipped platform dir in SHASUM256.txt if you repackage flow-bin"],"tags":["flow-bin","shasum","checksum","verification"],"backgroundTag":"checksum-missing-entry","analyzedSha":"d1341dac899a79c027762f6b423d896045287620","analyzedAt":"2026-08-17T00:07:02.212Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}