When there are too many Commits, the "Contributors" page displays an "Internal Server Error." #14247

Closed
opened 2025-11-02 11:07:26 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @hhmmLife on GitHub (Mar 13, 2025).

Description

My repository has 9,000 Commits. When I click on the "Contributors" page, it first displays "This may take a while," and after ten minutes, it shows "Internal Server Error."

This issue is consistently reproducible.

Another repository with 800 Commits does not have this problem.

Here is the log after ten minutes:

log:

2025/03/13 17:41:37 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.9ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:39 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.5ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:41 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.3ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:43 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.8ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:45 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.0ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:47 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.2ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:49 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.7ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:51 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.8ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:53 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 18.2ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:55 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 19.9ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:57 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 18.4ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:41:59 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.7ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:01 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.1ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:03 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.7ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:05 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 93.8ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:07 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.4ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:09 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.7ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:11 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 15.6ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:13 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.6ms @ repo/contributors.go:28(repo.ContributorsData)
2025/03/13 17:42:15 ...repo/contributors.go:34:ContributorsData() [E] GetContributorStats: cached error: cached error: ExtendedCommitStats: Failed to get ContributorsCommitStats for repository.
Error: context deadline exceeded
Stderr: 

Gitea Version

1.23.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Image

Image

Git Version

2.47.2

Operating System

Linux

How are you running Gitea?

docker

Database

SQLite

Originally created by @hhmmLife on GitHub (Mar 13, 2025). ### Description My repository has 9,000 Commits. When I click on the "Contributors" page, it first displays "This may take a while," and after ten minutes, it shows "Internal Server Error." This issue is consistently reproducible. Another repository with 800 Commits does not have this problem. Here is the log after ten minutes: log: ``` 2025/03/13 17:41:37 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.9ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:39 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.5ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:41 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.3ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:43 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.8ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:45 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.0ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:47 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.2ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:49 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.7ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:51 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.8ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:53 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 18.2ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:55 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 19.9ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:57 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 18.4ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:41:59 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.7ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:01 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.1ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:03 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.7ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:05 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 93.8ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:07 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.4ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:09 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 16.7ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:11 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 15.6ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:13 ...eb/routing/logger.go:102:func1() [I] router: completed GET /nnhhmm/TTT3/activity/contributors/data for 192.168.99.92:55188, 202 Accepted in 17.6ms @ repo/contributors.go:28(repo.ContributorsData) 2025/03/13 17:42:15 ...repo/contributors.go:34:ContributorsData() [E] GetContributorStats: cached error: cached error: ExtendedCommitStats: Failed to get ContributorsCommitStats for repository. Error: context deadline exceeded Stderr: ``` ### Gitea Version 1.23.5 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![Image](https://github.com/user-attachments/assets/29160d27-b93b-4341-b643-4f7cd1ff559c) ![Image](https://github.com/user-attachments/assets/d9bb6438-f922-4e2a-98a7-b01d6808f69e) ### Git Version 2.47.2 ### Operating System Linux ### How are you running Gitea? docker ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 11:07:27 -06:00
Author
Owner

@lunny commented on GitHub (Mar 13, 2025):

What did you mean versions? Commits, branches, tags or releases?

@lunny commented on GitHub (Mar 13, 2025): What did you mean versions? Commits, branches, tags or releases?
Author
Owner

@hhmmLife commented on GitHub (Mar 14, 2025):

What did you mean versions? Commits, branches, tags or releases?

Thanks for your response. When I mentioned 9,000 versions, I was referring to commit versions.
I only have one main branch, no tags or releases.

@hhmmLife commented on GitHub (Mar 14, 2025): > What did you mean versions? Commits, branches, tags or releases? Thanks for your response. When I mentioned 9,000 versions, I was referring to commit versions. I only have one main branch, no tags or releases.
Author
Owner

@TheFox0x7 commented on GitHub (Mar 17, 2025):

I did reproduce that issue (linux repo is a nice tester) and this one is just a git timeout issue. Question is how to fix it because making the timeout longer feels wrong (move it to 10 minutes to fix that, then why not make it 30 to fix even larger and so on).

@TheFox0x7 commented on GitHub (Mar 17, 2025): I did reproduce that issue (linux repo is a nice tester) and this one is just a git timeout issue. Question is how to fix it because making the timeout longer feels wrong (move it to 10 minutes to fix that, then why not make it 30 to fix even larger and so on).
Author
Owner

@hhmmLife commented on GitHub (Mar 19, 2025):

I did reproduce that issue (linux repo is a nice tester) and this one is just a git timeout issue. Question is how to fix it because making the timeout longer feels wrong (move it to 10 minutes to fix that, then why not make it 30 to fix even larger and so on).

Do you plan to fix this issue, or is there a chance it could be resolved?

Honestly, I'm quite surprised that the renowned Gitea struggles with a slightly higher number of commits. In my opinion, 8,000 commits isn't that many.

I don't mean to complain—I'm just a user benefiting from your hard work. Thank you for all your efforts!

@hhmmLife commented on GitHub (Mar 19, 2025): > I did reproduce that issue (linux repo is a nice tester) and this one is just a git timeout issue. Question is how to fix it because making the timeout longer feels wrong (move it to 10 minutes to fix that, then why not make it 30 to fix even larger and so on). Do you plan to fix this issue, or is there a chance it could be resolved? Honestly, I'm quite surprised that the renowned Gitea struggles with a slightly higher number of commits. In my opinion, 8,000 commits isn't that many. I don't mean to complain—I'm just a user benefiting from your hard work. Thank you for all your efforts!
Author
Owner

@TheFox0x7 commented on GitHub (Mar 19, 2025):

Do you plan to fix this issue, or is there a chance it could be resolved?

You can set your own timeout:

[git.timeout]
DEFAULT=360 ; longer timeout in seconds

You might try estimating the time need by timing git --no-pager log --shortstat --no-merges --pretty=format:---%n%aN%n%aE%n%as --reverse
On linux repository it took 26 minutes to complete.

Honestly, I'm quite surprised that the renowned Gitea struggles with a slightly higher number of commits. In my opinion, 8,000 commits isn't that many.

To be fair, underneath it's running log git log with --short-stat which does take a fair bit to write to output so it's more that the git itself is the bottleneck here.
I'm sure there is some way to optimize it but I lack expertise in this area to propose something concrete.

@TheFox0x7 commented on GitHub (Mar 19, 2025): > Do you plan to fix this issue, or is there a chance it could be resolved? You can set your own timeout: ```ini [git.timeout] DEFAULT=360 ; longer timeout in seconds ``` You might try estimating the time need by timing `git --no-pager log --shortstat --no-merges --pretty=format:---%n%aN%n%aE%n%as --reverse` On linux repository it took 26 minutes to complete. > Honestly, I'm quite surprised that the renowned Gitea struggles with a slightly higher number of commits. In my opinion, 8,000 commits isn't that many. To be fair, underneath it's running log `git log` with `--short-stat` which does take a fair bit to write to output so it's more that the git itself is the bottleneck here. I'm sure there is some way to optimize it but I lack expertise in this area to propose something concrete.
Author
Owner

@hhmmLife commented on GitHub (Mar 20, 2025):

Do you plan to fix this issue, or is there a chance it could be resolved?

You can set your own timeout:

[git.timeout]
DEFAULT=360 ; longer timeout in seconds
You might try estimating the time need by timing git --no-pager log --shortstat --no-merges --pretty=format:---%n%aN%n%aE%n%as --reverse On linux repository it took 26 minutes to complete.

Honestly, I'm quite surprised that the renowned Gitea struggles with a slightly higher number of commits. In my opinion, 8,000 commits isn't that many.

To be fair, underneath it's running log git log with --short-stat which does take a fair bit to write to output so it's more that the git itself is the bottleneck here. I'm sure there is some way to optimize it but I lack expertise in this area to propose something concrete.

Following your guide, I have successfully resolved the issue. Thank you for your help—not only for solving my problem but also for your willingness to assist.

@hhmmLife commented on GitHub (Mar 20, 2025): > > Do you plan to fix this issue, or is there a chance it could be resolved? > > You can set your own timeout: > > [git.timeout] > DEFAULT=360 ; longer timeout in seconds > You might try estimating the time need by timing `git --no-pager log --shortstat --no-merges --pretty=format:---%n%aN%n%aE%n%as --reverse` On linux repository it took 26 minutes to complete. > > > Honestly, I'm quite surprised that the renowned Gitea struggles with a slightly higher number of commits. In my opinion, 8,000 commits isn't that many. > > To be fair, underneath it's running log `git log` with `--short-stat` which does take a fair bit to write to output so it's more that the git itself is the bottleneck here. I'm sure there is some way to optimize it but I lack expertise in this area to propose something concrete. Following your guide, I have successfully resolved the issue. Thank you for your help—not only for solving my problem but also for your willingness to assist.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14247