«Internal server error» on simple URL mangling #11692

Closed
opened 2025-11-02 09:44:49 -06:00 by GiteaMirror · 14 comments
Owner

Originally created by @jn0 on GitHub (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

Originally created by @jn0 on GitHub (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
GiteaMirror added the type/bug label 2025-11-02 09:44:49 -06:00
Author
Owner

@jn0 commented on GitHub (Sep 21, 2023):

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

image

@jn0 commented on GitHub (Sep 21, 2023): Just upgraded to the latest version, but the bug is still here: ![image](https://github.com/go-gitea/gitea/assets/407437/5d73c692-a4af-4947-b0bb-50079c2d3c7e)
Author
Owner

@wxiaoguang commented on GitHub (Sep 21, 2023):

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

Which page were you visiting?

@wxiaoguang commented on GitHub (Sep 21, 2023): How do you get `https://example.com/gitea/issues?labels=!30` this URL? IIRC there shouldn't be `!`. Which page were you visiting?
Author
Owner

@jn0 commented on GitHub (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.

@jn0 commented on GitHub (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.
Author
Owner

@wxiaoguang commented on GitHub (Sep 21, 2023):

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

@wxiaoguang commented on GitHub (Sep 21, 2023): If you see it again, could you navigate your browser back and try to figure out where the URL comes from?
Author
Owner

@jn0 commented on GitHub (Sep 21, 2023):

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

In humble attempt to filter issues…

@jn0 commented on GitHub (Sep 21, 2023): @wxiaoguang it was *literally* typo - it was me who have entered wrong URL. In humble attempt to filter issues…
Author
Owner

@wxiaoguang commented on GitHub (Sep 21, 2023):

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 commented on GitHub (Sep 21, 2023): 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 .....
Author
Owner

@jn0 commented on GitHub (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.

@jn0 commented on GitHub (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.
Author
Owner

@wxiaoguang commented on GitHub (Sep 21, 2023):

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.

@wxiaoguang commented on GitHub (Sep 21, 2023): 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.
Author
Owner

@jn0 commented on GitHub (Sep 21, 2023):

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

@jn0 commented on GitHub (Sep 21, 2023): Well, I tried my best, you know the rest.
Author
Owner

@wxiaoguang commented on GitHub (Sep 21, 2023):

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

@wxiaoguang commented on GitHub (Sep 21, 2023): There is another "500" ~~summary~~ proposal issue: Improve troubleshooting for 500 and other server errors #8016 (really longstanding ....)
Author
Owner

@yp05327 commented on GitHub (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.

@yp05327 commented on GitHub (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.
Author
Owner

@lunny commented on GitHub (Mar 21, 2024):

Maybe a PR returned 400 is a better choice.

@lunny commented on GitHub (Mar 21, 2024): Maybe a PR returned 400 is a better choice.
Author
Owner

@wxiaoguang commented on GitHub (Mar 21, 2024):

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

image

@wxiaoguang commented on GitHub (Mar 21, 2024): I would suggest to simply ignore such annoying error. Just like others: ![image](https://github.com/go-gitea/gitea/assets/2114189/74185261-d57b-4876-b27b-15d01d8ca5e9)
Author
Owner

@wxiaoguang commented on GitHub (Mar 21, 2024):

-> Refactor StringsToInt64s #29967

@wxiaoguang commented on GitHub (Mar 21, 2024): -> Refactor StringsToInt64s #29967
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11692