netbirdio/netbird · error
add readme: %w
Error message
add readme: %w
What it means
Returned by BundleGenerator.createArchive in client/internal/debug/debug.go:415 when addReadme fails. addReadme only writes an in-memory header plus readmeContent via addFileToZip, so the failure is never about the content itself: it comes from g.archive.CreateHeader (creating the README.txt zip entry) or io.Copy into the zip entry, both of which bottom out in writes to the temp file from Generate. Because the readme is the first mandatory entry, this error aborts the whole bundle.
Source
Thrown at client/internal/debug/debug.go:415
}
}()
g.archive = zip.NewWriter(bundlePath)
if err := g.createArchive(); err != nil {
return "", err
}
if err := g.archive.Close(); err != nil {
return "", fmt.Errorf("close archive writer: %w", err)
}
return bundlePath.Name(), nil
}
func (g *BundleGenerator) createArchive() error {
if err := g.addReadme(); err != nil {
return fmt.Errorf("add readme: %w", err)
}
if err := g.addStatus(); err != nil {
return fmt.Errorf("add status: %w", err)
}
if err := g.addConfig(); err != nil {
log.Errorf("failed to add config to debug bundle: %v", err)
}
if err := g.addResolvedDomains(); err != nil {
log.Errorf("failed to add resolved domains to debug bundle: %v", err)
}
if g.includeSystemInfo {
g.addSystemInfo()
}
View on GitHub (pinned to 93e97f4bf1)
Solutions
- Free space on the temp filesystem (df -h /tmp and TMPDIR) and retry.
- Pass a writable TempDir with sufficient free space in BundleDeps when constructing the generator.
- Verify the daemon process can still write to its temp directory (it may have been deleted while the daemon was running).
Defensive patterns
Strategy: retry
Try / catch
// Go: surface the inner cause and retry after clearing space
if err := gen.Generate(); err != nil && strings.Contains(err.Error(), "add readme") {
log.Printf("bundle write failed, likely temp disk full: %v", err)
// free space, then retry once
} Prevention
- Ensure the temp filesystem has free space before bundle generation.
- Monitor disk usage on peers that produce frequent debug bundles.
- Treat any addReadme failure as environmental (I/O), not content-related.
When it happens
Trigger: Debug bundle generation with a failing write to the underlying temp file: ENOSPC on the temp filesystem, the temp file closed or deleted under the writer, or an I/O error on the device. Anything that fails at the very first entry surfaces here.
Common situations: Disk or tmpfs holding os.CreateTemp output is full; TMPDIR misconfigured; running inside a container with a small /tmp; daemon running since boot with stale TempDir.
Related errors
- close archive writer: %w
- add README file to zip: %w
- add status: %w
- add status file to zip: %w
- add sync response: %w
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/1a9876435cf510f7.
Report an issue: GitHub.