{"record":{"id":"4a8ce5d80bb9b657","repo":"netbirdio/netbird","slug":"failed-to-connect-to-daemon-error-v-if-the-daemo-4a8ce5","errorCode":null,"errorMessage":"failed to connect to daemon error: %v\nIf the daemon is not running please run: \nnetbird service install \nnetbird service start\n","messagePattern":"failed to connect to daemon error: (.+?)\nIf the daemon is not running please run: \nnetbird service install \nnetbird service start\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/root.go","lineNumber":442,"sourceCode":"\nfunc migrateToNetbird(oldPath, newPath string) bool {\n\t_, errOld := os.Stat(oldPath)\n\t_, errNew := os.Stat(newPath)\n\n\tif errors.Is(errOld, fs.ErrNotExist) || errNew == nil {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc getClient(cmd *cobra.Command) (*grpc.ClientConn, error) {\n\tcmd.SetOut(cmd.OutOrStdout())\n\n\tconn, err := DialClientGRPCServer(cmd.Context(), daemonAddr)\n\tif err != nil {\n\t\t//nolint\n\t\treturn nil, fmt.Errorf(\"failed to connect to daemon error: %v\\n\"+\n\t\t\t\"If the daemon is not running please run: \"+\n\t\t\t\"\\nnetbird service install \\nnetbird service start\\n\", err)\n\t}\n\n\treturn conn, nil\n}\n\n// isServiceCmd returns true if cmd is the \"service\" command or a child of it.\nfunc isServiceCmd(cmd *cobra.Command) bool {\n\tfor c := cmd; c != nil; c = c.Parent() {\n\t\tif c.Name() == \"service\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n","sourceCodeStart":424,"sourceCodeEnd":459,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/root.go#L424-L459","documentation":"Error \"failed to connect to daemon error: %v\nIf the daemon is not running please run: \nnetbird service install \nnetbird service start\n\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/cmd/root.go:442 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}