{"record":{"id":"46deadc920fcc5bb","repo":"juanfont/headscale","slug":"renaming-user-w","errorCode":null,"errorMessage":"renaming user: %w","messagePattern":"renaming user: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/users.go","lineNumber":251,"sourceCode":"\t\t})\n\t}),\n}\n\nvar renameUserCmd = &cobra.Command{\n\tUse:     \"rename\",\n\tShort:   \"Renames a user\",\n\tAliases: []string{\"mv\"},\n\tRunE: clientRunE(func(ctx context.Context, client *clientv1.ClientWithResponses, cmd *cobra.Command, args []string) error {\n\t\tid, _, err := resolveSingleUser(ctx, client, cmd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tnewName, _ := cmd.Flags().GetString(\"new-name\")\n\n\t\tresp, err := client.RenameUserWithResponse(ctx, strconv.FormatUint(id, util.Base10), newName)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"renaming user: %w\", err)\n\t\t}\n\n\t\tif resp.StatusCode() != http.StatusOK {\n\t\t\treturn apiError(resp.StatusCode(), resp.ApplicationproblemJSONDefault)\n\t\t}\n\n\t\treturn printOutput(cmd, resp.JSON200.User, \"User renamed\")\n\t}),\n}\n","sourceCodeStart":233,"sourceCodeEnd":261,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/users.go#L233-L261","documentation":"Error \"renaming user: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/users.go:251 when the library encounters an invalid state.","commonSituations":"Renaming the user failed. Verify the user exists and the new name is unique and valid.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (renaming user); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (renaming user); 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"}