mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 10:39:38 -05:00
Pushing large amount of data via git-lfs results in HTTP 413 after some time #1253
Closed
opened 2025-11-02 03:54:12 -06:00 by GiteaMirror
·
32 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.16.5
v1.16.4
v1.16.3
v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.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
type/bug
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#1253
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 @simonszu on GitHub (Nov 17, 2017).
[x]):The try-instance seems to use git-lfs (if enabled) via https and does not accept my login credentials
Description
I have problems pushing a very large repository (1.8GB) with git lfs to my gitea instance. git pushes the first 80MB, after that, the counter of already uploaded data jumps between weird values (e.g. it increases, decreases, increases again, and so on), and after some time, i get lots of LFS client errors, which are HTTP 413 status codes reported back from gitea. The last few lines say that there is an authorization error for
info/lfs/objects/batchand the push process stops.This is reproducible for several push attempts. I tried setting the log level to
Debug, but the log file stays quite empty.So i'm asking for help for how to set up Debug logging (i cannot find a list of proper log level options), and i want to notice for this issue in general.
I have configured a Bitbucket Repository as a second remote, and it accepts the big push without problems, so i think it is a server related issue.
@lunny commented on GitHub (Nov 17, 2017):
This maybe a reverse proxy upload size setting problem?
@simonszu commented on GitHub (Nov 21, 2017):
I am not sure. I have played around with different upload size limitations in my reverse proxy, and finally disabled it completely (
client_max_body_size 0;). The result now is this:The first of the 4 Git LFS lines was the output of the push command, which stalled after some time. The other 3 lines are the result of repeatedly pressing the Enter key. I entered the command on 09:08, now it's 09:54, and i am seeing no progress.
@simonszu commented on GitHub (Nov 21, 2017):
Please note that i have another project with LFS data which sums up to about 10MB. This is working perfectly fine with gitea.
@rokups commented on GitHub (Jan 10, 2018):
I am experiencing same issue. I have over 10GB repository and pushing it over ssh fails exactly the same way. I managed to push about 1GB leaving process run over night restarting git push command when it fails. Oddly enough i changed remote to use https and now it has pushed over 800MB without a single error. Could the issue be in ssh?
P.S. @simonszu
you should use email as login credentials for https login as for some reason it does not accept usernames (on my local instance at least).looks like it accepts both login and email, but asks it 3 times. weird.@rokups commented on GitHub (Jan 12, 2018):
I copied my git repository into docker container and tried to push it to gitea without any proxies in the middle. This what happens:
Curious thing is that remote is set to
http://localhost:3000/user/repo.git.@liu-kan commented on GitHub (Jan 25, 2018):
I added this in nginx configure file
But, I still got
I used gitea-docker version
ca30698@sapk commented on GitHub (Jan 26, 2018):
I can replicate similar bug with sqlite. I got server side error
RemoveLFSMetaObjectByOid: database table is locked.I will have a look at it but it seems not related to size but more about concurrency.
@dpopiashvili commented on GitHub (Apr 11, 2018):
Hi
Is there any resolution on this? I'm trying to push a test repository containing ~400MB of LFS files and it fails with authorization error.
c:\temp\Test>git push -u origin master
Git LFS: (0 of 2 files) 0 B / 472.87 MB
batch response: Repository or object not found: https://dato0011:19861967@try.gitea.io/Dato0011/test2.git/info/lfs/objects/batch
Check that it exists and that you have proper access to it
error: failed to push some refs to 'https://dato0011@try.gitea.io/Dato0011/test2.git'
@ghost commented on GitHub (May 29, 2018):
Was it fixed by #4035 ?
@simonszu commented on GitHub (May 29, 2018):
I need to wait for the next release. I like bleeding edge, but compiling from HEAD isn't always a great idea. ;)
@singinwhale commented on GitHub (Jun 8, 2018):
I tried running the master branch and it fixed a similar problem for me: My issue looked like this:
Gitea Bootlog:
Nginx reverse Proxy log:
Git output during upload:
Git output after upload:
I am pushing a commit with a tag (1.0.0) to an existing repo on gitea via SSH and LFS. I have set the new LFS_HTTP_AUTH_EXPIRY_MINUTES value to 3220 (~2 days) as introduced by #4035 and now the 178MB file uploads just fine. As opposed to the Error 401 I got previously. OP had an Error 413 though so I dont know if it is exactly the same issue.
@lafriks commented on GitHub (Jun 8, 2018):
I think #4035 fixes this issue, reopen if issue still persists
@ghost commented on GitHub (Apr 4, 2019):
Actually, I have the same problem (HTTP 413), set size limit on server side to 0, no improvement. 4.7 GB here. Updated to newest Gitlab CE version today, no change.
@rokups commented on GitHub (Apr 4, 2019):
In my case increasing size of post data on reverse proxy helped.
On April 4, 2019 18:23:40 Gerhard notifications@github.com wrote:
@ghost commented on GitHub (Apr 4, 2019):
Could you guide me please a bit to where do what - I'm not directly an expert in these details (I'm glad that Gitlab is working at all...)? I have the Gitlab standard omnibus installation with default webserver.
@jolheiser commented on GitHub (Apr 4, 2019):
@innoreq This is Gitea, not Gitlab, by the way.
@ghost commented on GitHub (Apr 4, 2019):
oh, sorry - I was lead here by some googling for git and lfs... however, the problems seem pretty similar ;-)
@rokups commented on GitHub (Apr 4, 2019):
This is very setup-dependent. I run nginx reverse proxy that redirects traffic to gitea running inside docker container. nginx max post size can be adjusted by setting it up in nginx.conf: https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size.
Edit: I forgot to mention that post size should be that of max size of single file that will be pushed to repository.
@ghost commented on GitHub (Apr 4, 2019):
Thanks a lot - I figured out where the (gitlab)-nginx was sitting, and I found the size limit setting. Now, it behaves differently - still uploading, but no error up to now.
@theAkito commented on GitHub (Oct 29, 2019):
Fixed it. Thanks, @liu-kan !
@nikitaeverywhere commented on GitHub (Apr 28, 2020):
I'm having the same issue: after ~60sec of uploading to LFS it fails.
I am using Kubernetes with nginx ingress (installed from Helm), and playing with
nginx.ingress.kubernetes.io/proxy-body-sizedidn't help.@sapk commented on GitHub (Apr 29, 2020):
60s seems to be the default timeout of nginx. You can try to adjust them (like proxy_read_timeout). http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream_timeout
@nikitaeverywhere commented on GitHub (Apr 29, 2020):
@sapk thanks for suggestions! I tried everything :)
Actually I don't think the timeout is a problem, as underneath git CLI issues a lot of individual uploads which take ~15s at max.
I even tried the direct connection to k8s service using
NodePort(without ingress), no luck there as well, but now it fails with413after ~1min 30s instead of 1 min :) Unfortunately, git CLI seems to start over all the time, which doesn't allow me to upload all the objects even with this strange errors.Gitea pod logs say nothing about a bunch of 413's I see after executing
git pushbut just a number of successful uploads:To add even more details, I am uploading ~1.5 Gb of data which are large jpegs of 5-100mb.
UPDATE by looking at
gitCLI debug trace more closely, I figured out that it certainly fails to upload some files. (not to mention it always try tohttpand then gets308tohttps)55ac260c6a81ab0ddd71be1784f9c13b5aff2ccfe99510b0e24a461e3043627ais 178kb file!UPDATE 2 wasting a bit more time I figured out that this issue is related to http->https redirect. Even the direct connection (Gitea server) returns
httpURL (external host as set up in settings), and then gets 308 tohttpsfrom ingress. Uploading via https for some reason fails, and only for some files...@theAkito commented on GitHub (Apr 29, 2020):
@ZitRos
Maybe you should try to add all the typical
proxy_passparameters to thenginx.conf. I think the configuration is convoluted for you, as opposed to the normal user, that does not use a Kubernetes ingress. For example, the http/s issue you mention is usually solvable by adding theX-Real-IP(or whatever it is called) parameter to thenginx.conf.That said, an ingress is technically just a fancy word for a reverse proxy. So you can edit it like a typical reverse proxy.
@nikitaeverywhere commented on GitHub (Apr 29, 2020):
UPDATE 3 pushing via HTTP is not successful either, however, now it seems not to push because of the size of the objects (~>48mb).
@theAkito thanks! I keep trying :D
@nikitaeverywhere commented on GitHub (Apr 29, 2020):
Damn, it turned to be just a strange ingress issue. I drilled down the Nginx ingress controller and for some reason, it was ignoring any new annotations I was adding to the ingress spec. Deleting the ingress and bringing it back solved the issue! Thanks @theAkito and @sapk for your quick feedback!
UPDATE Still, it doesn't work over https however now the problem is
identified as ingress problem.@nikitaeverywhere commented on GitHub (Apr 29, 2020):
UPDATE2: YAY! Turns out it's git-lfs problem, which doesn't handle 308 redirects properly which results in "file already closed" errors. The latest git-lfs binary (which is not yet released!) works flawlessly!
@theAkito commented on GitHub (Apr 29, 2020):
@ZitRos That is good to know, especially for future readers of this issue.
@kaleko commented on GitHub (May 15, 2020):
I am experiencing this same bug. Has this issue been fixed? I am using
git-lfs/2.11.0 (GitHub; linux amd64; go 1.13.4)@kaleko commented on GitHub (May 15, 2020):
Update. I was able to fix this issue with
git config http.version HTTP/1.1@ltbyun commented on GitHub (May 19, 2020):
gitea v1.11.5, even set nginx client_max_body_size=0, still occurs, my repo size is about 30m. please reopen it @simonszu
http { client_max_body_size 0; }$ git push --set-upstream origin master Enumerating objects: 834, done. Counting objects: 100% (834/834), done. Delta compression using up to 8 threads Compressing objects: 100% (810/810), done. Writing objects: 100% (834/834), 20.17 MiB | 15.75 MiB/s, done. Total 834 (delta 98), reused 0 (delta 0) error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 fatal: the remote end hung up unexpectedly fatal: the remote end hung up unexpectedly Everything up-to-date@theAkito commented on GitHub (May 19, 2020):
@bthulu Perhaps you should open a new issue. It is working for most people, as far as I have seen (including myself). Maybe you have a different root issue.