{"record":{"id":"1a9876435cf510f7","repo":"netbirdio/netbird","slug":"add-readme-w","errorCode":null,"errorMessage":"add readme: %w","messagePattern":"add readme: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/internal/debug/debug.go","lineNumber":415,"sourceCode":"\t\t}\n\t}()\n\n\tg.archive = zip.NewWriter(bundlePath)\n\n\tif err := g.createArchive(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := g.archive.Close(); err != nil {\n\t\treturn \"\", fmt.Errorf(\"close archive writer: %w\", err)\n\t}\n\n\treturn bundlePath.Name(), nil\n}\n\nfunc (g *BundleGenerator) createArchive() error {\n\tif err := g.addReadme(); err != nil {\n\t\treturn fmt.Errorf(\"add readme: %w\", err)\n\t}\n\n\tif err := g.addStatus(); err != nil {\n\t\treturn fmt.Errorf(\"add status: %w\", err)\n\t}\n\n\tif err := g.addConfig(); err != nil {\n\t\tlog.Errorf(\"failed to add config to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addResolvedDomains(); err != nil {\n\t\tlog.Errorf(\"failed to add resolved domains to debug bundle: %v\", err)\n\t}\n\n\tif g.includeSystemInfo {\n\t\tg.addSystemInfo()\n\t}\n","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/internal/debug/debug.go#L397-L433","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Go: surface the inner cause and retry after clearing space\nif err := gen.Generate(); err != nil && strings.Contains(err.Error(), \"add readme\") {\n    log.Printf(\"bundle write failed, likely temp disk full: %v\", err)\n    // free space, then retry once\n}","preventionTips":["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."],"tags":["go","netbird","zip","debug-bundle","disk-full","io"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}