Project

General

Profile

Redmine 2.2 & Git -> Authentication troubles

Added by nicholas tanner about 11 years ago

hi there

i set up a fresh ubuntu server (12.04, 64bit) with all updates and installed
Redmine according to this tutorial: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu and
Git according to this: http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_git_integration

the installation was ok, but i can't connect to the git repository. everytime i want to clone a repo, i get this error in the apache log:
"AuthUserFile not specified in the configuration"

installed software:
Environment:
Redmine version 2.2.0.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.8
Environment production
Database adapter MySQL

virtual host definitions

<VirtualHost *:80>
    ServerName git.domain.int

    ServerAdmin mail@domain.int
    DocumentRoot "/var/www/git/public" 

    PerlLoadModule Apache::Redmine

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

    <Location "/">
        DAV on
        AuthType Basic
        AuthName "Redmine Git repositories" 
        Require valid-user

        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler

        ## for mysql
        RedmineDSN "DBI:mysql:database=redmine_default;host=localhost" 

        RedmineDbUser "redmine" 
        RedmineDbPass "password" 
        RedmineGitSmartHttp yes
    </Location>
</VirtualHost>

does anyone have an idea what i made wrong??

thanks for any hint!
nicholas


Replies (6)

RE: Redmine 2.2 & Git -> Authentication troubles - Added by Tim Klein about 11 years ago

am having the same problem, same set up apart from using svn

RE: Redmine 2.2 & Git -> Authentication troubles - Added by nicholas tanner about 11 years ago

i tried to find out some more information..

when i try to push with a username, it fails

git push origin master
Password for 'http://admin@git.domain.int:80': 
error: Cannot access URL http://admin@git.domain.int:80/test/, return code 22
fatal: git-http-push failed

the repository config file:

cat .git/config 
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = http://admin@192.168.120.100:81/test
[branch "master"]
    remote = origin
    merge = refs/heads/master

and the apache log (with debug infos from apache and passenger)

[Thu Jan 10 09:06:05 2013] [error] [client 192.168.120.100] AuthUserFile not specified in the configuration
[ pid=14881 thr=70050398902700 file=abstract_request_handler.rb:469 time=2013-01-10 09:06:06.230 ]: Accepting new request on main socket
[ pid=14843 thr=140303190402880 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2013-01-10 09:06:12.648 ]: Flushing all sinks (periodic action)
[ pid=14843 thr=140303190402880 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2013-01-10 09:06:27.642 ]: Flushing all sinks (periodic action)
[ pid=14881 thr=70050398902700 file=abstract_request_handler.rb:469 time=2013-01-10 09:06:28.462 ]: Accepting new request on main socket
[ pid=14853 thr=139933032351552 file=ext/apache2/Hooks.cpp:668 time=2013-01-10 09:06:28.462 ]: Forwarding /test/ to PID 14881
[ pid=14853 thr=139933032351552 file=ext/apache2/Hooks.cpp:862 time=2013-01-10 09:06:28.465 ]: Unexpected error in mod_passenger: An error occured while sending the request body to the request handler: Broken pipe (32)
  Backtrace:
     in 'virtual void Passenger::Session::sendBodyBlock(const char*, unsigned int)' (Session.h:198)
     in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:685)

same, but without a username:

git push origin master
Username for 'http://192.168.120.100:81': admin
Password for 'http://admin@192.168.120.100:81': 
To http://192.168.120.100:81/test
 * [new branch]      master -> master

the repo config

cat .git/config 
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = http://192.168.120.100:81/test
[branch "master"]
    remote = origin
    merge = refs/heads/master

and the log:

[ pid=14843 thr=140303190402880 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2013-01-10 09:07:27.647 ]: Flushing all sinks (periodic action)
[ pid=14852 thr=139933032351552 file=ext/apache2/Hooks.cpp:668 time=2013-01-10 09:07:31.982 ]: Forwarding /test/info/refs to PID 14881
[ pid=14881 thr=70050398902700 file=abstract_request_handler.rb:469 time=2013-01-10 09:07:31.984 ]: Accepting new request on main socket
[ pid=14881 thr=70050398902700 file=abstract_request_handler.rb:469 time=2013-01-10 09:07:32.080 ]: Accepting new request on main socket
[ pid=14885 thr=139933032351552 file=ext/apache2/Hooks.cpp:668 time=2013-01-10 09:07:32.81 ]: Forwarding /test/git-receive-pack to PID 14881
[ pid=14843 thr=140303190402880 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2013-01-10 09:07:42.648 ]: Flushing all sinks (periodic action)

don't know if these logs are helpful..

RE: Redmine 2.2 & Git -> Authentication troubles - Added by Florian Eitel about 11 years ago

The Problem is Redmine.pm doesn't check if user is admin. It only checks if the user has read or write properties to the project. Admin hasn't by default any rights in projects (but you can add admin user manually to a project). The special rights for admin is handled separate in redmine but not in Redmine.pm (see #5070).

Ok, then you should get a "unauthorized"? NO (due this error #11475). If Redmine.pm fails it tries the next auth provider and searches to a AuthUserFile. But none is given. You can fix this adding "AuthUserFile /dev/null".

RE: Redmine 2.2 & Git -> Authentication troubles - Added by nicholas tanner about 11 years ago

Hey Florian

Thanks for your input. But its not a problem of the admin account. I tried it with my normal account (non-admin) and the admin account (assigned to the projects).
But I get always the same error..

Regs
Nicholas

RE: Redmine 2.2 & Git -> Authentication troubles - Added by Steve Platz about 11 years ago

I'm also having the same issue with Redmine 2.2 on two separate servers when used for Subversion access. The module works as intended to allow/deny access, but the log records are filled with AuthUserFile not specified in the configuration.

RE: Redmine 2.2 & Git -> Authentication troubles - Added by Raphael Kallensee almost 11 years ago

Just for the record: I also had this issue. But there's a simple fix to make authentication work again: just add

AuthUserFile /dev/null

e.g. below "Require valid-user". The only issue left is that you still get log entries like

[Wed May 22 23:41:34 2013] [error] [client aa.bb.cc.dd] user xyz not found: /def

all the time, but the authentication works fine. There was some discussion in #11475, but no real solution so far.

    (1-6/6)