【问题标题】:Gitlab 7.8.4 unable to push with SSH or HTTPSGitlab 7.8.4 无法使用 SSH 或 HTTPS 推送
【发布时间】:2015-03-19 14:35:43
【问题描述】:

我们的设置: Gitlab CE Gitlab 7.8.4 Git 外壳:2.5.4 Gitlab API:v3 红宝石:2.1.5p273 导轨:4.1.1

这是测试在一个私有仓库上,该仓库由试图推送到它的同一用户拥有(用户是管理员)。环境检查干净,没有错误。无论我们尝试 HTTPS 还是 SSH,都会出现同样的错误。 SSH 在升级之前工作。

错误:

git push -u origin master
/usr/local/lib/ruby/2.1.0/json/common.rb:155:in `parse': 757: unexpected token at 'false' (JSON::ParserError)
    from /usr/local/lib/ruby/2.1.0/json/common.rb:155:in `parse'
    from /home/git/gitlab-shell/lib/gitlab_access_status.rb:13:in     `create_from_json'
    from /home/git/gitlab-shell/lib/gitlab_net.rb:34:in `check_access'
    from /home/git/gitlab-shell/lib/gitlab_shell.rb:25:in `exec'
    from /home/git/gitlab-shell/bin/gitlab-shell:16:in `<main>'
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists. 

类似问题: https://gitlab.com/gitlab-org/gitlab-ce/issues/838

看起来我们可以通过 HTTPS 和 SSH 进行适当的访问,但是服务器上的某些东西,也许 git-shell 是不正确的。

到目前为止我们做了什么:

sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production

确保 'AllowUsers git' 在 sshd_config 中

ssh-keygen -A
ssh-keygen: generating new host keys: ED25519

尝试了不同版本的 git-shell 回到 2.2.0。

# ssh git@gitlab.domain.com
PTY allocation request failed on channel 0
Welcome to GitLab, Anonymous!
Connection to gitlab.domain.com closed.

【问题讨论】:

  • 能把gitlab-shell/config.yml的内容贴出来吗?
  • 哈。好的。这令人沮丧我从来没有看过那个。我在更新时不知何故在 URL 中引入了一个错字。解决了这个问题。一切正常。
  • 修复 gitlab-shell/config.yml 中的 gitlab_url 是 StackOverflow 上关于推送能力的 90% 问题的答案。 :)

标签: gitlab git-shell


【解决方案1】:

正如 Geoff 所指出的,我的问题是 gitlab-shell/config.yml 配置错误。一旦更正了 gitlab_url 的类型,我们就可以在 HTTPS 和 SSH 上毫无问题地进行推送和拉取。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-11-23
    • 2015-04-21
    • 1970-01-01
    • 1970-01-01
    • 2013-04-08
    • 2021-11-25
    • 1970-01-01
    • 2013-12-04
    相关资源
    最近更新 更多