【发布时间】: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% 问题的答案。 :)