【Jenkins】发布报错“error: RPC failed; curl 18 transfer closed with outstanding read data remaining”

报错信息:

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

       at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
       ... ...

  本来Jenkins都是正常的,但是突然构建一个job的时候出现了此报错,然后Jenkins上所有的job构建都不成功,同样报这种错误。在网上查找一些资料,最终确认是git的http.postBuffer配置默认值大小的问题,此配置是用来限制git推送大小的,由于代码里有大文件导致拉取代码时postBuffer溢出,所以需要增大http.postBuffer的值。

  解决方法:在服务器上使用命令修改,执行命令时使用Jenkins用户执行

su - jenkins -c "git config --global http.postBuffer 524288000"

  但是,执行后必须要重启Jenkins,不然不会生效的。随后就能在Jenkins的家目录下面看到配置文件 .gitconfig

原文地址:https://www.cnblogs.com/chy-op/p/10063315.html