go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.45k stars 5.52k forks source link

Setup Mirror failure: Migration failed. Stream 7 was not closed cleanly #31814

Open Slyke opened 3 months ago

Slyke commented 3 months ago

Description

When setting up a mirror for large repositories I get the following error:

migration failed: clone error: exit status 128 - error: RPC failed; curl 92 HTTP/2 stream 7 was not closed cleanly: CANCEL (err 8) error: 2200 bytes of body are still expected fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: invalid index-pack output

Pod log:

anly: CANCEL (err 8)
error: 2916 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
2024/08/10 11:56:04 ...ervices/task/task.go:53:handler() [E] Run task failed: migration failed: clone error: exit status 128 - error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 2916 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
2024/08/10 11:56:06 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/task/33 for 10.244.0.167:0, 200 OK in 11.9ms @ user/task.go:16(user.TaskStatus)

I can mirror smaller repos with no problem. Seems to be an issue with larger ones. I have only tested this with Github repos.

I've seen examples on how to fix this with git. Apparently:

git config http.postBuffer 52428800

Will fix it. Unsure how to set this inside Gitea though.

I tried to get this to happen on the demo site, but the migration just never finishes: https://gitea.com/ny2Jd942gxMtypbx/test

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

Docker

How are you running Gitea?

Running on Kubernetes.

Database

PostgreSQL

Slyke commented 3 months ago

On the Gitea demo site, it timed out after about 24 hours with the following error:

Migrating from https://github.com/qmk/qmk_firmware failed.

error while listing repos: GET https://api.github.com/repos/qmk/qmk_firmware/pulls/9116/reviews/413400876/comments?per_page=100: 500 []
yp05327 commented 1 month ago

If you are using nogogit version, you can execute git config, as Gitea uses git cmd directly. About the Gitea demo site, Github API has access rate limit, maybe it is caused by it. And it is a known issue.

nealey commented 2 days ago

I am running into this consistently, trying to mirror https://github.com/adactio/TheSession-data, which has a few 15MB files checked in.