{"record":{"id":"92ec6fc1ed5bc014","repo":"netbirdio/netbird","slug":"failed-to-set-sync-response-persistence-v","errorCode":null,"errorMessage":"failed to set sync response persistence: %v","messagePattern":"failed to set sync response persistence: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/debug.go","lineNumber":455,"sourceCode":"\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err := conn.Close(); err != nil {\n\t\t\tlog.Errorf(errCloseConnection, err)\n\t\t}\n\t}()\n\n\tpersistence := strings.ToLower(args[0])\n\tif persistence != \"on\" && persistence != \"off\" {\n\t\treturn fmt.Errorf(\"invalid persistence value: %s. Use 'on' or 'off'\", args[0])\n\t}\n\n\tclient := proto.NewDaemonServiceClient(conn)\n\t_, err = client.SetSyncResponsePersistence(cmd.Context(), &proto.SetSyncResponsePersistenceRequest{\n\t\tEnabled: persistence == \"on\",\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to set sync response persistence: %v\", status.Convert(err).Message())\n\t}\n\n\tcmd.Printf(\"Sync response persistence set to: %s\\n\", persistence)\n\treturn nil\n}\n\nfunc waitForDurationOrCancel(ctx context.Context, duration time.Duration, cmd *cobra.Command) error {\n\tticker := time.NewTicker(1 * time.Second)\n\tdefer ticker.Stop()\n\n\tstartTime := time.Now()\n\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/debug.go#L437-L473","documentation":"The SetSyncResponsePersistence RPC to the daemon failed during `netbird debug sync-response-persistence <on|off>`. The gRPC status message is surfaced verbatim. This RPC toggles whether the daemon keeps the last management sync response persisted for debugging.","triggerScenarios":"The daemon went down between the dial and the RPC; the daemon predates this RPC and returns Unimplemented; the daemon failed while writing the persisted state (disk full, read-only or corrupted state directory) and propagated that as a gRPC error.","commonSituations":"CLI newer than the installed daemon; the service restarting mid-command; a broken or read-only daemon state directory on the host.","solutions":["Confirm the daemon is healthy with `netbird status`; restart the service if needed and retry","Check that CLI and daemon versions match (`netbird version` vs the service version in `netbird status`); upgrade the older one","If the gRPC message mentions persistence or storage, inspect the daemon's state directory permissions/free space and its logs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"netbird status >/dev/null 2>&1 || { echo 'daemon down'; exit 1; }","typeGuard":null,"tryCatchPattern":"_, err := client.SetSyncResponsePersistence(ctx, &proto.SetSyncResponsePersistenceRequest{Enabled: enabled})\nif err != nil {\n\tswitch status.Code(err) {\n\tcase codes.Unimplemented:\n\t\treturn fmt.Errorf(\"daemon predates this RPC; upgrade the service: %w\", err)\n\tcase codes.Unavailable:\n\t\treturn fmt.Errorf(\"daemon unreachable; restart it and retry: %w\", err)\n\tdefault:\n\t\t// storage/persistence failures land here; check daemon logs for the state directory\n\t\treturn err\n\t}\n}","preventionTips":["Match CLI and daemon versions when using newer debug subcommands","Ensure the daemon state directory is writable and not full before toggling persistence","Retry once after a service restart before investigating deeper"],"tags":["grpc","daemon","persistence","netbird-cli","debug"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}