github/copilot-sdk · error
failed to write runtime.node
Error message
failed to write runtime.node: %w
What it means
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.
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.
Example fix
// before # CI artifact dir quota 1GB, runtime.node.zst ~1.2GB // after # raise quota or write to workspace volume bundler --output $GITHUB_WORKSPACE/dist
Defensive patterns
Strategy: try-catch
Validate before calling
if err := os.MkdirAll(filepath.Dir(runtimeArtifactPath), 0o755); err != nil {
return fmt.Errorf("artifact dir not creatable: %w", err)
}
probe := runtimeArtifactPath + ".probe"
if err := os.WriteFile(probe, []byte("x"), 0o644); err != nil {
return fmt.Errorf("artifact path not writable: %w", err)
}
os.Remove(probe) Type guard
func canWriteTo(dir string) bool {
f, err := os.CreateTemp(dir, ".probe*")
if err != nil {
return false
}
f.Close()
os.Remove(f.Name())
return true
} Try / catch
if err := buildBundle(...); err != nil {
if strings.Contains(err.Error(), "failed to write runtime.node") {
var pe *fs.PathError
if errors.As(err, &pe) && errors.Is(err, syscall.ENOSPC) {
log.Error("output volume full while writing runtime.node artifact")
}
return err
}
return err
} Prevention
- 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.
When it happens
Trigger: compressZstdFile(rawLibPath, runtimeArtifactPath) errors: destination artifact path not writable, disk full, or source runtime.node unreadable.
Common situations: Output volume running out of space (runtime.node addons are large), read-only container output mounts, or quota limits on the output directory.
Understand the failure class
Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.
Related errors
- failed to write output binary
- failed to write runtime wrapper
- failed to extract binary
- failed to extract binary
- failed to extract license: copy error
AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09).
Data as JSON: /api/errors/cb889f40b5674445.
Report an issue: GitHub.
Appendix: source
Thrown at go/cmd/bundler/main.go:478
if err := compressZstdFile(binaryPath, outputPath); err != nil {
return bundleArtifacts{}, fmt.Errorf("failed to write output binary: %w", err)
}
rawLibPath := filepath.Join(tempDir, "runtime.node")
if err := extractFileFromTarball(
tarballPath,
tempDir,
"package/prebuilds/"+info.runtimePlatform+"/runtime.node",
"runtime.node",
); err != nil {
return bundleArtifacts{}, fmt.Errorf("runtime package is missing prebuilds/%s/runtime.node: %w", info.runtimePlatform, err)
}
runtimeHash, err := sha256File(rawLibPath)
if err != nil {
return bundleArtifacts{}, fmt.Errorf("failed to hash runtime.node: %w", err)
}
if err := compressZstdFile(rawLibPath, runtimeArtifactPath); err != nil {
return bundleArtifacts{}, fmt.Errorf("failed to write runtime.node: %w", err)
}
wrapperName := runtimeWrapperName(info.binaryName)
rawWrapperPath := filepath.Join(tempDir, wrapperName)
if err := extractFileFromTarball(
tarballPath,
tempDir,
"package/prebuilds/"+info.runtimePlatform+"/"+wrapperName,
wrapperName,
); err != nil {
return bundleArtifacts{}, fmt.Errorf("runtime package is missing prebuilds/%s/%s: %w", info.runtimePlatform, wrapperName, err)
}
wrapperHash, err := sha256File(rawWrapperPath)
if err != nil {
return bundleArtifacts{}, fmt.Errorf("failed to hash runtime wrapper: %w", err)
}
if err := compressZstdFile(rawWrapperPath, wrapperArtifactPath); err != nil {
return bundleArtifacts{}, fmt.Errorf("failed to write runtime wrapper: %w", err)View on GitHub (pinned to cd8cf15dc3)