You are not logged in.

#1 2011-01-22 11:54:50

zexar
Member
Registered: 2009-05-15
Posts: 23

Error "no Dav locking support" when push to gitweb

Hello!
I need to setup a git hub in local network.
I chose apache + gitweb method and set up all according manual. I can clone repository, I can see repositories structure through web browser, but I can't push changes to repository.
As a result of command "git push"

error: no DAV locking support on http://www.github.local/git/project.git/
fatal: git-http-push failed

This is my virtual host config file

<VirtualHost *:80>
    DocumentRoot "/home/www/github"
    ServerName www.github.local
    ErrorLog "/var/log/httpd/github-error_log"
    CustomLog "/var/log/httpd/github-access_log" combined
    LogLevel debug
    RewriteEngine On
    RewriteOptions Inherit
    RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
    
    SetEnv GITWEB_CONFIG /home/www/github/gitweb.conf
    Alias /gitweb /usr/share/gitweb/
    
    ScriptAlias /cgi-bin/ /usr/share/gitweb/
    DirectoryIndex /cgi-bin/gitweb.cgi
    
#    DAVDepthInfinity On
    DavLockDB "/var/lock/httpd/DavLock"
    
    <Directory "/home/www/github/">
    Options Indexes FollowSymlinks ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    
    <Location "/git">
    Dav On
    AuthType Basic
    AuthName "Git"
    AuthUserFile "/home/www/github/passwd.git"
    <LimitExcept GET HEAD PROPFIND OPTIONS REPORT>
        Require valid-user
    </LimitExcept>
    </Location>
</VirtualHost>

Dav locking is set up for repository directory, lock database file too. Access to this file for user http are granted. Users and password are set up too.
If I use non authorized access to repository (like www.github.local) I don't get any password request. In other case (zexar@www.github.local) - I get two requests and I don't know why. I think one of them - is ssh request to host access and second one - to repository but I'm not sure.

Big thanks to any ideas. I have tried to set up this about three days!

Offline

#2 2011-01-24 08:13:21

zexar
Member
Registered: 2009-05-15
Posts: 23

Re: Error "no Dav locking support" when push to gitweb

I have solved this.
There was few mistakes.
First I removed all authentication options so clone/push operations can be done without any trouble.
Second - I remake RewriteRule (using rewrite log). Now it looks like

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^/git/(.*) /cgi-bin/gitweb.cgi/$1 [PT]

Old rewrite rule made direct getting files from repository impossible. All GET requests processed by gitweb.cgi script, so git http client couldn't work repository.

But I have a new trouble.
Push to repository lead to error

Unable to lock remote branch refs/heads/mainMenu
Updating remote server info
fatal: git-http-push failed

But according to apache logs there are all right!

127.0.0.1 - - [24/Jan/2011:09:58:38 +0200] "MKCOL /git/project.git/refs/ HTTP/1.1" 405 998 "-" "git/1.7.3.5"
127.0.0.1 - - [24/Jan/2011:09:58:38 +0200] "MKCOL /git/project.git/refs/heads/ HTTP/1.1" 405 998 "-" "git/1.7.3.5"
127.0.0.1 - - [24/Jan/2011:09:58:38 +0200] "LOCK /git/project.git/refs/heads/mainMenu HTTP/1.1" 200 18382 "-" "git/1.7.3.5"

405 error on MKCOL, as I read, isn't real error. It just shows a directory didn't create. In this case - it exists.
But LOCK retruns 200 status!

How can it be?

Last edited by zexar (2011-01-24 08:14:30)

Offline

#3 2011-01-25 09:25:13

zexar
Member
Registered: 2009-05-15
Posts: 23

Re: Error "no Dav locking support" when push to gitweb

I have done it! Without authorization for a while.
A problem was at RewriteRule again. It was wrong and url's like this '/git/project.git/refs/heads/mainMenu' transforms into '/cgi-bin/gitweb.cgi/git/project.git/refs/heads/mainMenu'. So...
Now my RewriteRule is

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !/git/[a-zA-Z0-9-]+\.git/(HEAD|info|objects|refs)
RewriteRule ^/git/(.*) /cgi-bin/gitweb.cgi/$1 [PT]

and everything works fine!

Offline

Board footer

Powered by FluxBB