{"record":{"id":"525e0e65dd229af2","repo":"github/copilot-sdk","slug":"failed-to-hash-existing-runtime-assets-w","errorCode":null,"errorMessage":"failed to hash existing runtime assets: %w","messagePattern":"failed to hash existing runtime assets: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/cmd/bundler/main.go","lineNumber":428,"sourceCode":"\n\tif filesExist(requiredPaths...) {\n\t\t// Idempotent output avoids re-downloading in CI or local rebuilds.\n\t\tfmt.Printf(\"Output runtime bundle for %s already exists, skipping download\\n\", info.runtimePlatform)\n\t\tbinaryHash, err := sha256FileFromCompressed(outputPath)\n\t\tif err != nil {\n\t\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash existing output: %w\", err)\n\t\t}\n\t\truntimeHash, err := sha256FileFromCompressed(runtimeArtifactPath)\n\t\tif err != nil {\n\t\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash existing runtime.node: %w\", err)\n\t\t}\n\t\twrapperHash, err := sha256FileFromCompressed(wrapperArtifactPath)\n\t\tif err != nil {\n\t\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash existing runtime wrapper: %w\", err)\n\t\t}\n\t\tassetsHash, err := sha256File(assetsArtifactPath)\n\t\tif err != nil {\n\t\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash existing runtime assets: %w\", err)\n\t\t}\n\t\treturn bundleArtifacts{outputPath, binaryHash, runtimeArtifactPath, runtimeHash, wrapperArtifactPath, wrapperHash, assetsArtifactPath, assetsHash}, nil\n\t}\n\n\t// Create temp directory for download\n\ttempDir, err := os.MkdirTemp(\"\", \"copilot-bundler-*\")\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to create temp dir: %w\", err)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\tbinaryPath, tarballPath, err := downloadCLIBinary(info.runtimePlatform, info.binaryName, cliVersion, tempDir)\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to download CLI binary: %w\", err)\n\t}\n\n\tif outputDir != \".\" {\n\t\tif err := os.MkdirAll(outputDir, 0755); err != nil {","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/cmd/bundler/main.go#L410-L446","documentation":"In the skip-existing path, the runtime assets artifact is hashed with sha256File (uncompressed, unlike the others); failure to read it aborts the build. Without all four hashes the bundler cannot return valid bundleArtifacts, so it fails fast.","triggerScenarios":"sha256File(assetsArtifactPath) errors after filesExist reported the paths present — assets file deleted concurrently, permission denied, or unreadable/corrupt content from a prior partial run.","commonSituations":"Output directory partially cleaned by another job between runs; assets file corrupted by an interrupted previous build; restrictive umask or ownership change; output on a full/unstable disk.","solutions":["Delete the stale assets artifact and rerun to re-download everything.","Check permissions and ownership of assetsArtifactPath.","Prevent concurrent jobs from cleaning the output directory mid-build.","Check disk space and filesystem health.","Keep all four artifacts together — never prune selectively."],"exampleFix":"// before\nassetsHash, err := sha256File(assetsArtifactPath)\nif err != nil {\n\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash existing runtime assets: %w\", err)\n}\n// after\nassetsHash, err := sha256File(assetsArtifactPath)\nif err != nil {\n\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash existing runtime assets at %s: %w\", assetsArtifactPath, err)\n}","handlingStrategy":"try-catch","validationCode":"f, err := os.Open(assetsArtifactPath)\nif err != nil {\n\treturn fmt.Errorf(\"assets artifact unreadable: %w\", err)\n}\nf.Close()","typeGuard":null,"tryCatchPattern":"artifacts, err := buildBundle(...)\nif err != nil && strings.Contains(err.Error(), \"runtime assets\") {\n\tos.RemoveAll(outputDir)\n\tartifacts, err = buildBundle(...) // rebuild from scratch\n}","preventionTips":["Keep all bundle artifacts in one directory pruned atomically.","Monitor disk space; sha256File fails on full disks.","Verify umask/ownership in CI before caching artifacts.","Detect zero-length assets from interrupted runs and rebuild."],"tags":["file-io","hashing","sha256","cache"],"backgroundTag":"file-read-failed","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}