Project

General

Profile

Problem with redmine advanced git integration

Added by Marcel Eeken over 14 years ago

Hey All

I am trying to enable the redmine advanced git integration but i can't get it to work.

I have my repositories in the directory /srv/git/ this folder and its subfolders is owned by www-data.

I have followed the instruction of the wiki until the point of HowTo_configure_Redmine_for_advanced_git_integration and there i run in my first problem. I am not that experienced with apache so I wasn't exactly sure where to place the configuration data, it's know placed apache/sites-available/default. This file now looks like this:

<VirtualHost *>
        ServerName www.mysite.nl

        ServerAdmin admin@mysite.nl

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        <Directory /var/www/redmine>
                RailsBaseUri /redmine
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/" 
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

<VirtualHost *>
        ServerName git.mysite.nl

        ServerAdmin admin@mysite.nl
        DocumentRoot /var/www/git.mysite.nl/public

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

Now when i try to execute the git ls-remote http://git.myhost.com/myrepo to my repo on the server i get the following message:

$ git clone http://git.mysite.nl/myrepo/.git
Initialized empty Git repository in g:/projects/test/myrepo/.git/
fatal: http://git.mysite.nl/myrepo/.git/info/refs not found: did you run
git update-server-info on the server?


Replies (11)

RE: Problem with redmine advanced git integration - Added by Felix Schäfer over 14 years ago

You need bare repositories for redmine, and especially for this integration too, but it seems you're hitting your problem before that.

It seems you have installed grack, right? Do you have passenger installed too?

RE: Problem with redmine advanced git integration - Added by Marcel Eeken over 14 years ago

Indeed i have grack installed, and i use passenger version 2.2.7.

Also the repository is bare.

This is in my passenger.conf file in apache2/mods-available

<IfModule mod_passenger.c>
  PassengerRoot /usr
  PassengerRuby /usr/bin/ruby
  PassengerDefaultUser www-data
</IfModule>

RE: Problem with redmine advanced git integration - Added by Felix Schäfer over 14 years ago

Ok, I'll go with "passenger is working", have you put the right paths in the config.ru from grack? Also note that passenger runs grack as the user owning config.ru, please confirm this user has read (and ultimately also write) permissions on the git repositories and the whole path to there. Last place to check: have a look at your apache logs and see if anything shows up there.

RE: Problem with redmine advanced git integration - Added by Marcel Eeken over 14 years ago

I have set the permissions for the entire path to the repo the same as the config.ru permissions.

But when i look in the error.log file i get these messages

[Mon Jul 26 21:05:07 2010] [error] [client MyIp] File does not exist: /var/www/myrepo

But config.ru looks like this:

$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/lib')

use Rack::ShowExceptions

require 'lib/git_http'

config = {
  :project_root => "/srv/git",
  :git_path => '/usr/lib/git-core/git',
  :upload_pack => true,
  :receive_pack => true,
}

run GitHttp::App.new(config)

So that looks like it points to the right directory for the repositories.

RE: Problem with redmine advanced git integration - Added by Felix Schäfer over 14 years ago

The error_log entries show that your git requests don't even get served by the git.mysite.nl part because the first virtualhost already serves all request. Try adding NameVirtualHost * at the top of the file and restart apache, that should make apache aware that you want the different hostnames handled by different vhosts.

RE: Problem with redmine advanced git integration - Added by Marcel Eeken over 14 years ago

Thanks now i get the right response back.

RE: Problem with redmine advanced git integration - Added by Felix Schäfer over 14 years ago

Just out of curiosity: what or whom are you using redmine for?

RE: Problem with redmine advanced git integration - Added by Marcel Eeken over 14 years ago

For personal project, and something i am building with a friend of me.

RE: Problem with redmine advanced git integration - Added by Marcel Eeken over 14 years ago

I still have some problems with getting this to work properly.

I now have 2 repositories on my server both are created as bare repositories and linked to a public project on my redmine installation.

When i run the git clone command on one them it works normal and i get the data from the repository but when i try to clone the other i get a http 401 error. I have tried different commands to clone the repository.

On the one that works i can use the command "git clone http://git.mysite.nl/myrepo/.git" but when i try that on the other repo i get the 401 error. So i tried it with "git clone http://admin@git.mysite.nl/test" and i still get the error.

Both repositories are owned by the same users and everything is chmod to the same rights.

$ git clone http://git.mysite.nl/test
Initialized empty Git repository in g:/projects/test/test/.git/
error: The requested URL returned error: 401 while accessing http://git.mysite
.nl/test/info/refs

fatal: HTTP request failed

In my logs i cant find anything that stands out as the problem

RE: Problem with redmine advanced git integration - Added by Felix Schäfer over 14 years ago

They not only have to be linked to but also have the same name as the project's identifier. Is that the case?

Please also have a look if the misbehaving repository actually has a file called info/refs.

RE: Problem with redmine advanced git integration - Added by Marcel Eeken over 14 years ago

Thanks i've got that one working now.

The problem was that the repo didn't have the same name as the identifier, this wasn't in the documentation that i used.

    (1-11/11)