juanfont/headscale · error

deleting oauth client: %w

Error message

deleting oauth client: %w

What it means

Error "deleting oauth client: %w" thrown in juanfont/headscale.

Source

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

var deleteOAuthClientCmd = &cobra.Command{
	Use:     cmdDelete,
	Short:   "Delete an OAuth client",
	Aliases: []string{"remove", aliasDel},
	RunE: func(cmd *cobra.Command, _ []string) error {
		id, _ := cmd.Flags().GetString("id")
		if id == "" {
			return fmt.Errorf("--id is required: %w", errMissingParameter)
		}

		ctx, client, cancel, err := newV2Client()
		if err != nil {
			return err
		}
		defer cancel()

		resp, err := client.DeleteKeyWithResponse(ctx, oauthTailnet, id)
		if err != nil {
			return fmt.Errorf("deleting oauth client: %w", err)
		}

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

		return printOutput(cmd, map[string]string{"id": id}, "OAuth client "+id+" deleted")
	},
}

// newV2Client builds a generated v2 API client, selecting the transport the same
// way the v1 client does: over the local unix socket it is unauthenticated
// (local trust); a remote address injects the configured API key as a bearer
// token.
func newV2Client() (context.Context, *clientv2.ClientWithResponses, context.CancelFunc, error) {
	cfg, err := types.LoadCLIConfig()
	if err != nil {

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Inspect the wrapped error for the underlying cause and correct the failing condition (deleting oauth client); 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 (deleting oauth client); retry the operation after fixing the input, configuration, or environment.

When it happens

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

Common situations: Deleting the OAuth client failed. Verify the client ID exists via the oauth client list command.


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