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

500 error when accessing repo on web (context deadline exceed, LastCommitCache related) #17314

Closed
bagasme opened this issue Oct 15, 2021 · 6 comments · Fixed by #17319
Closed
Labels
Milestone

Comments

@bagasme
Copy link
Contributor

bagasme commented Oct 15, 2021

Gitea Version

commit d47798c

Git Version

2.33.0

Operating System

Debian 11

How are you running Gitea?

built from source with Go 1.17.2, Node 14.17.6 (npm 6.14.15) on Ubuntu 20.04. Running as systemd service on production mode. Connected to a PostgreSQL 14 instance on separate server.

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/bagasme/5c5dc41a48d8cea354b0f68fc6d2f6bd

Description

I'm trying to access one of my repo (a local copy of git.git) on the web interface (at https://gitnode.io/bagas/git). It returns 500 error instead of showing the repo contents. Going through log, the error occurs at renderDirectoryFiles(), but before it logs LastCommitCache stuff.

Screenshots

(not relevant, since the 500 error page is generic).

@zeripath
Copy link
Contributor

This is going to be related to #16467 - something will have changed that that PR relied on and now instead of the error being ignored/expected it's being propagated up.

I'll take a look.

@zeripath

This comment has been minimized.

zeripath added a commit to zeripath/gitea that referenced this issue Oct 15, 2021
There is a slight race in checking of a context deadline exceed in go-gitea#16467
which leads to a 500 on the repository page.

The solution is to check the error coming back from `*LogNameStatusRepoParser.Next()`
and if it is the `ContextDeadlineExceeded` break from the loop.

Fix go-gitea#17314

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath
Copy link
Contributor

Figured it out - Bug fix oncoming.

Once that's in you should see the benefit of the #16467 on those large repos.

@zeripath zeripath added this to the 1.16.0 milestone Oct 15, 2021
zeripath added a commit that referenced this issue Oct 15, 2021
There is a slight race in checking of a context deadline exceed in #16467
which leads to a 500 on the repository page.

The solution is to check the error coming back from `*LogNameStatusRepoParser.Next()`
and if it is the `ContextDeadlineExceeded` break from the loop.

Fix #17314

Signed-off-by: Andrew Thornton <[email protected]>
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

this bugged me, too, never has it occured to me it could be connected to the latest commit info.
thanks for the report @bagasme and thanks for the fix @zeripath , your patch indeed does fix the issue for me as well.

@zeripath
Copy link
Contributor

Well given a feature I made caused it...

Repo view should now be a lot more snappy for big repos.

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

Well given a feature I made caused it...

right.. still thanks.

Repo view should now be a lot more snappy for big repos.

it does feel that way. btw I was only getting 500s on larger™ repos and now I'm not so that's great. 🚀

Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
There is a slight race in checking of a context deadline exceed in go-gitea#16467
which leads to a 500 on the repository page.

The solution is to check the error coming back from `*LogNameStatusRepoParser.Next()`
and if it is the `ContextDeadlineExceeded` break from the loop.

Fix go-gitea#17314

Signed-off-by: Andrew Thornton <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants