-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
GC task may crash if it encounters an invalid repository #21605
Comments
I have a similar problem, that is GC task stops on first error. I would think that GC task should continue to next repository rather than stopping. If you see a good use case for stopping the whole thing maybe it could be a configuration setting, but I personally don't see a good reason to stop on first error. |
The problem most likely comes from the for i,v := range <something> {
if err := function(v); err != nil {
return err
}
} pattern which is used everywhere in Gitea. |
The current code propagates all errors up to the iteration step meaning that a single malformed repo will prevent GC of other repos. This PR simply stops that propagation. Fix go-gitea#21605 Signed-off-by: Andrew Thornton <art27@cantab.net>
So the majority of the cron tasks don't propagate errors in this way. I'm not sure why this function was different. |
The current code propagates all errors up to the iteration step meaning that a single malformed repo will prevent GC of other repos. This PR simply stops that propagation. Fix #21605 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Backport go-gitea#22422 The current code propagates all errors up to the iteration step meaning that a single malformed repo will prevent GC of other repos. This PR simply stops that propagation. Fix go-gitea#21605 Signed-off-by: Andrew Thornton <art27@cantab.net>
Description
Months ago I had a few migrations that failed for some reason.
I don't mean the follow up syncs, but the initial sync.
A few days ago I started using the garbage collect task to regain some storage space, and I've found these repositories by them stopping the whole GC task.
This means when it gets to one of these repositories, it will stop and won't continue with the remaining ones.
Here is a log excerpt I've saved for reference, from when I've encountered this issue:
On taking a closer look, these repositories had a size of 0 bytes according to the repo list on the management interface (gitea.lan/admin/repos), and their directories were ... not empty, but incomplete, like one of them only had the
hooks
directory, and possibly only part of that even.I've deleted these repositories since then, and have re-migrated them. GC now does not crash at them.
On that, I think I had difficulties in doing that, as (if I remember correctly) it didn't work through the page with the delete button that is shown when I browse to an invalid repository, but it did work from the above mentioned repo list on the management interface.
Unfortunately I don't have logs about this. I really should set up some central log collection service..
Gitea Version
v1.17.3
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.36.2
Operating System
Raspbian
How are you running Gitea?
Gitea runs in a Docker container, which was self-built from this repository according to the Docker.rootless Dockerfile.
Database
MySQL
The text was updated successfully, but these errors were encountered: