{"record":{"id":"30c58f081d433250","repo":"netbirdio/netbird","slug":"add-readme-file-to-zip-w","errorCode":null,"errorMessage":"add README file to zip: %w","messagePattern":"add README file to zip: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/internal/debug/debug.go","lineNumber":524,"sourceCode":"\tif err := g.addSysctls(); err != nil {\n\t\tlog.Errorf(\"failed to add sysctls to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addDNSInfo(); err != nil {\n\t\tlog.Errorf(\"failed to add DNS info to debug bundle: %v\", err)\n\t}\n}\n\nfunc (g *BundleGenerator) addReadme() error {\n\tlevel := \"none (anonymization disabled)\"\n\tif g.anonymize {\n\t\tlevel = g.anonymizeLevel.String()\n\t}\n\theader := fmt.Sprintf(\"Netbird debug bundle\\nAnonymization level applied to this bundle: %s\\n\", level)\n\n\treadmeReader := strings.NewReader(header + readmeContent)\n\tif err := g.addFileToZip(readmeReader, \"README.txt\"); err != nil {\n\t\treturn fmt.Errorf(\"add README file to zip: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (g *BundleGenerator) addStatus() error {\n\tif g.statusRecorder != nil {\n\t\tpm := profilemanager.NewProfileManager()\n\t\tvar profName string\n\t\tif activeProf, err := pm.GetActiveProfile(); err == nil {\n\t\t\tprofName = activeProf.Name\n\t\t}\n\n\t\tif g.refreshStatus != nil {\n\t\t\tg.refreshStatus()\n\t\t}\n\n\t\tfullStatus := g.statusRecorder.GetFullStatus()\n\t\tprotoFullStatus := nbstatus.ToProtoFullStatus(fullStatus)","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/internal/debug/debug.go#L506-L542","documentation":"Returned by BundleGenerator.addReadme in client/internal/debug/debug.go:524 when addFileToZip fails for README.txt. addFileToZip fails either at g.archive.CreateHeader ('create zip file header: %w') or at io.Copy into the entry ('write file to zip: %w'). Since the readme is a strings.NewReader of static text, any failure is purely an I/O failure writing to the bundle temp file.","triggerScenarios":"Any condition where the zip writer cannot write to the os.CreateTemp file: ENOSPC, EROFS, closed file handle, or storage device error, hit while writing the first archive entry.","commonSituations":"Full /tmp or TMPDIR on the peer; ephemeral or size-limited temp dir in containers; daemon holding a stale temp directory path.","solutions":["Free space on the temp filesystem and retry the bundle.","Point BundleDeps.TempDir at a writable volume with capacity for logs plus the capture file.","Restart the daemon if its temp directory was removed while it was running, then retry."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Go: the readme is static text, so any failure is I/O\nif err := gen.Generate(); err != nil && strings.Contains(err.Error(), \"add README file to zip\") {\n    // check disk space on the temp volume, then retry","preventionTips":["Verify temp filesystem capacity before generating bundles.","Note the README comes from memory; no input sanitization is needed on your side."],"tags":["go","netbird","zip","debug-bundle","io","disk-full"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}