{"record":{"id":"8d38edf2b15c10c2","repo":"netbirdio/netbird","slug":"add-sync-response-w","errorCode":null,"errorMessage":"add sync response: %w","messagePattern":"add sync response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/internal/debug/debug.go","lineNumber":451,"sourceCode":"\n\tif err := g.addProf(); err != nil {\n\t\tlog.Errorf(\"failed to add profiles to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addCPUProfile(); err != nil {\n\t\tlog.Errorf(\"failed to add CPU profile to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addCaptureFile(); err != nil {\n\t\tlog.Errorf(\"failed to add capture file to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addStackTrace(); err != nil {\n\t\tlog.Errorf(\"failed to add stack trace to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addSyncResponse(); err != nil {\n\t\treturn fmt.Errorf(\"add sync response: %w\", err)\n\t}\n\n\tif err := g.addStateFile(); err != nil {\n\t\tlog.Errorf(\"failed to add state file to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addCorruptedStateFiles(); err != nil {\n\t\tlog.Errorf(\"failed to add corrupted state files to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addServiceParams(); err != nil {\n\t\tlog.Errorf(\"failed to add service params to debug bundle: %v\", err)\n\t}\n\n\tif err := g.addMetrics(); err != nil {\n\t\tlog.Errorf(\"failed to add metrics to debug bundle: %v\", err)\n\t}\n","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/internal/debug/debug.go#L433-L469","documentation":"Returned by BundleGenerator.createArchive in client/internal/debug/debug.go:451 when addSyncResponse fails. Unlike optional entries (config, resolved domains, capture, stack trace, state file) whose errors are only logged, a sync-response failure aborts the whole bundle. Inside addSyncResponse the error can come from anonymizeSyncResponse (when anonymization is on), protojson Marshal of the SyncResponse (network_map.json), or the zip write itself.","triggerScenarios":"Generating a debug bundle with anonymization enabled when anonymization of the network map errors, or when protojson fails to marshal the SyncResponse (e.g. invalid UTF-8 in a string field or an internally inconsistent message), or when the zip write of network_map.json hits an I/O error.","commonSituations":"Anonymized bundles on versions where the anonymizer or proto shapes are out of sync; a daemon/CLI version skew passing a SyncResponse the bundle code cannot marshal; low disk space during the network_map.json write.","solutions":["Regenerate the bundle with the same daemon and CLI version (version skew between CLI and daemon is the most common cause of marshal-stage failures).","Retry without anonymization (level none) to determine whether the failure is in anonymizeSyncResponse or in marshaling/zip writing.","Free space on the temp filesystem to rule out the zip-write path.","If it persists, collect the daemon debug log showing which inner error ('anonymize sync response', 'generate json', or 'add sync response to zip') was wrapped."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Go: pre-marshal the sync response before bundle generation to catch protojson issues\nif deps.SyncResponse != nil {\n    if _, err := (protojson.MarshalOptions{AllowPartial: true}).Marshal(deps.SyncResponse); err != nil {\n        deps.SyncResponse = nil // fall back to a bundle without network_map.json\n    }\n}","typeGuard":null,"tryCatchPattern":"// Go: degrade gracefully when the optional network map cannot be serialized\nif _, err := generator.Generate(); err != nil {\n    if strings.Contains(err.Error(), \"add sync response\") {\n        deps.SyncResponse = nil\n        generator = debug.NewBundleGenerator(cfg, deps)\n        _, err = generator.Generate() // bundle without network_map.json\n    }\n    if err != nil {\n        return err\n    }\n}","preventionTips":["Keep daemon and CLI versions aligned so protojson marshaling always matches.","Pre-validate the SyncResponse with protojson before handing it to the bundle generator.","Test anonymized bundles in CI to catch anonymizer/proto drift early."],"tags":["go","netbird","debug-bundle","sync-response","protojson","anonymization"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}