{"record":{"id":"efe400be80141e2c","repo":"netbirdio/netbird","slug":"failed-to-list-network-v-efe400","errorCode":null,"errorMessage":"failed to list network: %v","messagePattern":"failed to list network: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/networks.go","lineNumber":63,"sourceCode":"\tArgs:    cobra.MinimumNArgs(1),\n\tRunE:    networksDeselect,\n}\n\nfunc init() {\n\troutesSelectCmd.PersistentFlags().BoolVarP(&appendFlag, \"append\", \"a\", false, \"Append to current network selection instead of replacing\")\n}\n\nfunc networksList(cmd *cobra.Command, _ []string) error {\n\tconn, err := getClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\n\tclient := proto.NewDaemonServiceClient(conn)\n\tresp, err := client.ListNetworks(cmd.Context(), &proto.ListNetworksRequest{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to list network: %v\", status.Convert(err).Message())\n\t}\n\n\tif len(resp.Routes) == 0 {\n\t\tcmd.Println(\"No networks available.\")\n\t\treturn nil\n\t}\n\n\tprintNetworks(cmd, resp)\n\n\treturn nil\n}\n\nfunc printNetworks(cmd *cobra.Command, resp *proto.ListNetworksResponse) {\n\tcmd.Println(\"Available Networks:\")\n\tfor _, route := range resp.Routes {\n\t\tprintNetwork(cmd, route)\n\t}\n}","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/networks.go#L45-L81","documentation":"The `netbird networks list` CLI got a gRPC error back from the daemon's ListNetworks RPC; only the status message text is surfaced (status.Convert(err).Message()). This means the CLI reached the daemon, but the daemon refused or failed the call — most often because the peer is not connected/registered with a management service, or the running daemon predates the networks API.","triggerScenarios":"Peer never ran `netbird up` (daemon has no management session); management server unreachable so the daemon cannot fetch networks; daemon version older than the CLI (codes.Unimplemented for ListNetworks); daemon still starting up and login state not loaded.","commonSituations":"CLI/daemon version skew after upgrading only the binary; freshly installed daemon before first login; management outage; running `networks list` right after service start before sync completes.","solutions":["Run `netbird status` to confirm the peer is registered and connected to management, then retry","Match versions: upgrade the daemon service to the same (or newer) version as the CLI","Check daemon logs for management connectivity errors (management URL, DNS, TLS)","Re-authenticate with `netbird up` if the session expired or was never established"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# shell preflight: only call networks list when the peer is connected\nnetbird status --json | grep -q '\"Status\": \"Connected\"' && netbird networks list || echo \"peer not connected\"","typeGuard":null,"tryCatchPattern":"resp, err := client.ListNetworks(cmd.Context(), &proto.ListNetworksRequest{})\nif err != nil {\n    if st, ok := status.FromError(err); ok && st.Code() == codes.Unimplemented {\n        return fmt.Errorf(\"daemon too old for network routes; upgrade the netbird service\")\n    }\n    return fmt.Errorf(\"list networks: %s\", status.Convert(err).Message())\n}","preventionTips":["Keep CLI and daemon versions in lockstep (upgrade both)","Ensure `netbird up` completed once before querying/altering networks","Treat a failed `networks list` as a connectivity signal — check `netbird status` next"],"tags":["grpc","networks","daemon","version-skew"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}