【问题标题】:Repo sync/Git clone is failed only from jenkins's slave回购同步/Git 克隆仅从詹金斯的奴隶失败
【发布时间】:2019-02-22 06:59:43
【问题描述】:

我从詹金斯奴隶执行repo sync

但是错误发生在特定的存储库中。

Cloning into 'repo_name'...
Connection to xxx.xxx.xxx.xxx closed by remote host.
fatal: The remote end hung up unexpectedly

当我手动执行它(不是来自 jenkins)时,repo sync 是成功的。 上述错误只有在jenkins的slave执行时才会出现。

我也尝试在 cmd 之下。但它失败了同样的错误。

git clone ssh://user@xxx.xxx.xxx.xxx:port/path/to/reponame

我参考以下内容尝试git config --global http.postBuffer 524288000。 但它不固定....

The remote end hung up unexpectedly while git cloning

我添加--progress--verbose进行调查

git clone --progress --verbose ssh://user@xxx.xxx.xxx.xxx:port/path/to/reponame

git clone 成功!!

为什么詹金斯的奴隶失败了。 为什么添加--progress --verbose就成功了。

我可以在没有--progress 的情况下修复它吗? (从 jenkins 执行时,repo sync 似乎没有--progress。)

对不起,我的英语不好。

【问题讨论】:

    标签: git jenkins repo


    【解决方案1】:

    这是一个常见问题,可能有不同的原因。 有时是由于您的从机的低日期速度。

    参考这个,

    https://confluence.atlassian.com/bitbucketserverkb/git-clone-fails-fatal-the-remote-end-hung-up-unexpectedly-fatal-early-eof-fatal-index-pack-failed-779171803.html

    谢谢

    【讨论】:

    • 为什么我添加--progress时会成功,因为导致日期速度低。
    • --progress 进度状态在附加到终端时默认在标准错误流上报告,除非指定了-q。即使标准错误流未定向到终端,此标志也会强制执行进度状态。
    【解决方案2】:

    根据以下情况

    https://issues.jenkins-ci.org/browse/JENKINS-9168

    通过 HTTP 克隆大型存储库时,git 服务器会安静一段时间,忙于计算包文件。通常情况下,Apache 的配置使得套接字中的长时间不活动将触发关闭。所以最终用户看到的是,一段时间后,“git clone”由于服务器意外重置连接而失败。

    但是,我无法配置服务器,因为服务器是公共服务器。 所以,

    如果用户在 shell 中尝试相同的命令,Git 会默默地添加 --progress 选项(请参阅手册页中的引用。)这使套接字足够闲聊以避免从 Apache 关闭。

    另一方面,repo 不能添加 --progress 选项。 我没有其他选择,所以我修改了 repo 的脚本。 (.repo/repo/git_command.py)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-25
      • 2018-10-19
      • 1970-01-01
      • 2018-08-02
      相关资源
      最近更新 更多