{"record":{"id":"31c95d7d03353dfa","repo":"netbirdio/netbird","slug":"connect-to-service-cli-interface-w","errorCode":null,"errorMessage":"connect to service CLI interface: %w","messagePattern":"connect to service CLI interface: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/profile.go","lineNumber":96,"sourceCode":"\n\tcmd.SetOut(cmd.OutOrStdout())\n\n\terr := util.InitLog(logLevel, \"console\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc listProfilesFunc(cmd *cobra.Command, _ []string) error {\n\tif err := setupCmd(cmd); err != nil {\n\t\treturn err\n\t}\n\n\tconn, err := DialClientGRPCServer(cmd.Context(), daemonAddr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"connect to service CLI interface: %w\", err)\n\t}\n\tdefer conn.Close()\n\n\tcurrUser, err := user.Current()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get current user: %w\", err)\n\t}\n\n\tdaemonClient := proto.NewDaemonServiceClient(conn)\n\n\tresp, err := daemonClient.ListProfiles(cmd.Context(), &proto.ListProfilesRequest{\n\t\tUsername: currUser.Username,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 2, ' ', 0)","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/profile.go#L78-L114","documentation":"`netbird profile list` could not connect to the daemon's gRPC control interface. DialClientGRPCServer (client/cmd/root.go:271) blocks up to 10s on the dial target derived from --daemon-addr (default unix:///var/run/netbird.sock, npipe://netbird on Windows). The error is wrapped with %w, preserving the underlying grpc dial error chain.","triggerScenarios":"Daemon not installed/started; socket or named pipe missing; wrong --daemon-addr / NB_DAEMON_ADDR; dial timeout; running in an environment (container, SSH session with different namespace) that cannot reach the host socket.","commonSituations":"Fresh machines before `netbird service install && netbird service start`; daemon crashed; NB_DAEMON_ADDR left over from tests pointing at tcp://127.0.0.1:41731 or a test socket; macOS app vs CLI mismatch.","solutions":["Start the daemon service and confirm the socket/pipe exists","Check NB_DAEMON_ADDR env and the --daemon-addr flag match where the daemon actually listens","Inspect daemon logs for startup failures and restart it","Reinstall the service if the socket is not recreated"],"exampleFix":"# before\nNB_DAEMON_ADDR=tcp://127.0.0.1:41731 netbird profile list\n# after (default unix socket where the daemon listens)\nunset NB_DAEMON_ADDR; netbird profile list","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(\"/var/run/netbird.sock\"); err != nil {\n    return fmt.Errorf(\"daemon not reachable (socket missing); run `netbird service start`\")\n}","typeGuard":"func canReachDaemon(addr string) bool {\n    conn, err := DialClientGRPCServer(context.Background(), addr)\n    if err != nil {\n        return false\n    }\n    conn.Close()\n    return true\n}","tryCatchPattern":"conn, err := DialClientGRPCServer(cmd.Context(), daemonAddr)\nif err != nil {\n    return fmt.Errorf(\"connect to service CLI interface: %w\", err)\n}\ndefer conn.Close()","preventionTips":["Start the service before profile operations","Keep NB_DAEMON_ADDR consistent with the installed service","Probe the socket in automation wrappers"],"tags":["grpc","daemon","connection","profiles","cli"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}