错误二:CI/CD 流水线失败:ERROR: Job failed: prepare environment: exit status 1.
配置好 Runner 后,测试发现 runner 运行失败,任务终端报:
1 2 3 4 5 6 7 8 9
Running with gitlab-runner 15.10.0 (456e3482) on vm02 SuWk6_nh, system ID: s_b2206b376822 Preparing the "shell" executor 00:00 Using Shell (bash) executor... Preparing environment 00:00 Running on vm02... ERROR: Job failed: prepare environment: exit status 1. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
错误三:CI/CD 流水线失败:HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password.
配置好 Runner 后,测试发现一直失败,查看详情,发现报:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Running with gitlab-runner 15.10.0 (456e3482) on ubuntu2204-001 oPSERo_d, system ID: s_4153648d0c16 Preparing the "shell" executor 00:00 Using Shell (bash) executor... Preparing environment 00:00 Running on ubuntu2204-001... Getting source from Git repository 00:01 Fetching changes with git depth set to 20... Initialized empty Git repository in /home/gitlab-runner/builds/oPSERo_d/0/leazhi/Game-pay/.git/ Created fresh repository. remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See http://gitlab.linuser.com/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied fatal: Authentication failed for'http://gitlab.linuser.com/leazhi/Game-pay.git/' Cleaning up project directory and file based variables 00:00 ERROR: Job failed: exit status 1
ubuntu@vm02:~$ sudo gitlab-runner register Runtime platform arch=amd64 os=linux pid=1451 revision=456e3482 version=15.10.0 Running in system-mode. Enter the GitLab instance URL (for example, https://gitlab.com/): http://gitlab.linuser.com/ Enter the registration token: GR1348941sxMSCXbpWXJQUuQzBgnQ Enter a description for the runner: [vm02]: multipass, vm02 Enter tags for the runner (comma-separated): multipass, vm02 Enter optional maintenance note for the runner:
WARNING: Support for registration tokens and runner parameters in the 'register'command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/380872 ERROR: Registering runner... failed runner=GR1348941sxMSCXbp status=GET https://gitlab.linuser.com/api/v4/runners: 401 Unauthorized PANIC: Failed to register the runner.