500 Internal Server Error when accessing nonexistent commit #5136

Closed
opened 2025-11-02 06:15:34 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @tobiaswiese on GitHub (Mar 27, 2020).

  • Gitea version (or commit ref): 1.11.3
  • Git version: 2.20.1
  • Operating system: Debian Buster
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist: Not relevant

Description

When accessing a commit that doesn't exist (either by typing nonsense into the url bar, or because it was later cleaned up by the garbage collector), the server fails with a 500 error, insead of a 404.

Screenshots

https://try.gitea.io/img/500.png

Originally created by @tobiaswiese on GitHub (Mar 27, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.11.3 - Git version: 2.20.1 - Operating system: Debian Buster - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes: https://try.gitea.io/go-gitea/blog/commit/aa64449a8c91c7057c89322881794caf15590eb3 - [ ] No - [ ] Not relevant - Log gist: Not relevant ## Description When accessing a commit that doesn't exist (either by typing nonsense into the url bar, or because it was later cleaned up by the garbage collector), the server fails with a 500 error, insead of a 404. ## Screenshots https://try.gitea.io/img/500.png
GiteaMirror added the type/bug label 2025-11-02 06:15:34 -06:00
Author
Owner

@lunny commented on GitHub (Mar 27, 2020):

This may has been fixed by @zeripath .

@lunny commented on GitHub (Mar 27, 2020): This may has been fixed by @zeripath .
Author
Owner

@zeripath commented on GitHub (Mar 28, 2020):

Nope I hadn't fixed this one - but it needs a similar fix to the other places.

@zeripath commented on GitHub (Mar 28, 2020): Nope I hadn't fixed this one - but it needs a similar fix to the other places.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5136