Cryptic error when creating a team with a whitespace via api #2271

Open
opened 2025-11-02 04:30:34 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @kolaente on GitHub (Aug 30, 2018).

Description

When creating a new team via the api which contains a whitespace, the api returns the following cryptic error:

[{"fieldNames":["Name"],"classification":"AlphaDashDotError","message":"AlphaDashDot"}]

After digging around in the code for two hours I finally found out the error was caused by a whitespace in the name.

I'd whish to get a more specific error message in that case, googling didn't help much either.

Originally created by @kolaente on GitHub (Aug 30, 2018). - Gitea version (or commit ref): b9ae16d - Operating system: Debian - Can you reproduce the bug at https://try.gitea.io: - [x] Probably ## Description When creating a new team via the api which contains a whitespace, the api returns the following cryptic error: ```log [{"fieldNames":["Name"],"classification":"AlphaDashDotError","message":"AlphaDashDot"}] ``` After digging around in the code for two hours I finally found out the error was caused by a whitespace in the name. I'd whish to get a more specific error message in that case, googling didn't help much either.
GiteaMirror added the issue/confirmedtype/enhancementmodifies/api labels 2025-11-02 04:30:34 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jan 11, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 11, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@lunny commented on GitHub (Feb 7, 2019):

Maybe added a not empty or required to the form tag?

@lunny commented on GitHub (Feb 7, 2019): Maybe added a not empty or required to the form tag?
Author
Owner

@kolaente commented on GitHub (Feb 7, 2019):

@lunny sounds like a good idea

@kolaente commented on GitHub (Feb 7, 2019): @lunny sounds like a good idea
Author
Owner

@davidgiga1993 commented on GitHub (Jul 23, 2021):

I'm facing the same issues. I would expect an API to give a proper error message why the validation failed. Otherwise one has to brute force it until it works..

@davidgiga1993 commented on GitHub (Jul 23, 2021): I'm facing the same issues. I would expect an API to give a proper error message why the validation failed. Otherwise one has to brute force it until it works..
Author
Owner

@wxiaoguang commented on GitHub (Apr 13, 2022):

Isn't the message clear? AlphaDashDot means the field should contains alpha or dot or dash .....

@wxiaoguang commented on GitHub (Apr 13, 2022): Isn't the message clear? `AlphaDashDot` means the field should contains alpha or dot or dash .....
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2271