1
votes

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 [email protected]
PTY allocation request failed on channel 0
Welcome to GitLab, Anonymous!
Connection to gitlab.domain.com closed.
1
Can you post the contents of gitlab-shell/config.yml?Geoff
Ha. Okay. That's frustratingI never looked at at that. I had somehow introduced a typo in the URL when updating. Fixed that. All works fine.Out of Control
Fixing the gitlab_url in gitlab-shell/config.yml is the answer to 90% of the questions on StackOverflow that regarding ability to push. :)Geoff

1 Answers

0
votes

As Geoff pointed out, my issue was a badly configured gitlab-shell/config.yml. Once the type for gitlab_url was corrected, we were able to push and pull without any issues with HTTPS and SSH.