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

«Internal server error» on simple URL mangling #27176

Closed
jn0 opened this issue Sep 21, 2023 · 14 comments · Fixed by #29967
Closed

«Internal server error» on simple URL mangling #27176

jn0 opened this issue Sep 21, 2023 · 14 comments · Fixed by #29967
Labels

Comments

@jn0
Copy link

jn0 commented Sep 21, 2023

Description

I tried (occasionally) to get to URL like https://example.com/gitea/issues?labels=!30 and got error 500.

System journal has few lines for it (for gitea.service):

Sep 21 18:17:58 blackbox gitea[2170]: 2023/09/21 18:17:58 ...ers/web/user/home.go:490:buildIssueOverview() [E] [650c5ea6] StringsToInt64s: strconv.ParseInt: parsing "!30": invalid syntax
Sep 21 18:17:58 blackbox gitea[2170]: 2023/09/21 18:17:58 [650c5ea6] router: completed GET /issues?labels=!30 for 192.168.1.1:0, 500 Internal Server Error in 16.0ms @ user/home.go:308(user.Issues)

Gitea Version

Gitea version 1.19.3 built with GNU Make 4.1, go1.20.4 : bindata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 22.04.1 LTS

How are you running Gitea?

Gitea is ran on premise, at home.

Cannot verify try.gitiea.io -- registration pending.

Database

SQLite

@jn0 jn0 added the type/bug label Sep 21, 2023
@jn0
Copy link
Author

jn0 commented Sep 21, 2023

Just upgraded to the latest version, but the bug is still here:

image

@wxiaoguang
Copy link
Contributor

How do you get https://example.com/gitea/issues?labels=!30 this URL? IIRC there shouldn't be !.

Which page were you visiting?

@jn0
Copy link
Author

jn0 commented Sep 21, 2023

@wxiaoguang yepp, it should not - it was my typo.

I don't insist that this behaviour is incorrect, but it's quite strange to get 500 on mere URL typo.

@wxiaoguang
Copy link
Contributor

If you see it again, could you navigate your browser back and try to figure out where the URL comes from?

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Sep 21, 2023
@jn0
Copy link
Author

jn0 commented Sep 21, 2023

@wxiaoguang it was literally typo - it was me who have entered wrong URL.

In humble attempt to filter issues…

@wxiaoguang
Copy link
Contributor

Hmm .... I see .... I understand your meaning of "I don't insist that this behaviour is incorrect, but it's quite strange to get 500 on mere URL typo." now.

So I guess this behavior could also considers as "by design" but not a bug? 😄 At least, the server told you that the input causes errors .....

@wxiaoguang wxiaoguang removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Sep 21, 2023
@jn0
Copy link
Author

jn0 commented Sep 21, 2023

@wxiaoguang yes, it tald :)

But I'd prefer a bit less offensive way over "error 500" that made me jump and look at the box it's ran on.

At least in semantics of the HTTP codes, it should be 400 "Bad Request", and not 500.

@wxiaoguang
Copy link
Contributor

That's a longstanding problem in Gitea: there are a lot of unnecessary 500 responses. I am afraid such behavior is nearly impossible to get a complete fix at the moment.

@jn0
Copy link
Author

jn0 commented Sep 21, 2023

Well, I tried my best, you know the rest.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 21, 2023

There is another "500" summary proposal issue: Improve troubleshooting for 500 and other server errors #8016 (really longstanding ....)

@yp05327
Copy link
Contributor

yp05327 commented Mar 21, 2024

@wxiaoguang
Can this issue be closed? As it is just a typo.
ps: of cause, we need to consider the HTTP codes later.

@lunny
Copy link
Member

lunny commented Mar 21, 2024

Maybe a PR returned 400 is a better choice.

@wxiaoguang
Copy link
Contributor

I would suggest to simply ignore such annoying error. Just like others:

image

@wxiaoguang
Copy link
Contributor

-> Refactor StringsToInt64s #29967

wxiaoguang added a commit that referenced this issue Mar 21, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants