【问题标题】:Gitlab Runner - listen_address not definedGitlab Runner-未定义listen_address
【发布时间】:2021-12-10 21:07:24
【问题描述】:

我正在我的 Mac 上本地设置 gitlab-runner,以便能够使用 docker 运行构建和测试脚本。我已通过 Gitlab runners 页面上列出的安装说明在本地安装 runner:

# Download the binary for your system
sudo curl --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-darwin-amd64

# Give it permissions to execute
sudo chmod +x /usr/local/bin/gitlab-runner

# The rest of commands execute as the user who will run the Runner
# Register the Runner (steps below), then run
cd ~
gitlab-runner install
gitlab-runner start

据我所知,它安装得很好。然后我像这样注册了一个跑步者:

sudo gitlab-runner register --url https://gitlab.com/ --registration-token $REGISTRATION_TOKEN

(我显然用我的令牌替换了$REGISTRATION_TOKEN)。当它提示我提供更多详细信息时,我输入了以下内容:

  • 标签:(我把这个留空)
  • 输入执行者:docker
  • 输入默认docker镜像:node:14.0.0

然后我收到以下消息:

Runner注册成功。随意启动它,但如果它是 已经运行的配置应该会自动重新加载!

当我导航到项目的根目录时,我尝试运行 gitlab-runner run 但我收到以下错误:

Starting multi-runner from /Users/ben/.gitlab-runner/config.toml...  builds=0
WARNING: Running in user-mode.                     
WARNING: Use sudo for system-mode:                 
WARNING: $ sudo gitlab-runner...                   
                                                   
Configuration loaded                                builds=0
listen_address not defined, metrics & debug endpoints disabled  builds=0
[session_server].listen_address not defined, session endpoints disabled  builds=0
^CWARNING: [runWait] received stop signal             builds=0 stop-signal=interrupt
WARNING: Graceful shutdown not finished properly    builds=0 error=received stop signal: interrupt
WARNING: Starting forceful shutdown                 StopSignal=interrupt builds=0
All workers stopped. Can exit now                   builds=0

当我查看 config.toml 时,如果上面的错误可能暗示它可能缺少某些配置?这是整个文件的猫:

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

我不确定为什么会收到此错误消息?我的配置看起来还好吗?在搜索问题时,我发现另一个线程说只是将“可以运行未标记的作业”设置为是,我已经完成了,但它仍然不起作用......

【问题讨论】:

    标签: javascript node.js gitlab devops


    【解决方案1】:

    您的配置有问题是有道理的。

    如果你仔细阅读输出,它说你在user-mode 中运行,所以我想你是使用gitlab-runner 启动运行器的。

    问题是您使用sudo注册了您的跑步者,因此您在/etc/gitlab-runner/下配置了system-mode。当您使用sudo 启动gitlab-runner 时会加载此配置。

    为了验证这一点,您将能够看到 /etc/gitlab-runner/ 下的注册配置,以及有关 Docker Runners 等的所有附加部分,而不是您在 ~/.gitlab-runner/ 下的基本配置,我想是您附加到您的问题的那个。

    【讨论】:

    • 感谢您的回答。对不起,但我很迷茫如何解决这个问题。您上面提到的内容已经过验证,但是否使用 sudo/卸载并重新安装仍然不起作用
    • 好的,尝试重新注册没有sudo权限的跑步者,告诉我你遇到了什么问题。
    猜你喜欢
    • 2018-08-02
    • 1970-01-01
    • 1970-01-01
    • 2021-04-27
    • 1970-01-01
    • 2021-01-13
    • 2018-04-27
    • 2019-09-03
    • 1970-01-01
    相关资源
    最近更新 更多