{"record":{"id":"2f2cd4dd72537a06","repo":"netbirdio/netbird","slug":"login-backoff-cycle-failed-v-2f2cd4","errorCode":null,"errorMessage":"login backoff cycle failed: %v","messagePattern":"login backoff cycle failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/up.go","lineNumber":378,"sourceCode":"\t}\n\n\tvar loginErr error\n\tvar loginResp *proto.LoginResponse\n\n\terr = WithBackOff(func() error {\n\t\tvar backOffErr error\n\t\tloginResp, backOffErr = client.Login(ctx, loginRequest)\n\t\tif s, ok := gstatus.FromError(backOffErr); ok && (s.Code() == codes.InvalidArgument ||\n\t\t\ts.Code() == codes.PermissionDenied ||\n\t\t\ts.Code() == codes.NotFound ||\n\t\t\ts.Code() == codes.Unimplemented) {\n\t\t\tloginErr = backOffErr\n\t\t\treturn nil\n\t\t}\n\t\treturn backOffErr\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"login backoff cycle failed: %v\", err)\n\t}\n\n\tif loginErr != nil {\n\t\treturn daemonCallError(\"login failed\", loginErr)\n\t}\n\n\tif loginResp.NeedsSSOLogin {\n\t\tif err := handleSSOLogin(ctx, cmd, loginResp, client, pm); err != nil {\n\t\t\treturn fmt.Errorf(\"sso login failed: %v\", err)\n\t\t}\n\t}\n\n\tif _, err := client.Up(ctx, &proto.UpRequest{\n\t\tProfileName: &profileID,\n\t\tUsername:    &username,\n\t}); err != nil {\n\t\treturn daemonCallError(\"call service up method\", err)\n\t}","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/up.go#L360-L396","documentation":"The Login RPC is executed inside a backoff retry loop. Permanent gRPC codes (InvalidArgument, PermissionDenied, NotFound, Unimplemented) break out immediately as loginErr; every other error (typically Unavailable, DeadlineExceeded) is retried with backoff. This message appears only when the loop itself ended with an error that was not one of those permanent codes — i.e. retries were exhausted or a non-permanent failure kept recurring.","triggerScenarios":"Management service unreachable for the whole backoff window (wrong host/DNS, firewall, TLS failure); daemon lost connection to the CLI mid-login; context canceled (Ctrl+C) during retrying; management returning codes outside the permanent list.","commonSituations":"Typo in --management-url, management server down during maintenance, self-hosted management with an expired cert, captive networks blocking gRPC, or the user aborting while it retries.","solutions":["Check that the daemon can reach management: verify the management URL, DNS resolution, and TLS cert validity","Look at the wrapped error for the gRPC code — Unavailable/DeadlineExceeded point to connectivity, not credentials","Retry once connectivity is restored; if the code is InvalidArgument or PermissionDenied it will instead surface as 'login failed', a credential problem"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight management reachability to fail fast instead of burning backoff\nif _, err := tls.DialWithDialer(&net.Dialer{Timeout: 5 * time.Second}, \"tcp\", mgmtHostPort, tlsConfig); err != nil {\n\treturn fmt.Errorf(\"management unreachable, fix before up: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if s, ok := status.FromError(err); ok {\n\tswitch s.Code() {\n\tcase codes.InvalidArgument, codes.PermissionDenied, codes.NotFound, codes.Unimplemented:\n\t\t// permanent: fix credentials/config, do not retry\n\tdefault:\n\t\t// transient: safe to retry with your own backoff\n\t}\n}","preventionTips":["Pin a correct --management-url and validate its DNS/TLS before rollout","Treat Unavailable/DeadlineExceeded as environment issues; check firewall and proxy allowances for gRPC","Give automation a timeout shorter than the CLI backoff so pipelines fail fast with a clear cause"],"tags":["go","netbird","grpc","retry","backoff","login","connectivity"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}