{"record":{"id":"dd69d46ddf7783a9","repo":"Hmbown/CodeWhale","slug":"downloaded-release-artifacts-are-missing-name-at-source","errorCode":null,"errorMessage":"Downloaded release artifacts are missing ${name} at ${source}","messagePattern":"Downloaded release artifacts are missing (.+?) at (.+?)","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/release/assemble-release-assets.js","lineNumber":130,"sourceCode":"  if (name === BUNDLE_CHECKSUM_MANIFEST || BUNDLE_ASSET_NAMES.includes(name)) {\n    return path.join(inputDirectory, \"codewhale-bundles\", name);\n  }\n  return path.join(inputDirectory, name, name);\n}\n\nasync function assemble(inputDirectory, outputDirectory) {\n  const expected = allReleaseAssetNames();\n  const generated = new Set([WINDOWS_LAUNCHER, CHECKSUM_MANIFEST]);\n  const copiedNames = expected.filter((name) => !generated.has(name));\n  const sources = new Map();\n  for (const name of copiedNames) {\n    const source = intermediateArtifactPath(inputDirectory, name);\n    let sourceStat;\n    try {\n      sourceStat = await fs.lstat(source);\n    } catch (error) {\n      if (error && error.code === \"ENOENT\") {\n        throw new Error(`Downloaded release artifacts are missing ${name} at ${source}`);\n      }\n      throw error;\n    }\n    if (!sourceStat.isFile()) {\n      throw new Error(`Downloaded release artifact must be a regular file: ${source}`);\n    }\n    sources.set(name, source);\n  }\n\n  await fs.mkdir(outputDirectory, { recursive: true });\n  const existing = await fs.readdir(outputDirectory);\n  if (existing.length > 0) {\n    throw new Error(`Output directory must be empty: ${outputDirectory}`);\n  }\n\n  for (const name of copiedNames) {\n    await fs.copyFile(sources.get(name), path.join(outputDirectory, name));\n  }","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/release/assemble-release-assets.js#L112-L148","documentation":"assemble walks the expected release asset names and lstat()s each intermediate artifact at its expected source path. When lstat fails with ENOENT (the file does not exist), it rethrows this Error identifying which asset is missing and where it was expected, instead of surfacing the raw ENOENT.","triggerScenarios":"Calling assemble with an inputDirectory that does not contain one of the expected asset files, e.g. an incomplete download set or a wrong --input path.","commonSituations":"A CI download step failed or partially completed, the artifact was renamed upstream, or the input directory path is misconfigured in the release job.","solutions":["Re-run the artifact download step so every expected asset lands in the input directory.","Check the input directory path passed to assemble is the one the downloader wrote to.","Verify the asset name in the message against what the build actually produced; align names if the upstream artifact was renamed."],"exampleFix":"// before\nnode assemble-release-assets.js --input ./empty-dir ...\n// after\nnode assemble-release-assets.js --input ./downloaded-assets  # contains all expected assets","handlingStrategy":"validation","validationCode":"for (const name of allReleaseAssetNames()) {\n  try { await fs.access(path.join(inputDir, name)); }\n  catch { throw new Error(`missing ${name} in ${inputDir}`); }\n}","typeGuard":null,"tryCatchPattern":"try { await assemble(...); } catch (e) { if (String(e.message).startsWith('Downloaded release artifacts are missing')) { console.error('Re-run the download step:', e.message); process.exitCode = 1; } else throw e; }","preventionTips":["Verify the download step completed (count files) before assembling.","Fail the download job loudly on partial completion.","Keep the input directory path in one shared config for download and assemble."],"tags":["release","file-not-found","ci"],"backgroundTag":"file-not-found","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"}