IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

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

    Teacher Du发表于 2024-11-01 03:51:26
    love 0

    服务器例行维护时,升级了所有的软件。当再次使用 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 的执行用户》一文。



沪ICP备19023445号-2号
友情链接