Debugging gitorious local install (ssh-commits not working)

386 views
Skip to first unread message

Stefan Hoth

unread,
Jul 5, 2011, 5:00:25 PM7/5/11
to gito...@googlegroups.com
Hello,

I'm trying to figure out why my ssh-pushes from the same machine aren't working.

I found the problem in the gitorious_auth.log and tried to debug it but I can't figure out how to fix it.

F, [2011-07-05 22:42:49#2629] FATAL -- : Net::HTTPBadResponse wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">": /usr/local/lib/ruby/1.8/net/http.rb:2030:in `read_status_line'
  /usr/local/lib/ruby/1.8/net/http.rb:2017:in `read_new'
  /usr/local/lib/ruby/1.8/net/http.rb:1051:in `request'
  /usr/local/lib/ruby/1.8/net/http.rb:772:in `get'
  /var/www/gitorious/script/../lib/gitorious/ssh/client.rb:84:in `configuration'
  /var/www/gitorious/script/../lib/gitorious/ssh/client.rb:58:in `real_path'
  /var/www/gitorious/script/../lib/gitorious/ssh/client.rb:72:in `to_git_shell_argument'
  /usr/local/bin/gitorious:63

These lines causing the get-request in /var/www/gitorious/lib/gitorious/ssh/client.rb (def configuration):

        if @configuration.empty?
          query_url = "/#{@project_name}/#{@repository_name}/config"
          #$stderr.puts "Querying #{query_url}" if $DEBUG
          resp = connection.get(query_url)
          #$stderr.puts resp
          parse_configuration(resp.body)
        end

Trying to access the repo-config via wget including headers succeeded like:

### HEADERS START ###
HTTP/1.1 200 OK
Date: Tue, 05 Jul 2011 20:55:46 GMT
Server: Apache/2.2.16 (Debian)
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.7
ETag: "967f22334213f237608607a1be3b21e8"
X-Runtime: 2
Cache-Control: public, max-age=600
Content-Length: 83
Status: 200
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/x-yaml; charset=utf-8
### HEADERS END ###
real_path:243/ba4/bf5e64f2231efd34690f0fbe4c5552dcd1.git
force_pushing_denied:false

So everything SEEMS to work but it doesn't. Any ideas how to fix this thing?

Thank you,
Stefan

Rodrigo Rosenfeld Rosas

unread,
Jul 5, 2011, 7:01:59 PM7/5/11
to gito...@googlegroups.com
Is your Gitorious client host configuration set to 'localhost'?

Em 05-07-2011 18:00, Stefan Hoth escreveu:
> Hello,
>
> I'm trying to figure out why my ssh-pushes from the same machine

> aren't working...
>

Stefan Hoth

unread,
Jul 5, 2011, 7:04:55 PM7/5/11
to gito...@googlegroups.com
Hi,


Am Mittwoch, 6. Juli 2011 01:01:59 UTC+2 schrieb Rodrigo Rosenfeld Rosas:
Is your Gitorious client host configuration set to 'localhost'?

Yes, it is.

  # Host the ./script/gitorious script should use:
  gitorious_client_host: localhost 

Is that somehow wrong?

- Stefan

Rodrigo Rosenfeld Rosas

unread,
Jul 5, 2011, 7:21:22 PM7/5/11
to gito...@googlegroups.com
No, that is correct. I was guessing that if it was another name that could not be resolved by the Gitorious server itself, this could be a problem.

Try to log the query_url to some file so that you can try to see the full output using gitorious_client_host:gitorious_client_port/query_url.

But the stacktrace is strange anyway because it seems the problem is not in Gitorious itself but in net/http library of Ruby... How did you install Ruby?

I see you're using Debian, so I may suggest you one of these recipes for installing Gitorious with automated steps using Opscode Chef. The former will install faster. The another one will use REE (Ruby Enterprise Edition) and RVM:

https://github.com/rosenfeld/gitorious-cookbooks (be aware that you should remove the URLs for Gitorious repository and branch from the example configuration to use the mainline one)

http://rosenfeld.heroku.com/en/articles/2011-03-06-installing-gitorious-has-never-been-so-easy - but try to use this another repository as I don't maintain this recipe anymore:
https://github.com/fnichol/chef-gitorious

Good luck!

Stefan Hoth

unread,
Jul 6, 2011, 6:21:15 AM7/6/11
to gito...@googlegroups.com
Hi, 

I finally got my setup working with your help. Thanks for the hints.

First of all: It's worth noticing that /var/www/gitorious/script/gitorious (symlinked to /usr/local/bin/gitorious) has a debug-flag which activates debug output even to the client. Just setting $DEBUG=false to $DEBUG=true in line 14 helped a lot.

I figured out that I have to problems simultaniously. :-)

First of all: The "wrong status line"-error resulted from me forcing the client using port 443.

# Port the ./script/gitorious script should use:
  gitorious_client_port: 443

After changing it back to port 80 the connection was successfully established but another error occured (see below).

Am Mittwoch, 6. Juli 2011 01:21:22 UTC+2 schrieb Rodrigo Rosenfeld Rosas:
No, that is correct. I was guessing that if it was another name that could not be resolved by the Gitorious server itself, this could be a problem.


I have an apache2 running with virtual domain hosting. So one of my virtual domains is now gitorious.dev.mydomain.tld. The problem is that localhost doesn't point to this vhost so with the setting  gitorious_client_host: localhost the client connected to a different setup. Which cause the new error
== Gitorious: ==========================================================
Access denied or wrong repository path
========================================================================

After changing the setting to gitorious_client_host: gitorious.dev.mydomain.tld the connection worked.

 
Try to log the query_url to some file so that you can try to see the full output using gitorious_client_host:gitorious_client_port/query_url.


That was part of the solution as it helped me understand that my wget-test wasn't accurate. After trying exactly what the gitourious-client calls I understood the problem and could figure out a solution.
 

I see you're using Debian, so I may suggest you one of these recipes for installing Gitorious with automated steps using Opscode Chef. The former will install faster. The another one will use REE (Ruby Enterprise Edition) and RVM:

https://github.com/rosenfeld/gitorious-cookbooks (be aware that you should remove the URLs for Gitorious repository and branch from the example configuration to use the mainline one)

http://rosenfeld.heroku.com/en/articles/2011-03-06-installing-gitorious-has-never-been-so-easy - but try to use this another repository as I don't maintain this recipe anymore:
https://github.com/fnichol/chef-gitorious


I installed ruby by using the deb-packages from http://www.rubyenterpriseedition.com/download.html#debian. I started trying on Debian Lenny (5.0) but there were too many errors and problems so I upgraded on Debian Squeeze (6.0) which worked out fine.

To install gitorious in general I followed the instructions on http://gitorious.org/gitorious/pages/DebianSqueezeInstallation and had to adapt some things. For example I had to hack almost every direct call to rake by using "bundle exec rake" because the rake-versions from the installs don't match.

But now my journey seems to have found a end. Wow, I must agree with you: Installing gitorious is very hard. :-)

Thanks for your input,
Stefan

PS: I was so verbose with my post since I HATE finding my problem on a mailing list or forums and then seing the solution "Thanks, fixed it.". So this is for all the Debian-guys who want to have a setup like mine. :-) 

Rodrigo Rosenfeld Rosas

unread,
Jul 6, 2011, 7:34:35 AM7/6/11
to gito...@googlegroups.com
Congratulations, Stefan! And thanks for sharing your experience :)

Em 06-07-2011 07:21, Stefan Hoth escreveu:
> Hi,
>
> I finally got my setup working with your help. Thanks for the hints.

> ...

Reply all
Reply to author
Forward
0 new messages