mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 02:24:21 -05:00
Error: routers/repo/http.go:430:serviceRPC() [E] Fail to serve RPC(upload-pack): exit status 128 #4324
Closed
opened 2025-11-02 05:46:08 -06:00 by GiteaMirror
·
24 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1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.0-rc3
v1.4.0-rc2
v1.3.3
v1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#4324
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ianw on GitHub (Nov 15, 2019).
[x]):Description
One of our gitea hosts has started showing a constant error
The numbers are always the same; and it doesn't tell me what repos it is associated with. A slightly longer extract:
I have deleted all the repos and recreated them (using "Reinitialize all missing Git repositories for which records exist") but it is still happened.
I then started to strace the gitea process to see what was going on. I managed to catch what I think is the cause of this error:
This command matches what would be running at https://github.com/go-gitea/gitea/blob/master/routers/repo/http.go#L418 and has the 128 exit code, so I think it matches up. It would be really helpful if this was expressed in the error message.
I'm investigating the host to see if there's any networking type issues that might be affecting clients, although it doesn't look like it to me.
One user who seemed to hit this said that their clone was just stuck for hours, they didn't get an specific error message. They were using git 2.21.0
@lunny commented on GitHub (Nov 15, 2019):
We need a more friendly log on that error.
@zeripath commented on GitHub (Nov 15, 2019):
I'm going to make an educated guess:
I'll try to decode the log properly at some point - it's just ASCII bytes - if you could do that and put it up that would be great - and see if I can put up a pr to make log more reasonably. (It would be a single line pr.)
@ianw commented on GitHub (Nov 15, 2019):
Ha, OK that's a fun one. It works out to
which is base64 decoded
which is indeed what I saw from the strace. So that confirms that :) But it would be great if it correlated which repo/request it was coming from, as I still have no idea.
I don't think any of your suggestions have changed at all. This is part of a 8-node cluster fronted by a haproxy, and it doesn't seem the other nodes are exhibiting this issue. I'm really not sure when it started, which i know isn't helpful :(
@ianw commented on GitHub (Nov 18, 2019):
This is a trace of the git upload-pack process that seems to die and cause this issue 16131.trace.txt
@tbreeds commented on GitHub (Nov 18, 2019):
I'm seeing the issue that @ianw is describing.
We have a local repo that passes
git fsck --fullwithout errors. Talking directly (not through haproxy) to multiple getea servers shows that locally 'upload-pack' seems to block forever.I'm using
git version 2.21.0from Fedora 30. I'm happy to run whatever debugging is needed to diagnose this.@guillep2k commented on GitHub (Nov 19, 2019):
May be some git hook that takes too long? Git would abort on the client side and the server would show that error when the hook finishes.
@ianw commented on GitHub (Nov 19, 2019):
@guillep2k I don't think so; I'm not aware of any hooks really, and you can see in the trace I put up before it happens very quickly?
edit: looking again there's no timestamps, so this is not at all obvious :) but it's not stalling, afaict
@guillep2k commented on GitHub (Nov 19, 2019):
Well, the remote end (i.e. the client) seems to be the one closing the connection, so if it's not because of a timeout, something in the response must be upsetting it. Perhaps the client has the problem? I imagine the following test: clone the repo in another machine (B) and add (B) as a remote for (A); then push your changes from (A) to (B) and see if you succeed; then you can also try pushing from (B) to Gitea after that. Otherwise it's worth looking for more info on the client side to see what's making it abort the connection.
@tbreeds commented on GitHub (Nov 19, 2019):
The client still has an open socket to the gitea server:
The last thing git (with GIT_CURL_VERBOSE) prints is:
So AFAICT the client isn't dropping the connection, an strace on the client doesn't show the any calls to close() on the fd
@guillep2k commented on GitHub (Nov 19, 2019):
OK, but you can see that:
execvemeans that the process will transfer into/usr/bin/git, so anything from there on is git's doing. And that process (git) is printing the "fatal: ..." error. I cannot however pinpoint from your strace which system call is currently returning any errors (they all seem to return normal >= 0 values).Maybe your repo is not in a local file system?
@ianw commented on GitHub (Nov 19, 2019):
@guillep2k all the repos are local; gitea is running in a container and has access to the repos that way. The only thing pushing to gitea is gerrit as it replicates. Otherwise it's read traffic. The interesting thing is that there's a TCP load-balancer between each gitea node. However, haproxy does not appear to be showing any sort of errors
@guillep2k commented on GitHub (Nov 19, 2019):
I don't understand: why are there two instances of gitea? A load balancer suggests a single file-system shared between the instances and that should give you all kinds of problems (not necessarily this one, however). Anyway, it doesn't seem to be Gitea but
gitwho's spitting the errors.As a last messure, I'd consider upgrading to 1.9.6. There has been some rework in the way Gitea handles git resources; especifically to avoid keeping open handles (#8901, #8958). This may be related to your issue.
@ianw commented on GitHub (Nov 19, 2019):
@guillep2k there's no shared file-system in this case; each separate gitea node is on it's own server. gerrit's repos are the one-true-source, and it replicates changes out to the gitea nodes -- it is the only writer. I agree that it looks like git is dying here, but it's very odd that this just started happening.
We are seeing this across multiple servers, however. It's not just one.
I agree we're not being super helpful here as I don't know exactly when this started. I've tried to dump the connection, but it's all just encrypted binary stuff which will take a whole heap of effort to decode in a tracer. But I didn't see anything obvious.
I think we'll have to try upgrading at this point, and if we see the issue continue with 1.9.6 dig deeper.
@tbreeds commented on GitHub (Nov 22, 2019):
@ianw and team upgraded to 1.9.6 and the problem persists.
With the repo below we've recreated the "hang" on a number of Linux distros and git versions
Grab the repo @ https://ozlabs.org/~tony/nova_bad.tar.gz and unpack it and then run something like:
GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_PERFORMANCE=2 GIT_TRACE_PACK_ACCESS=2 GIT_TRACE_PACKET=2 GIT_TRACE_PACKFILE=2 GIT_TRACE_SETUP=2 GIT_TRACE_SHALLOW=2 git -c http.sslVerify=false remote -v updateIt's entirely possible that there is a problem with that repo that
git fsckdoesn't detect but It seems like the client connects to gitea, which exec's git. git dies but gitea doesn't notice and doesn't clean up the client connection.Any ideas of what else to try? If not I'll using a local gitea server at some point next week
@everflux commented on GitHub (Dec 2, 2019):
I suspect that I have the same problem: An existing gitea repo working fine until some commit. After that pushing hangs and the git remote http process hogs a complete cpu core. After 8 minutes a timeout occurs. I deleted the repo and tried to do a clean push, same problem.
Tried aggressive git gc, full fsck, did not help.
Pushing the very same repo to gitlab works without a problem, though it is pushed using ssh instead of https.
Any way to triage this? (I run gitea with sqlite in kubernetes on ARM64 behin traefik as reverse proxy and another traefik as ingress, but I doubt that this has to do with the issue. I think it would help to know which commit triggered the problem, but I have no idea how to search for it.)
@lunny commented on GitHub (Dec 2, 2019):
@tbreeds @everflux Is that repository a public one? If you can share it or find a simliar project, that would help to find the problem.
@everflux commented on GitHub (Dec 2, 2019):
Unfortunately not - I know it is frustrating.
But if there is a script or something to triage the exact commit I am happy to help out. (Something like history replay and try-push each commit?)
@tbreeds commented on GitHub (Dec 2, 2019):
The repo I'm using is public and I have a tarball of my clone that seems to reliably reproduce the git issue on a variety of clients/distributions
@everflux commented on GitHub (Dec 16, 2019):
Can you share the project for @lunny to be able to triage this?
@tbreeds commented on GitHub (Dec 17, 2019):
@everflux @lunny I'm not sure exactly what you need me to share?
@everflux commented on GitHub (Dec 19, 2019):
I assume it would be helpful if you could share your repo and identify the commit from which point the gitea Push fails
@zeripath commented on GitHub (Jan 4, 2020):
Hi peeps! So I finally got round to looking at this.
First of all I can't replicate this on master on sqlite, but I do suspect however, that this might be another example of the tcp port exhaustion issue as I see that you're using MySQL.
You will need to set MAX_OPEN_CONNS, MAX_IDLE_CONNS and CONN_MAX_LIFETIME. In particular you should set MAX_OPEN_CONNS = MAX_IDLE_CONNS.
@everflux commented on GitHub (Jan 4, 2020):
For me it seems that the issue was fixed by forcing the workdir permissions on all files to be reset. It was not the sql lite but the git repository itself it seems.
@zeripath commented on GitHub (Jan 4, 2020):
@everflux if the permissions on the git repository were messed up I could imagine that git would fail in this way.