云代码部署出错:index-pack failed

现象

有时云代码部署是会报类似这样的错误:

deploy err: Error: 执行命令失败: Error: Command failed: Warning: Permanently added 'xxxx,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
xxx.xxx Tips : [execute command error: exit status 255]
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

这类错误一般是由于从 git 仓库 clone 代码时速度很慢而终端引起的。较多发生在 github 仓库 clone,因为。。。你懂得。

解决办法

使用国内 git 仓库,比如 code.csdn.net,或者 gitcafe.com 等。
或者使用命令行工具部署,文档在 这里

最近大家也反馈 coding.net 也会出现这个问题。

从昨天到今天一直出现这个问题,用的就是coding.net,但我在本机clone是没有问题的,LeanCloud的主机网络状况是否存在问题?

我们确认下。

你好,是否可以贴一下部署时候 clone 的具体命令(包含所有参数,最好能有git 的版本,以及本地的config 配置等等),方便 coding.net 的工程师查找问题呢?

执行命令:

export GIT_SSH=/mnt/avos/data/project_git; git clone git@coding.net:sdjcw/cloud-code-test_v2.git --depth 1 /mnt/avos/data/project

/mnt/avos/data/project_git 的内容

#!/bin/bash
ssh -i /mnt/avos/data/project_rsa $@

/mnt/avos/data/project_rsa 是我项目的私钥

执行结果:

Cloning into '/mnt/avos/data/project'...
Warning: Permanently added 'coding.net,180.150.189.170' (RSA) to the list of known hosts.
Coding.net Tips : [execute command error: exit status 255]
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

你好,多谢帮助,此问题已解决