Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Error 500 after update 4.2 to 5.0-stable #3271

erikschwalbe opened this Issue Mar 20, 2013 · 12 comments


None yet
10 participants

After update from 4.2 to 5.0-stable:
sudo -u git -H /home/git/gitlab-shell/bin/check
Check GitLab API access: FAILED. code: 302

Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK

You can login to gitlab but you can't see nothing but a error 500.

Thank you for help.



mikkyhouse commented Mar 20, 2013

What does bundle exec rake gitlab:check RAILS_ENV=production say?

There were some little errors but fixing did not solve the problem.
Now all test are green, only the init script is not up to date.

sudo -u git -H /home/git/gitlab-shell/bin/check
Check GitLab API access: FAILED. code: 302

Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK

In the end I use the master branch and this seems to fix the problem.


I get the same error message too on upgrading from 4.2 to 5.0; my server runs ubuntu 10.04 and ruby 1.9.3.

The login page shows up fine; but 500 after that point. @randx I have tried the fix mentioned on SO as well as you have pointed out; but it didn't help. gitlab:check is all green,

ssh -vT git@machine gives the following log:

debug1: Connecting to ip.ip.ip.ip [ip.ip.ip.ip] port 22.
debug1: Connection established.
debug1: identity file /--path/.ssh/identity type -1
debug1: identity file /--path/.ssh/id_rsa type 1
debug1: identity file /--path/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-4ubuntu6

debug1: match: OpenSSH_5.5p1 Debian-4ubuntu6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '--removed-intentionally--' is known and matches the RSA host key.
debug1: Found key in /--path--/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /--path--/.ssh/identity
debug1: Offering public key: /--path--/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Remote: Forced command: /home/git/gitlab-shell/bin/gitlab-shell key-3
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command: /home/git/gitlab-shell/bin/gitlab-shell key-3
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
/usr/local/lib/ruby/1.9.1/json/common.rb:148:in `parse': 743: unexpected token at '<html><
body>You are being <a href="http://localhost/users/sign_in">redirected</a>.</body></html>'
        from /usr/local/lib/ruby/1.9.1/json/common.rb:148:in `parse'
        from /home/git/gitlab-shell/lib/gitlab_net.rb:24:in `discover'
        from /home/git/gitlab-shell/lib/gitlab_shell.rb:28:in `exec'
        from /home/git/gitlab-shell/bin/gitlab-shell:16:in `<main>'
debug1: channel 0: free: client-session, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.4 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 1

Any assistance to fix the issue will be greatly appreciated; everything was fine with 4.2 and I followed the upgrade guide on the site.

thanks a lot

osleg commented Mar 23, 2013

Had same problem too, reboot of server solved it


nbigaouette commented Mar 28, 2013

I just upgraded to gitlab 5.0 on centos 6.3.

Seemed to work, except when clicking on a commit I get a 500 error.
The file /home/git/gitlab/log/production.log revealed:

Started GET "/nicolas.bigaouette/project_name/commit/52da9974dc9d638a9b35a9a60233132acce8fe1b" for at 2013-03-28 13:42:51 -0400
Processing by CommitController#show as HTML
Parameters: {"project_id"=>"nicolas.bigaouette/project_name", "id"=>"52da9974dc9d638a9b35a9a60233132acce8fe1b"}
Rendered commits/_commit_box.html.haml (23.2ms)
Rendered commits/_diff_head.html.haml (5.0ms)
Rendered commits/_diffs.html.haml (135.7ms)
Rendered commit/show.html.haml within layouts/project_resource (291.9ms)
Completed 500 Internal Server Error in 384ms

ActionView::Template::Error (cannot read magic file `/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9/ext/charlock_holmes/dst/share/misc/magic' (Permission denied)):
    40:         .content
    41:           -# Skipp all non non-supported blobs
    42:           - next unless file.respond_to?('text?')
    43:           - if file.text?
    44:             = render "commits/text_file", diff: diff, index: i
    45:           - elsif file.image?
    46:             - old_file = (@commit.prev_commit.tree / diff.old_path) if !@commit.prev_commit.nil?
app/views/commits/_diffs.html.haml:43:in `block in _app_views_commits__diffs_html_haml___1463145195265612201_28926120'
app/views/commits/_diffs.html.haml:17:in `each'
app/views/commits/_diffs.html.haml:17:in `each_with_index'
app/views/commits/_diffs.html.haml:17:in `_app_views_commits__diffs_html_haml___1463145195265612201_28926120'
app/views/commit/show.html.haml:9:in `_app_views_commit_show_html_haml__2377690055133417006_55495160'

Started GET "/static.css" for at 2013-03-28 13:42:52 -0400
Processing by ProjectsController#show as HTML
Parameters: {"id"=>"static.css"}
Rendered public/404.html (74.1ms)
Filter chain halted as :project rendered or redirected
Completed 404 Not Found in 473ms (Views: 278.8ms | ActiveRecord: 6.8ms)

nbigaouette commented Mar 28, 2013

My particular error was fixed by re-installing charlock_holmes according to #3348 (comment)

I still get an error 302 running /home/git/gitlab-shell/bin/check and cannot push:

git push
fatal: Could not read from remote repository.

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

nbigaouette commented Mar 28, 2013

After a bit of search, it seems the error is due to an explicit check on gitlab-shell 1.1.0 while 1.2.0 is installed.

In the file /home/git/gitlab/lib/tasks/gitlab/check.rake around lines 640 there is three references to "1.1.0" (on 4606380). The first one is the check; you can manually change it to "1.2.0" (and all two others for that matter)

Now /home/git/gitlab-shell/bin/check does not fail anymore, and I can push/pull/clone just fine.

alekseyp commented Apr 1, 2013

@nbigaouette, i can confirm it's fixing the gitlab:check

Solved my problem using httpS:// in /home/git/gitlab-shell/config.yml


bbodenmiller commented May 17, 2013

Any problems still using 5.1 stable?


Razer6 commented Jun 8, 2013

Hey @nbigaouette

It's been a month since we heared from you. I'm closing this issue but if you still experience this problem, please report back. Make sure to also include the necessary debug information and we can consider to reopen.

Thanks for your understanding.

@Razer6 Razer6 closed this Jun 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment