Runway path属性配置Git仓库链接执行plan报错求助
问题
在Runway的runway.yml模块段的path属性中填入GitHub仓库链接后执行runway plan,返回以下错误:
$ runway plan return self.__git_ls_remote(self.__determine_git_ls_remote_ref()) File "/usr/lib/python3.9/site-packages/runway/sources/git.py", line 77, in __git_ls_remote ls_remote_output = subprocess.check_output(cmd) File "/usr/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['git', 'ls-remote', '', 'HEAD']' returned non-zero exit status 128.
手动执行git clone和git ls-remote <repo_url> HEAD均能正常完成,SSH密钥已添加到GitHub仓库,推测问题与SSH认证或URL解析有关。
配置信息
runway.yml内容:
deployments: name: test-deployment modules: path: git::git://<org>/terraform-google-bigquery.git parameters: dataset_id: "Testing-runway" regions: europe-west2
环境信息
- Runway版本:2.6.8
- 安装方式:PyPI(pip/pipenv/poetry等)
- 操作系统:Red Hat Linux
- Terraform版本:1.5.2
复现步骤
- 在
runway.yml的path属性中添加Git仓库链接 - 执行
runway plan
预期行为
runway plan无错误执行
解决方案
修正Git URL协议格式
当前使用的git://是无认证协议,GitHub已默认禁用该协议。替换为SSH格式的URL:git::git@github.com:<org>/terraform-google-bigquery.git,或完整SSH路径git::ssh://git@github.com/<org>/terraform-google-bigquery.git。确保Runway进程能读取SSH密钥
- 检查Runway运行用户对SSH密钥文件(默认
~/.ssh/id_rsa)的访问权限,密钥文件权限需设为600,所在目录权限设为700。 - 若使用
ssh-agent代理,需确保Runway进程继承代理环境变量(如SSH_AUTH_SOCK)。可在执行runway plan前先执行eval $(ssh-agent -s),再通过ssh-add ~/.ssh/id_rsa添加密钥。
- 检查Runway运行用户对SSH密钥文件(默认
验证Runway的Git URL解析
错误日志显示git ls-remote的URL为空,说明Runway未正确解析path值。确认path格式符合要求:Git模块路径需为git::<url>[?ref=<ref>]格式,无多余符号或空格。升级Runway版本
当前使用的2.6.8版本较旧,可能存在Git URL解析的已知bug。升级至最新稳定版本后重新测试。
内容的提问来源于stack exchange,提问作者Amit Varma
相关产品推荐
相关产品推荐

