{"record":{"id":"ed9816625ca1ccd8","repo":"juanfont/headscale","slug":"creating-oauth-client-w","errorCode":null,"errorMessage":"creating oauth client: %w","messagePattern":"creating oauth client: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/oauth_client.go","lineNumber":81,"sourceCode":"\t\t\treturn fmt.Errorf(\"at least one --scope 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\tkeyType := \"client\"\n\n\t\tresp, err := client.CreateKeyWithResponse(ctx, oauthTailnet, clientv2.CreateKeyRequest{\n\t\t\tKeyType:     &keyType,\n\t\t\tScopes:      &scopes,\n\t\t\tTags:        &tags,\n\t\t\tDescription: &description,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating 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\tkey := resp.JSON200\n\n\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},","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/oauth_client.go#L63-L99","documentation":"Error \"creating oauth client: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/oauth_client.go:81 when the library encounters an invalid state.","commonSituations":"The gRPC CreateOAuthClient call failed. Check the server connection and that the requested scopes and redirect URIs are acceptable.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (creating 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 (creating 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"}