{"record":{"id":"647fcdc37c61e21c","repo":"juanfont/headscale","slug":"listing-oauth-clients-w","errorCode":null,"errorMessage":"listing oauth clients: %w","messagePattern":"listing oauth clients: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/oauth_client.go","lineNumber":109,"sourceCode":"\t\treturn printOutput(cmd, key,\n\t\t\tfmt.Sprintf(\"OAuth client %s created.\\nSecret (shown once, store it now): %s\", key.Id, ptrStr(key.Key)))\n\t},\n}\n\nvar listOAuthClientsCmd = &cobra.Command{\n\tUse:     cmdList,\n\tShort:   \"List OAuth clients\",\n\tAliases: []string{\"ls\", cmdShow},\n\tRunE: func(cmd *cobra.Command, _ []string) error {\n\t\tctx, client, cancel, err := newV2Client()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer cancel()\n\n\t\tresp, err := client.ListKeysWithResponse(ctx, oauthTailnet, nil)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"listing oauth clients: %w\", err)\n\t\t}\n\n\t\terr = v2Error(resp.HTTPResponse.StatusCode, resp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// The keys endpoint is multiplexed; keep only OAuth clients.\n\t\tclients := make([]clientv2.Key, 0, len(resp.JSON200.Keys))\n\n\t\tfor _, k := range resp.JSON200.Keys {\n\t\t\tif k.KeyType == \"client\" {\n\t\t\t\tclients = append(clients, k)\n\t\t\t}\n\t\t}\n\n\t\treturn printListOutput(cmd, clients, func() error {\n\t\t\trows := make([][]string, 0, len(clients))","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/oauth_client.go#L91-L127","documentation":"Error \"listing oauth clients: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/oauth_client.go:109 when the library encounters an invalid state.","commonSituations":"Listing OAuth clients failed. Verify server connectivity and CLI credentials.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (listing oauth clients); 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 oauth clients); 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-15T22:17:37.221Z"}