Skip to content

Error 500 when viewing a commit by its ID #23872

Closed
@a20eac1d

Description

@a20eac1d

Description

When trying to view commits by their ID, Gitea sometimes crashes and shows an "Error 500" page.

I can make this issue appear very reliably when I have multiple requests open at the same time (click on multiple commit IDs in short time) or if I abort the current page load and then reload it immediately. It seems like the previous request is still going on the server and the new request is messing it up.

The error:

An error occurred:

template: repo/diff/section_unified:32:28: executing "repo/diff/section_unified" at <$section.GetComputedInlineDiffFor>: error calling GetComputedInlineDiffFor: runtime error: slice bounds out of range [2:1]

Gitea Version: 1.19.0

Gitea Version

1.19.0

Can you reproduce the bug on the Gitea demo site?

YES! See comment below

Log Gist

Updated Gist with more info:

https://gist.github.com/a20eac1d/4f2037bdfe147d2ad8c7ea375724f72a

Screenshots

https://i.imgur.com/BDd2x90.png

Git Version

2.38.4, Wire Protocol Version 2 Enabled

Operating System

Ubuntu 22.04 LTS

How are you running Gitea?

Gitea is running in a Docker container, created with the official tutorial at: https://docs.gitea.io/en-us/install-with-docker/

Database

SQLite

Activity

changed the title [-]Error 500 when vieweing a commit by its ID[/-] [+]Error 500 when viewing a commit by its ID[/+] on Apr 2, 2023
lunny

lunny commented on Apr 2, 2023

@lunny
Member

Is your patch a public one? Could you upload it to help the investigation?

a20eac1d

a20eac1d commented on Apr 2, 2023

@a20eac1d
Author

@lunny Sorry, what do you mean by patch?

a20eac1d

a20eac1d commented on Apr 2, 2023

@a20eac1d
Author

This bug appears to be a regression. When I downgrade my Gitea instance back to 1.18.0 (with the exact same settings) I cannot reproduce this issue. Upgrading to 1.19.0 again causes it to happen.

a20eac1d

a20eac1d commented on Apr 2, 2023

@a20eac1d
Author

@lunny

I was able to re-produce this issue on the official Gitea demo site. It is much more difficult to make it happen on there and it is super easy for me to reproduce on my local instance, so I believe the available CPU power has something to do with it.

Check out this repository: https://try.gitea.io/a20eac1d/bug1190/commits/branch/main

Under the SHA1 header you can find a button that says "f8269d2a24". Pressing this will take you to that specific commit. You need to press that button with your middle mouse button 5-15 times so that you have many tabs open trying to load that commit at the same time. If you are lucky, at some point at least one of those tabs will crash with an "Error 500". This happens rarely on a powerful instance like the Gitea demo, but it happens extremely often on my local instance which has less CPU power available. This does not happen on 1.18.0 and it only started happening in 1.19.0

wxiaoguang

wxiaoguang commented on Apr 3, 2023

@wxiaoguang
Contributor

Thank you for your detailed report! It helps a lot.

I think it could be fixed by Fix cases.Title crash for concurrency #23885

#21814 was introduced by 1.19, it makes the compare page crashes more than before.

added this to the 1.19.1 milestone on Apr 3, 2023
added a commit that references this issue on Apr 3, 2023
5fc9929
added a commit that references this issue on Apr 3, 2023
53645bf
added a commit that references this issue on Apr 3, 2023
669c76c

1 remaining item

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @lunny@wxiaoguang@a20eac1d

      Issue actions

        Error 500 when viewing a commit by its ID · Issue #23872 · go-gitea/gitea