Project

General

Profile

Advanced git configuration failure

Added by Малъ Скрылёвъ about 14 years ago

Hello, I've setted up the softwares and their settings according the manual: http://www.redmine.org/wiki/redmine/HowTo_configure_Redmine_for_advanced_git_integration

But apache answers with 'Not Found' message to a browser. If I do
$ git ls-remote http://git.slavlang.org/myrepo
I get:
fatal: http://git.slavlang.org/myrepo/info/refs not found: did you run git update-server-info on the server?

Apache error log don't show anything reasonable.

What can I do to fix the problem?


Replies (16)

RE: Advanced git configuration failure - Added by Felix Schäfer about 14 years ago

  1. Is there anything yet in that repo?
  2. What are the apache error logs for that query?

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

1. What do you mean "yet"?

2. I've monitored /var/log/apache2/errors_log and only last string found in it:
[Thu Sep 16 17:28:14 2010] [notice] Apache/2.2.10 (Unix) DAV/2 Phusion_Passenger/2.2.15 SVN/1.6.12 PHP/5.2.8-pl2-gentoo mod_perl/2.0.4 Perl/v5.8.8 configured -- resuming normal operations

RE: Advanced git configuration failure - Added by Felix Schäfer about 14 years ago

  1. Is it a repo you just created with git init, or is there at least one commit in it?
  2. Can you see the http request in the apache access_log?

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

1. Yes
$ git ls-remote file:///var/www/git.slavlang.org/myrepo/
6c501cc5c08cd0083ad61aa38a6d233a654b24c2 HEAD
6c501cc5c08cd0083ad61aa38a6d233a654b24c2 refs/heads/master
6c501cc5c08cd0083ad61aa38a6d233a654b24c2 refs/remotes/origin/HEAD
6c501cc5c08cd0083ad61aa38a6d233a654b24c2 refs/remotes/origin/master

2. I've found the following line in access log of apache:
...
79.174.78.237 - - [16/Sep/2010:16:48:00 +0400] "GET /myrepo/info/refs HTTP/1.1" 404 9

RE: Advanced git configuration failure - Added by Felix Schäfer about 14 years ago

Ok, that means the request gets to apache, and probably gets to grack. How is grack served, what does its config look like, what user does it run as?

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

This is the changed part of the grack config:

  :project_root => "/var/git/git.slavlang.org",
  :git_path => '/usr/bin/git',

Other place of the config I haven't changed.

This is the apache's vhost.conf:

<VirtualHost *:80>
    ServerName git.slavlang.org

    ServerAdmin webmaster@slavlang.org
    DocumentRoot "/var/www/git.slavlang.org/public" 

    <Directory "/var/www/git.slavlang.org/public">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

RE: Advanced git configuration failure - Added by Felix Schäfer about 14 years ago

Mmh, I think you got some things mixed up… Your grack config tells it to look for repos under /var/git/git.slavlang.org, i.e. when you try to access myrepo, it looks for it in /var/git/git.slavlang.org/myrepo, but above you showed me your repository is in /var/www/git.slavlang.org/myrepo. Please move your repo from /var/www/git.slavlang.org to /var/git/git.slavlang.org and try again.

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

But if I fix config.ru of grack to this:

  :project_root => "/var/git/git.slavlang.org",
  :git_path => '/usr/bin/git',

Will this help?

Please move your repo from /var/www/git.slavlang.org to /var/git/git.slavlang.org and try again.

In this case, I think that I must change apache's vhost.conf to direct to /var/git/git.slavlang.org/public, yes?

RE: Advanced git configuration failure - Added by Felix Schäfer about 14 years ago

No, the problem I can see now is that project_root in the grack config must point to the directory containing your git repositories, and that doesn't need to be a directory apache can access, so unless there is a good reason for not moving your repository from /var/www/git.slavlang.org to /var/git/git.slavlang.org, just move it there. It is not apache that accesses the repositories, so they don't need to be in a directory apache can reach.

Regarding your vhost config, if grack is installed in /var/www/git.slavlang.org, it should be ok.

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

I'll specify, /var/git/git.slavlang.org is folder that contain collection of git-repos, and don't contain the .git folder?

RE: Advanced git configuration failure - Added by Felix Schäfer about 14 years ago

/var/git/git.slavlang.org is the folder that should contain the git repositories, yes, so if you have a repository called myrepo, it would be in /var/git/git.slavlang.org/myrepo, and git ls-remote file:///var/git/git.slavlang.org/myrepo should work too.

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

I've setted up the configuration as you said but got this:

# git ls-remote file:///var/git/git.slavlang.org/myrepo
3d2d82c92ae318076a50fceecefb065d101bb49f    HEAD
3d2d82c92ae318076a50fceecefb065d101bb49f    refs/heads/master

# git ls-remote http://www.slavlang.org/myrepo
fatal: http://www.slavlang.org/myrepo/info/refs not found: did you run git update-server-info on the server?

# git ls-remote http://git.slavlang.org/myrepo
fatal: http://git.slavlang.org/myrepo/info/refs not found: did you run git update-server-info on the server?

The config files are the following:

$ cat /var/www/git.slavlang.org/config.ru
...
  :project_root => "/var/git/git.slavlang.org",
  :git_path => '/usr/bin/git',
...

$ cat /etc/apache2/vhosts.conf
<VirtualHost *:80>
    ServerName git.slavlang.org

    ServerAdmin webmaster@slavlang.org
    DocumentRoot "/var/www/git.slavlang.org/public" 

    <Directory "/var/www/git.slavlang.org/public">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

What can I do yet?

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

# tail /var/log/apache2/error_log
...
error: unable to update .git/info/refs+
error: cannot open .git/objects/info/packs+

RE: Advanced git configuration failure - Added by Felix Schäfer about 14 years ago

Mmh, just to make sure: what git version do you have on the client? The requests in access_log look like this for me: /myrepo/info/refs?service=git-upload-pack, while you said you had /myrepo/info/refs, which is the sign for a client that can't do "smart-http" yet, which in turn won't work with grack.

RE: Advanced git configuration failure - Added by Малъ Скрылёвъ about 14 years ago

thanx, it was older version of git then required...

    (1-16/16)