【问题标题】:Gitlab-ci - Pipeline Fails to runGitlab-ci - 管道无法运行
【发布时间】:2021-01-23 05:36:38
【问题描述】:

当我尝试运行管道时出现以下错误

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

这与 gitlab-runner 权限有关吗?我试过给它完全访问权限,但仍然失败。有人可以帮帮我吗?

我正在遵循 gitlab 上提到的指南 https://docs.gitlab.com/runner/install/linux-manually.html

Gitlab 跑步者 版本:13.4.1 Git 版本:e95f89a0 Git 分支:13-4-稳定 GO版本:go1.13.8 建成:2020-09-25T20:03:43+0000 操作系统/架构:linux/amd64

Ubuntu 经销商编号:Ubuntu 说明:Ubuntu 20.04.1 LTS 发布时间:20.04 代号:焦点

【问题讨论】:

  • 很高兴分享管道中正在发生的事情。从问题中不清楚执行了哪些命令,因此很难提供帮助。

标签: ubuntu amazon-ec2 gitlab gitlab-ci gitlab-ci-runner


【解决方案1】:

我似乎找到了解决方法。

@maksim.danilinhttps://gitlab.com/gitlab-org/gitlab-runner/-/issues/2126

上回答
  • 从 /home/gitlab-runner 中删除 .* 文件中的所有文件
  • 如果您在 gitlab-runner 文件夹中,rm * 应该可以解决问题

此外,请遵循 @Reactgular (How to use sudo in build script for gitlab ci?)

的解决方案
  • gitlab-runner 用户授予sudo 权限
    • $ sudo usermod -a -G sudo gitlab-runner
  • 移除 gitlab-runner 用户的 sudo 密码限制
    • $ sudo visudo
  • 将以下内容添加到文件底部
    • gitlab-runner ALL=(ALL) NOPASSWD: ALL

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-11
    • 2022-06-12
    • 2016-02-25
    • 1970-01-01
    • 2021-11-28
    • 2022-01-19
    • 2022-01-03
    相关资源
    最近更新 更多