gitea/gogs在push操作時報RPC failed的問題


原文發布於:https://www.chenxublog.com/2019/05/26/gitea-gogs-push-rpc-failed.html

最近川普在搞出口管制,GitHub也更新了相應的條款,為了防止自己的代碼出什么問題,就自己搭建了一個gitea用來鏡像自己所有在GitHub上面的項目

不過在push一個一百多M大小的倉庫時,報了這樣的錯誤:

git.exe push --progress "2" master:master

Enumerating objects: 768, done.
Counting objects: 100% (768/768), done.
Delta compression using up to 4 threads
Compressing objects: 100% (455/455), done.
Writing objects: 100% (768/768), 57.69 MiB | 84.16 MiB/s, done.
Total 768 (delta 316), reused 708 (delta 290)
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
Everything up-to-date


git did not exit cleanly (exit code 1) (1938 ms @ 2019/5/26 22:08:16)

bing搜了一下,網上常見的解決方法都是更改http.postBuffer的大小,但是沒什么效果

后來在GitHub發現了這個:https://github.com/go-gitea/gitea/issues/5805#issuecomment-477523202

簡單來說就是nginx的上傳大小限制太小了(默認的),改大就可用了:

server
{
    listen 80;
	listen 443 ssl http2;
    server_name git.papapoi.com;
    client_max_body_size 100M; # Push large objects to gitea
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/git.papapoi.com;
	
	#其他設置.....
}

問題完美解決


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM