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

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

Closed
HeiHeiHeMianMa opened this issue Mar 13, 2025 · 6 comments
Labels

Comments

@HeiHeiHeMianMa
Copy link

HeiHeiHeMianMa commented 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

@lunny
Copy link
Member

lunny commented Mar 13, 2025

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

@HeiHeiHeMianMa
Copy link
Author

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.

@HeiHeiHeMianMa HeiHeiHeMianMa changed the title When there are too many versions, the "Contributors" page displays an "Internal Server Error." When there are too many Commits, the "Contributors" page displays an "Internal Server Error." Mar 17, 2025
@TheFox0x7
Copy link
Contributor

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).

@HeiHeiHeMianMa
Copy link
Author

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!

@TheFox0x7
Copy link
Contributor

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.

@HeiHeiHeMianMa
Copy link
Author

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants