500 internal server error when renaming an organisation as reserved name #8201

Closed
opened 2025-11-02 07:57:13 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @cobber on GitHub (Dec 1, 2021).

Gitea Version

1.15.3

Git Version

No response

Operating System

No response

How are you running Gitea?

standalone binary installation gitea-1.15.3-linux-arm-6 image installed under a dedicated "gitea" user

Database

SQLite

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

When I tried to rename one of my organisations to "admin" (for my git repo's with administrative scripts etc) I got a nondescript "500" error (without "internal server error" or any other information).

Being my own gitea admin, I was able to find the log entry:
2021/12/01 21:04:40 ...s/web/org/setting.go:72:SettingsPost() [E] ChangeUserName: name is reserved [name: admin]

It would be much more user friendly if at least this error message was displayed in the UI.

As far as I can tell this is being triggered via CreateOrgnization() when it gets an error from user_model.IsUsableUsername()

Also, the list of reserved names in models/user/user.go (reservedUsernames var) would be useful information to help the user understand what went wrong.

Screenshots

No response

Originally created by @cobber on GitHub (Dec 1, 2021). ### Gitea Version 1.15.3 ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? standalone binary installation gitea-1.15.3-linux-arm-6 image installed under a dedicated "gitea" user ### Database SQLite ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description When I tried to rename one of my organisations to "admin" (for my git repo's with administrative scripts etc) I got a nondescript "500" error (without "internal server error" or any other information). Being my own gitea admin, I was able to find the log entry: 2021/12/01 21:04:40 ...s/web/org/setting.go:72:SettingsPost() [E] ChangeUserName: name is reserved [name: admin] It would be much more user friendly if at least this error message was displayed in the UI. As far as I can tell this is being triggered via CreateOrgnization() when it gets an error from user_model.IsUsableUsername() Also, the list of reserved names in models/user/user.go (reservedUsernames var) would be useful information to help the user understand what went wrong. ### Screenshots _No response_
Author
Owner

@a1012112796 commented on GitHub (Dec 2, 2021):

Has you try the new version (v1.15.6) ?

@a1012112796 commented on GitHub (Dec 2, 2021): Has you try the new version (**v1.15.6**) ?
Author
Owner

@cobber commented on GitHub (Dec 2, 2021):

Yep, 1.15.6 shows the same error, but I see you have added a patch.
I'll check it again when 1.15.7 is released.
Thanks.

@cobber commented on GitHub (Dec 2, 2021): Yep, 1.15.6 shows the same error, but I see you have added a patch. I'll check it again when 1.15.7 is released. Thanks.
Author
Owner

@cobber commented on GitHub (Jan 20, 2022):

just checked: 1.15.7 no longer crashes, just shows 'illegal_username' in a red dialog box.
Could be prettier, but is definitely a big improvement :-)

@cobber commented on GitHub (Jan 20, 2022): just checked: 1.15.7 no longer crashes, just shows 'illegal_username' in a red dialog box. Could be prettier, but is definitely a big improvement :-)
Author
Owner

@Gusted commented on GitHub (Jan 20, 2022):

just shows 'illegal_username' in a red dialog box.
Could be prettier, but is definitely a big improvement :-)

#18342

@Gusted commented on GitHub (Jan 20, 2022): > just shows 'illegal_username' in a red dialog box. > Could be prettier, but is definitely a big improvement :-) #18342
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8201