会出现:
Exception: Cmd('git') failed due to: exit code(128) cmdline: git clone -v git@github.com:xxx/xxx.git /repos/2 stderr: 'Cloning into '/repos/2'... Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ' host key 认证失败。
Spug 版本:
v3.2.3
。问题重现步骤
当以下情况时:
.ssh/known_hosts
没有该主机记录存在spug-api 以 supervisor 方式启动
ssh_config
默认配置会出现:
Exception: Cmd('git') failed due to: exit code(128) cmdline: git clone -v git@github.com:xxx/xxx.git /repos/2 stderr: 'Cloning into '/repos/2'... Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. '
host key 认证失败。期望的结果
建议:在不影响主机本身
ssh_config
配置的情况下,https://github.com/openspug/spug/blob/376f192f6e16f1514c277a6c586aed8f96693191/spug_api/libs/gitlib.py#L100 加入禁用 host key 检查的选项,参考 https://unix.stackexchange.com/a/33273。