{"record":{"id":"e9462ee5f5ef919d","repo":"juanfont/headscale","slug":"listing-nodes-w","errorCode":null,"errorMessage":"listing nodes: %w","messagePattern":"listing nodes: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/nodes.go","lineNumber":112,"sourceCode":"\t\t)\n\t}),\n}\n\nvar listNodesCmd = &cobra.Command{\n\tUse:     cmdList,\n\tShort:   \"List nodes\",\n\tAliases: []string{\"ls\", cmdShow},\n\tRunE: clientRunE(func(ctx context.Context, client *clientv1.ClientWithResponses, cmd *cobra.Command, args []string) error {\n\t\tuser, _ := cmd.Flags().GetString(\"user\")\n\n\t\tparams := &clientv1.ListNodesParams{}\n\t\tif user != \"\" {\n\t\t\tparams.User = &user\n\t\t}\n\n\t\tresp, err := client.ListNodesWithResponse(ctx, params)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"listing nodes: %w\", err)\n\t\t}\n\n\t\tif resp.StatusCode() != http.StatusOK {\n\t\t\treturn apiError(resp.StatusCode(), resp.ApplicationproblemJSONDefault)\n\t\t}\n\n\t\tnodes := resp.JSON200.Nodes\n\n\t\treturn printListOutput(cmd, nodes, func() error {\n\t\t\ttableData, err := nodesToPtables(nodes)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"converting to table: %w\", err)\n\t\t\t}\n\n\t\t\treturn pterm.DefaultTable.WithHasHeader().WithData(tableData).Render()\n\t\t})\n\t}),\n}","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/nodes.go#L94-L130","documentation":"Error \"listing nodes: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/nodes.go:112 when the library encounters an invalid state.","commonSituations":"The gRPC ListNodes call failed. Check connectivity to the headscale server and that the CLI API key or socket credentials are valid.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (listing nodes); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (listing nodes); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}