{"record":{"id":"124511ab36fff95d","repo":"juanfont/headscale","slug":"deleting-oauth-client-w","errorCode":null,"errorMessage":"deleting oauth client: %w","messagePattern":"deleting oauth client: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/oauth_client.go","lineNumber":161,"sourceCode":"var deleteOAuthClientCmd = &cobra.Command{\n\tUse:     cmdDelete,\n\tShort:   \"Delete an OAuth client\",\n\tAliases: []string{\"remove\", aliasDel},\n\tRunE: func(cmd *cobra.Command, _ []string) error {\n\t\tid, _ := cmd.Flags().GetString(\"id\")\n\t\tif id == \"\" {\n\t\t\treturn fmt.Errorf(\"--id is required: %w\", errMissingParameter)\n\t\t}\n\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.DeleteKeyWithResponse(ctx, oauthTailnet, id)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"deleting oauth client: %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\treturn printOutput(cmd, map[string]string{\"id\": id}, \"OAuth client \"+id+\" deleted\")\n\t},\n}\n\n// newV2Client builds a generated v2 API client, selecting the transport the same\n// way the v1 client does: over the local unix socket it is unauthenticated\n// (local trust); a remote address injects the configured API key as a bearer\n// token.\nfunc newV2Client() (context.Context, *clientv2.ClientWithResponses, context.CancelFunc, error) {\n\tcfg, err := types.LoadCLIConfig()\n\tif err != nil {","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/oauth_client.go#L143-L179","documentation":"Error \"deleting oauth client: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/oauth_client.go:161 when the library encounters an invalid state.","commonSituations":"Deleting the OAuth client failed. Verify the client ID exists via the oauth client list command.","solutions":["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."],"exampleFix":"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.","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"}