GitLab Runner macOS作业失败,无法调试
我使用单个macOS GitLab runner来执行iOS作业。运行程序已成功与GitLab配对并接收作业,但作业立即失败,运行程序将向GitLab报告 通过查看运行程序日志,我无法跟踪问题,即使在GitLab Runner macOS作业失败,无法调试,gitlab,gitlab-ci-runner,Gitlab,Gitlab Ci Runner,我使用单个macOS GitLab runner来执行iOS作业。运行程序已成功与GitLab配对并接收作业,但作业立即失败,运行程序将向GitLab报告 通过查看运行程序日志,我无法跟踪问题,即使在--debug模式下运行GitLab运行程序 问题: 这个问题可能与什么有关 如何收集更多关于它的信息 GitLab web界面上的作业报告: Running with gitlab-runner 11.7.0 (8cc638ff) on iMac 8cc638ff Using Shell ex
--debug
模式下运行GitLab运行程序
问题:
Running with gitlab-runner 11.7.0 (8cc638ff)
on iMac 8cc638ff
Using Shell executor...
Running on name-iMac.local...
Fetching changes...
ERROR: Job failed: exit status 1
gitlab runner--debug run
命令的输出:
Checking for jobs... received job=216 repo_url=https://gitlab.local/software/ios.git runner=00000000
Failed to requeue the runner: builds=1 runner=00000000
Running with gitlab-runner 11.7.0 (8bb608ff) job=216 project=34 runner=00000000
on iMac 00000000 job=216 project=34 runner=00000000
Shell configuration: environment: []
dockercommand:
- sh
- -c
- "if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash --login\nelif [
-x /usr/bin/bash ]; then\n\texec /usr/bin/bash --login\nelif [ -x /bin/bash ]; then\n\texec
/bin/bash --login\nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh
--login\nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh --login\nelif [ -x /bin/sh
]; then\n\texec /bin/sh --login\nelif [ -x /busybox/sh ]; then\n\texec /busybox/sh
--login\nelse\n\techo shell not found\n\texit 1\nfi\n\n"
command: bash
arguments:
- --login
passfile: false
extension: ""
job=216 project=34 runner=00000000
Using Shell executor... job=216 project=34 runner=00000000
Waiting for signals... job=216 project=34 runner=00000000
Executing build stage build_stage=prepare_script job=216 project=34 runner=00000000
Executing build stage build_stage=get_sources job=216 project=34 runner=00000000
Executing build stage build_stage=upload_artifacts_on_failure job=216 project=34 runner=00000000
WARNING: Job failed: exit status 1 duration=538.074ms job=216 project=34 runner=00000000
我正在使用的gitlab ci.yml
文件:
stages:
#- unit_tests
- test_flight
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
before_script:
- gem install bundler
- bundle install
# unit_tests:
# dependencies: []
# stage: unit_tests
# artifacts:
# paths:
# - fastlane/screenshots
# - fastlane/logs
# script:
# - fastlane tests
# tags:
# - ios
test_flight_build:
dependencies: []
stage: test_flight
artifacts:
paths:
- fastlane/screenshots
- fastlane/logs
script:
- fastlane beta
tags:
- ios
only:
- /^release-.*$/
- master
- testflight
检查您的~/.bash_配置文件和~/.profile文件中可能会自动失败的行 GitLab Runner在其restore\u cache阶段的顶部执行一个
set-eo pipefail
,这会导致失败的命令(包括配置文件中的任何命令)发出管道错误,使其在该阶段以静默方式退出
就我而言:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
一旦我把这一行注释掉(我在两个文件中都有),我的Mac的GitLab runner就可以运行了
这是一个棘手的问题,因为这并没有导致我的正常终端出现任何错误行为。我必须通过调试运行程序并明确测试脚本来解决这个问题,直到找到失败的脚本为止谢谢您的回复。我用其他方法解决了这个问题,现在它起作用了。你的回答可能对某些用户仍然有效。我很乐意尽我所能提供帮助,我知道我是通过谷歌搜索bing上的内容登陆这里的,所以我想其他人也可能会这么做!你也可以发布你的解决方案吗?不,很遗憾,我不记得我是如何解决这个问题的。这个问题是在我将ruby从2.3.7更新到一个更新版本后开始的。即使回到2.3.7,这些行仍然保留在两个文件中。在我移除这些线之后,gitlab runner又完美地工作了。