1

Our setup: Gitlab CE Gitlab 7.8.4 Git-shell: 2.5.4 Gitlab API: v3 Ruby: 2.1.5p273 Rails: 4.1.1

This is test is on a private repository owned by the same user that is trying to push to it (user is admin). Environment check is clean with no errors. Same error whether we try HTTPS or SSH. SSH worked before the upgrade.

Error:

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. 

Similar issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/838

It would appear that we have proper access via HTTPS and SSH, but something on the server, perhaps with git-shell is not right.

What we've done so far:

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

Made sure 'AllowUsers git' was in sshd_config

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

Tried different version of git-shell back to 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.
4

1 回答 1

0

正如 Geoff 指出的那样,我的问题是配置错误的 gitlab-shell/config.yml。一旦更正了 gitlab_url 的类型,我们就可以推送和拉取,而 HTTPS 和 SSH 没有任何问题。

于 2015-03-27T03:21:36.053 回答