juanfont/headscale · error

listing oauth clients: %w

Error message

listing oauth clients: %w

What it means

Error "listing oauth clients: %w" thrown in juanfont/headscale.

Source

Thrown at cmd/headscale/cli/oauth_client.go:109

		return printOutput(cmd, key,
			fmt.Sprintf("OAuth client %s created.\nSecret (shown once, store it now): %s", key.Id, ptrStr(key.Key)))
	},
}

var listOAuthClientsCmd = &cobra.Command{
	Use:     cmdList,
	Short:   "List OAuth clients",
	Aliases: []string{"ls", cmdShow},
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx, client, cancel, err := newV2Client()
		if err != nil {
			return err
		}
		defer cancel()

		resp, err := client.ListKeysWithResponse(ctx, oauthTailnet, nil)
		if err != nil {
			return fmt.Errorf("listing oauth clients: %w", err)
		}

		err = v2Error(resp.HTTPResponse.StatusCode, resp.Body)
		if err != nil {
			return err
		}

		// The keys endpoint is multiplexed; keep only OAuth clients.
		clients := make([]clientv2.Key, 0, len(resp.JSON200.Keys))

		for _, k := range resp.JSON200.Keys {
			if k.KeyType == "client" {
				clients = append(clients, k)
			}
		}

		return printListOutput(cmd, clients, func() error {
			rows := make([][]string, 0, len(clients))

View on GitHub (pinned to 565fd254d0)

Solutions

  1. 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.

Example fix

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.

When it happens

Trigger: Thrown at cmd/headscale/cli/oauth_client.go:109 when the library encounters an invalid state.

Common situations: Listing OAuth clients failed. Verify server connectivity and CLI credentials.


AI-assisted analysis of juanfont/headscale@565fd254d0 (2026-08-15). Data as JSON: /api/errors/647fcdc37c61e21c. Report an issue: GitHub.