解决 gitlab-runner 部署时 Host key verification failed 的报错问题

问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Running with gitlab-runner 14.6.0 (5316d4ac)
on iZ2ze3ifc44ezcec5t2nhrZ mzVoCiZK
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:01
Running on iZ2ze3ifc44ezcec5t2nhrZ...
Getting source from Git repository
00:00
Fetching changes with git depth set to 50...
Initialized empty Git repository in /home/gitlab-runner/builds/mzVoCiZK/0/penndu/dusays/.git/
Created fresh repository.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
ERROR: Job failed: exit status 1

注意:上面是部署时报错。

解决

杜老师一开始以为是密钥的问题,曾尝试同步了客户端和服务端的密钥,但还是会报错,且报错的内容不变。

后来直接设置了 SSH 免密登录,问题仍然存在,但报错的内容变了。

提示是权限的问题,于是修改 gitlab-runner 的运行用户,成功搞定。

遇到同样问题的小伙伴,可以参考《修改 gitlab-runner 的执行用户》一文。

本文链接:https://my.lmcjl.com/post/18307.html

展开阅读全文

4 评论

留下您的评论.