{"record":{"id":"c569bf8d77f113b2","repo":"github/copilot-sdk","slug":"reading-runtime-asset-q-w","errorCode":null,"errorMessage":"reading runtime asset %q: %w","messagePattern":"reading runtime asset %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/internal/embeddedcli/embeddedcli.go","lineNumber":401,"sourceCode":"\ttarReader := tar.NewReader(gzipReader)\n\tfor {\n\t\theader, err := tarReader.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading runtime assets: %w\", err)\n\t\t}\n\t\tif header.Typeflag != tar.TypeReg {\n\t\t\tcontinue\n\t\t}\n\t\tclean := filepath.Clean(filepath.FromSlash(header.Name))\n\t\tif !filepath.IsLocal(clean) {\n\t\t\treturn fmt.Errorf(\"unsafe runtime asset path %q\", header.Name)\n\t\t}\n\t\tcontent, err := io.ReadAll(tarReader)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading runtime asset %q: %w\", header.Name, err)\n\t\t}\n\t\tpath := filepath.Join(installDir, clean)\n\t\tif err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {\n\t\t\treturn fmt.Errorf(\"creating runtime asset directory: %w\", err)\n\t\t}\n\t\thash := sha256.Sum256(content)\n\t\tmode := os.FileMode(header.Mode & 0777)\n\t\tif err := installVerifiedFile(path, bytes.NewReader(content), hash[:], mode, \"runtime asset\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\truntimeAssetsInstalled = true\n\treturn nil\n}\n\nfunc validateRuntimePairConfig(wrapper io.Reader, wrapperHash []byte, node io.Reader, nodeHash []byte, prefix string) {\n\tif (wrapper == nil) != (node == nil) {\n\t\tpanic(prefix + \"RuntimeExecutable and \" + prefix + \"RuntimeNode must be provided together\")","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/internal/embeddedcli/embeddedcli.go#L383-L419","documentation":"installRuntimeAssets extracts an embedded tar archive of runtime assets into the install directory. This error wraps a failure while reading the bytes of one tar entry from the archive stream, meaning the embedded archive itself is corrupt or its reader failed mid-entry. The entry name is included to identify which asset failed.","triggerScenarios":"io.ReadAll(tarReader) returns an error while extracting a tar header named header.Name during installAt or installRuntimeAt; the underlying tar reader/pipe was broken or returned an I/O error.","commonSituations":"A truncated or corrupted embedded binary asset, an interrupted stream feeding the tar reader, or low-level I/O failure while decompressing the embedded archive.","solutions":["Verify the build produced a complete, uncorrupted embedded asset archive (rebuild the project so go:embed picks up intact files).","Check disk space and I/O health on the machine performing the extraction.","Retry the install; if reproducible, report the corrupted archive to the library maintainers."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := client.InstallAt(dir); err != nil {\n    if strings.Contains(err.Error(), \"reading runtime asset\") {\n        // embedded archive corrupt: rebuild/reinstall the binary and retry\n    }\n}","preventionTips":["Rebuild releases with verified embedded assets","Monitor disk space on install hosts"],"tags":["tar","io","embedded-assets"],"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-17T15:17:12.973Z"}