-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
504 error when browsing directories in large repo #16211
Comments
@zeripath I don't see any difference when building with And I can't test #16063 because it means downgrading database, and I only have one Gitea instance (as production), and I don't want to spin up another instance because of memory constraints on my computer (I only have 4 GB RAM). |
@bagasme for now you just have to raise git timeout limits via config |
I have this same problem, at least getting a 504 when working with a big repo. Our prod server, running v1.14.6 of Gitea is NOT having this problem, but every time I populate our develop server running Gitea v1.15.0 with the same DB and filebase, if I go to https://develop.door43.org/unfoldingWord/en_tn it will sometimes timeout. It doesn't do it every time, sometimes it does show the page, sometimes it doesn't. I have debugged and I found where it is stopping is when it tries to do the Discard(1) when b.n is 0 for the README file (which in my problematic repo has a size of more than 4096 bytes). It is failing here: https://github.com/go-gitea/gitea/blob/main/modules/git/blob_nogogit.go#L126 I don't know if this is the same as the gcc repo being used, as it has a smaller README file. @zeripath I am not sure why the Discard(1) never returns, not even if I set my TIMEOUT really high. This page shows that it should return an error when there are no bytes in the buffer, which I assume is the case when the code reaches the line linked above? See https://pkg.go.dev/bufio#Reader.Discard |
Hmm, I am using the latest code from release/v1.15 and does have the DataAsync fix. Yet do wonder about that Discard(1) call when there are no bytes to read... |
Ok, looks like the above fix fixes the Close() call that seemed to previously be hanging. |
Not sure if this is/was the same problem that the OP repo was having though. @bagasme you may want to try the latest of of the development branch (main) or the release/v1.15 branch. |
@richmahn is the hold up definitely occurring at blob.Close()? Two options for what is going on here :
echo $SHA | git cat-file --batch will return a header line which read by But I can't see a miscount there.
This may be similar to the reasons why windows users seem to have trouble with the native backend. On #16773 I've had to use an Looking at the code for go's exec it appears that using I'm sorry that there appears to be a bug here - I'm really kinda stumped as to what's going on though. Perhaps the fixes from @6543 will have fixed the issue. What I'll do it is clone the repo and see if I can make it happen locally. Some questions:
Yeah I think this issue is regarding something different and is to do with the old algorithm. Those problems should be a lot less frequent now. |
@zeripath Running on an AWS server:
So no, not Windows. It was occurring right there at the .Close() call I put Printf()s everywhere. It was the Close() for when the repo home page reads the README file and was trying to close it in the defer. I increased my timeout in the config to 600 and it still never returned for the page. However, if I refreshed the page, it would sometimes work. |
Does this imply that the problem is fixed now? |
Should be fixed by #16467 |
I just now today found what was going on with my repos and my 504. I am working from a fork of Gitea for my company which adds features, one being to look at a manifest.yaml file in the root directory of a repo and read it like Gitea does the README.md file. I found since Gitea change to using a CatFileReader, my YAML file reader was closing it when it did a ReadAll(). I just today fixed it to use a MultiReader and leave the CatFileReader open for other batch calls. So it was an error in my own code. |
[x]
):Description
I have a copy of GCC repo on my Gitea instance on LXD container.
I'm trying to browse
gcc/
subdirectory, but it always returned504
error, presumably because the subdirectory contained 946 entries (directories and files). I used to be able to access the subdirectory sometimes in the past.Inspecting using Developer Tools on Firefox, I noticed that the HTTP request during the attempt was initiated by
BrowserTabChild.jsm
script, but slow response time from server (1 minute) might cause the error.I'm running Gitea behind NGINX as reverse proxy, and the relevant NGINX config is:
Screenshots
[not relevant]
The text was updated successfully, but these errors were encountered: