Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cobber opened this issue Dec 1, 2021 · 4 comments · Fixed by #17878
Closed

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

cobber opened this issue Dec 1, 2021 · 4 comments · Fixed by #17878

Comments

@cobber
Copy link

cobber commented 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

@zeripath zeripath changed the title 500 internal server error when renaming an organisation 500 internal server error when renaming an organisation as reserved user Dec 1, 2021
@zeripath zeripath changed the title 500 internal server error when renaming an organisation as reserved user 500 internal server error when renaming an organisation as reserved name Dec 1, 2021
@a1012112796
Copy link
Member

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

a1012112796 added a commit to a1012112796/gitea that referenced this issue Dec 2, 2021
fix go-gitea#17876

Signed-off-by: a1012112796 <1012112796@qq.com>
wxiaoguang pushed a commit that referenced this issue Dec 2, 2021
fix #17876

Signed-off-by: a1012112796 <1012112796@qq.com>
@cobber
Copy link
Author

cobber commented 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.

a1012112796 added a commit to a1012112796/gitea that referenced this issue Dec 2, 2021
lunny pushed a commit that referenced this issue Dec 2, 2021
fix #17876

Signed-off-by: a1012112796 <1012112796@qq.com>
@cobber
Copy link
Author

cobber commented 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 :-)

@Gusted
Copy link
Contributor

Gusted commented Jan 20, 2022

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

#18342

zeripath pushed a commit that referenced this issue Jan 20, 2022
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants