{"record":{"id":"0972d676b42f335e","repo":"netbirdio/netbird","slug":"failed-to-get-status-v","errorCode":null,"errorMessage":"failed to get status: %v","messagePattern":"failed to get status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/debug.go","lineNumber":257,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\n\tconn, err := getClient(cmd)\n\tif err != nil {\n\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\tclient := proto.NewDaemonServiceClient(conn)\n\n\tstat, err := client.Status(cmd.Context(), &proto.StatusRequest{ShouldRunProbes: true})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get status: %v\", status.Convert(err).Message())\n\t}\n\n\tstateWasDown := stat.Status != string(internal.StatusConnected) && stat.Status != string(internal.StatusConnecting)\n\n\tinitialLogLevel, err := client.GetLogLevel(cmd.Context(), &proto.GetLogLevelRequest{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get log level: %v\", status.Convert(err).Message())\n\t}\n\n\tif stateWasDown {\n\t\tif _, err := client.Up(cmd.Context(), &proto.UpRequest{}); err != nil {\n\t\t\tcmd.PrintErrf(\"Failed to bring service up: %v\\n\", status.Convert(err).Message())\n\t\t} else {\n\t\t\tcmd.Println(\"netbird up\")\n\t\t\ttime.Sleep(time.Second * 10)\n\t\t}\n\t}\n","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/debug.go#L239-L275","documentation":"Raised by the `netbird debug for <duration>` command (runForDuration) when its first daemon RPC, client.Status with ShouldRunProbes:true, returns a gRPC error. The CLI dials the daemon's IPC channel (unix socket / Windows named pipe / loopback TCP via getClient), and surfaces only the gRPC status message via status.Convert(err).Message(). It indicates the CLI-to-daemon RPC failed, not that the peer's connectivity state is bad.","triggerScenarios":"Calling netbird debug for <duration> while the daemon process is not running or the socket is absent; the daemon crashes or restarts between the dial and the Status call; the caller lacks permission on the socket; a custom --daemon-addr points at an address nothing serves; the command context is canceled (Ctrl+C) before the RPC completes.","commonSituations":"Running the debug command right after boot before the netbird service has started; after `netbird service uninstall`; daemon crash-looping (check its logs); hardened environments where the invoking user cannot access /var/run/netbird.sock; CI containers that have the CLI but not the service.","solutions":["Verify the daemon is up: `netbird status` (if that fails too, the daemon is down) or `systemctl status netbird` / Windows `sc query netbird`; start or restart it, then re-run","Inspect daemon logs (/var/log/netbird/client.log or `journalctl -u netbird`) for a crash or restart loop and fix the cause there","If --daemon-addr / NB_DAEMON_ADDR is set, confirm it matches the address the daemon actually serves, or drop the flag to use the default","Re-run the command; because the failure happens before any state change, no cleanup of the overlay is needed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# run before the debug command: fail fast if the daemon is unreachable\nnetbird status >/dev/null 2>&1 || { echo \"netbird daemon is not responding; start it first\"; exit 1; }\nnetbird debug for 5m","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Start or verify the netbird service before any `netbird debug` subcommand (`systemctl is-active netbird`)","Keep CLI and daemon binaries from the same release so all daemon RPCs exist","Run debug commands as the same user/privilege that normally operates the CLI so the daemon socket is accessible","Avoid Ctrl+C during the command; each debug step depends on the previous RPC having completed"],"tags":["grpc","daemon","ipc","netbird-cli","debug"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}