「GitLab CI/CD」- 常见错误汇总

  CREATED BY JENKINSBOT

Runner-related

… prepare environment: Process exited with status 1 …

问题描述:

...
ERROR: Job failed: prepare environment: Process exited with status 1. Check http
s://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more info
rmation
...

环境信息:
GitLab Runner 15.2.2, SSH Executor

原因分析:
https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading

解决方案:
rm -rf $HOME/.bash_logout

… /root/.ssh/known_hosts: no such file or directory …

Types of shells supported by GitLab Runner | GitLab
“ssh: handshake failed: knownhosts: key is unknown” error for VirtualBox executor
SSH | GitLab

问题描述:

Using SSH executor...
ERROR: Preparation failed: ssh command Connect() error: getting host key callback: open /root/.ssh/known_hosts: no such file or directory
Will be retried in 3s ...

环境信息:
GitLab Runner 15.2.2, SSH Executor

原因分析:Introduced in GitLab 14.3. To enable SSH StrictHostKeyChecking, make sure the [runners.ssh.disable_strict_host_key_checking] is set to false. The current default is true. In GitLab 15.0 and later, the default value is false, meaning host key checking is required.

解决方案:

[[runners]]
...
  [runners.ssh]
    disable_strict_host_key_checking = true
...