【问题标题】:Why am I unable to push changes to repo after updating Gitlab?为什么更新 Gitlab 后我无法将更改推送到 repo?
【发布时间】:2020-02-19 21:16:17
【问题描述】:

将 Gitlab 从 12.2.1 更新到 12.4.0 后,我无法将更改推送到 repo。任何分支都存在此问题。

这是我尝试推送时的输出:

remote: GitLab: This action cannot be performed by internal users
To git.repo.com:repo/main-websites/repo.com.git
 ! [remote rejected] branch -> branch (pre-receive hook declined)
error: failed to push some refs to 'git@git.repo.com:repo/main-websites/repo.com.git'

我尝试了以下方法:

  • 重新配置/重启 Gitlab
  • 删除我的本地副本并从头开始克隆,我可以毫无问题地拉取项目,但无法推送。
  • 我尝试在另一台机器上进行更改,同样的情况。
  • 我尝试从 Gitlab 中删除我的 SSH 密钥并重新生成它,但它也没有帮助。

这是我发现的唯一与该问题相关的日志

{
    "method":"POST",
    "url":"http://127.0.0.1:8080/api/v4/internal/allowed",
    "code":"401",
    "body":"{
        "status":false,
        "message":"This action cannot be performed by internal users"
    }",
    "pid":17255,
    "level":"error",
    "msg":"Call failed",
    "time":"2019-10-23T13:55:33+00:00"
}

将感谢任何关于可能导致它的想法,因为我完全被困在这里。

谢谢!

【问题讨论】:

  • 我注意到我之前的提交现在显示为幽灵用户。可能是这个问题,但我仍在寻找解决方案
  • 这似乎是 GitLab 12.4 中的一个错误,请参阅 gitlab.com/gitlab-org/gitlab/issues/35779

标签: git gitlab push git-push


【解决方案1】:

显然 GitLab 实例上带有密钥的文件已损坏。

我已通过以下方式修复它:

  • 我删除了文件:/var/opt/gitlab/.ssh/authorized_keys
  • 从 GitLab Web UI 中删除了所有 SSH 密钥
  • 重新添加键

现在可以正常使用了……

已在此处找到解决方案:https://stackoverflow.com/a/29765704/1544230

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-31
    • 1970-01-01
    • 2019-01-25
    • 1970-01-01
    • 2020-12-20
    • 2016-06-06
    • 2014-01-19
    • 1970-01-01
    相关资源
    最近更新 更多