{"record":{"id":"cb889f40b5674445","repo":"github/copilot-sdk","slug":"failed-to-write-runtime-node-w","errorCode":null,"errorMessage":"failed to write runtime.node: %w","messagePattern":"failed to write runtime\\.node: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/cmd/bundler/main.go","lineNumber":478,"sourceCode":"\tif err := compressZstdFile(binaryPath, outputPath); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to write output binary: %w\", err)\n\t}\n\n\trawLibPath := filepath.Join(tempDir, \"runtime.node\")\n\tif err := extractFileFromTarball(\n\t\ttarballPath,\n\t\ttempDir,\n\t\t\"package/prebuilds/\"+info.runtimePlatform+\"/runtime.node\",\n\t\t\"runtime.node\",\n\t); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"runtime package is missing prebuilds/%s/runtime.node: %w\", info.runtimePlatform, err)\n\t}\n\truntimeHash, err := sha256File(rawLibPath)\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash runtime.node: %w\", err)\n\t}\n\tif err := compressZstdFile(rawLibPath, runtimeArtifactPath); err != nil {\n\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)","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/cmd/bundler/main.go#L460-L496","documentation":"buildBundle compresses the extracted runtime.node with Zstandard into its bundle artifact via compressZstdFile. A failure reading the source addon or creating/writing the .zst artifact is wrapped with this message and aborts the bundle.","triggerScenarios":"compressZstdFile(rawLibPath, runtimeArtifactPath) errors: destination artifact path not writable, disk full, or source runtime.node unreadable.","commonSituations":"Output volume running out of space (runtime.node addons are large), read-only container output mounts, or quota limits on the output directory.","solutions":["Free space on the output volume or choose an --output location with sufficient capacity.","Confirm the output directory and artifact path are writable by the build user.","Check for volume quotas or small tmpfs mounts and move the output to persistent storage.","Re-run the build to clear transient I/O failures."],"exampleFix":"// before\n# CI artifact dir quota 1GB, runtime.node.zst ~1.2GB\n\n// after\n# raise quota or write to workspace volume\nbundler --output $GITHUB_WORKSPACE/dist","handlingStrategy":"try-catch","validationCode":"if err := os.MkdirAll(filepath.Dir(runtimeArtifactPath), 0o755); err != nil {\n\treturn fmt.Errorf(\"artifact dir not creatable: %w\", err)\n}\nprobe := runtimeArtifactPath + \".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.node\") {\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 runtime.node artifact\")\n\t\t}\n\t\treturn err\n\t}\n\treturn err\n}","preventionTips":["Ensure free space >= uncompressed runtime.node size on the output volume before building.","Avoid quota-limited artifact directories for large native artifacts.","Pre-create the artifact directory with correct ownership.","Retry transient write failures once before failing the CI job."],"tags":["zstd","compression","disk-full","native-addon"],"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"}