{"record":{"id":"0a1439300daafac3","repo":"github/copilot-sdk","slug":"failed-to-write-runtime-wrapper-w","errorCode":null,"errorMessage":"failed to write runtime wrapper: %w","messagePattern":"failed to write runtime wrapper: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/cmd/bundler/main.go","lineNumber":496,"sourceCode":"\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to write runtime.node: %w\", err)\n\t}\n\n\twrapperName := runtimeWrapperName(info.binaryName)\n\trawWrapperPath := filepath.Join(tempDir, wrapperName)\n\tif err := extractFileFromTarball(\n\t\ttarballPath,\n\t\ttempDir,\n\t\t\"package/prebuilds/\"+info.runtimePlatform+\"/\"+wrapperName,\n\t\twrapperName,\n\t); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"runtime package is missing prebuilds/%s/%s: %w\", info.runtimePlatform, wrapperName, err)\n\t}\n\twrapperHash, err := sha256File(rawWrapperPath)\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash runtime wrapper: %w\", err)\n\t}\n\tif err := compressZstdFile(rawWrapperPath, wrapperArtifactPath); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to write runtime wrapper: %w\", err)\n\t}\n\tif err := createRuntimeAssetsArchive(tarballPath, assetsArtifactPath, info); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to write runtime assets: %w\", err)\n\t}\n\tassetsHash, err := sha256File(assetsArtifactPath)\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash runtime assets: %w\", err)\n\t}\n\n\tfmt.Printf(\"Successfully created %s\\n\", outputPath)\n\tfmt.Printf(\"Successfully created %s\\n\", runtimeArtifactPath)\n\tfmt.Printf(\"Successfully created %s\\n\", wrapperArtifactPath)\n\tfmt.Printf(\"Successfully created %s\\n\", assetsArtifactPath)\n\treturn bundleArtifacts{outputPath, binaryHash, runtimeArtifactPath, runtimeHash, wrapperArtifactPath, wrapperHash, assetsArtifactPath, assetsHash}, nil\n}\n\nfunc filesExist(paths ...string) bool {\n\tfor _, path := range paths {","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/cmd/bundler/main.go#L478-L514","documentation":"buildBundle compresses the extracted runtime wrapper into its bundle artifact with Zstandard via compressZstdFile. Failure to read the wrapper or to create/write the compressed artifact is wrapped with this message and stops the bundle. This is the last artifact step before the assets archive.","triggerScenarios":"compressZstdFile(rawWrapperPath, wrapperArtifactPath) errors: artifact path unwritable (permissions/read-only mount), disk full, or source wrapper unreadable.","commonSituations":"Output volume out of space in CI, read-only output mounts in containers, or quota-limited artifact directories.","solutions":["Free space on the output volume or redirect --output to storage with enough headroom.","Ensure the output directory is writable by the build user; pre-create and chown as needed.","Check mount flags (ro) and quotas on the destination filesystem.","Re-run the build; transient write errors may clear on retry."],"exampleFix":"// before\nbundler --output /mnt/ro-volume/dist\n# read-only filesystem\n\n// after\nbundler --output /mnt/rw-volume/dist","handlingStrategy":"try-catch","validationCode":"if err := os.MkdirAll(filepath.Dir(wrapperArtifactPath), 0o755); err != nil {\n\treturn fmt.Errorf(\"artifact dir not creatable: %w\", err)\n}\nprobe := wrapperArtifactPath + \".probe\"\nif err := os.WriteFile(probe, []byte(\"x\"), 0o644); err != nil {\n\treturn fmt.Errorf(\"artifact path not writable: %w\", err)\n}\nos.Remove(probe)","typeGuard":"func canWriteTo(dir string) bool {\n\tf, err := os.CreateTemp(dir, \".probe*\")\n\tif err != nil {\n\t\treturn false\n\t}\n\tf.Close()\n\tos.Remove(f.Name())\n\treturn true\n}","tryCatchPattern":"if err := buildBundle(...); err != nil {\n\tif strings.Contains(err.Error(), \"failed to write runtime wrapper\") {\n\t\tvar pe *fs.PathError\n\t\tif errors.As(err, &pe) && errors.Is(err, syscall.ENOSPC) {\n\t\t\tlog.Error(\"output volume full while writing wrapper artifact\")\n\t\t}\n\t\treturn err\n\t}\n\treturn err\n}","preventionTips":["Confirm writable, unmounted-ro output storage before starting the bundle.","Reserve disk space for all artifacts (binary + runtime + wrapper + assets) up front.","Avoid quota-limited CI artifact directories for native bundles.","Retry once on transient write errors before failing the job."],"tags":["zstd","compression","wrapper","disk-full"],"backgroundTag":"file-write-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"}