Package: git-core Version: 1:1.5.4.1-1 Severity: important Hi,
I'm unable to do HTTP push on a bare git repository, see: host www.example.com should point to 127.0.0.1 in /etc/host and /var/cache/git is a symlink to ~/test-git... ----8<----------------------------------------------------------------- apt-get install apache2 git-core a2enmod dav a2enmod dav_fs a2enmod dav_lock a2enmod authn_file a2enmod authz_user cat << EOF > /etc/apache2/conf.d/git.conf <IfModule mod_dav.c> <IfModule mod_dav_fs.c> <IfModule mod_dav_lock.c> <IfModule mod_authn_file.c> <IfModule mod_authz_user.c> # /git Alias /git /var/cache/git DAVLockDB /var/lock/apache2/DAVLock <Directory /var/cache/git> Options +Indexes DAV On AuthType Basic AuthName "Git repositories access" AuthUserFile /var/cache/git/git.access Require valid-user Order allow,deny Allow from all # Secure access / conf <Files ~ "^git\.access$"> Order allow,deny Deny from all </Files> </Directory> </IfModule> </IfModule> </IfModule> </IfModule> </IfModule> EOF mkdir -p ~/test-git/foobar cd ~/test-git/foobar git init touch .gitignore git add .gitignore git commit -m "Initial empty repository with an empty .gitignore file" git repack && git prune git count-objects echo "Git repository for 'foobar'" > .git/description git config core.bare true git config remote.origin.url http://www.example.com/git/foobar/ # host www.example.com point to 127.0.0.1 in /etc/hosts cd ~/test-git mv ~/test-git/foobar/.git ~/test-git/foobar.git rm -rf ~/test-git/foobar mv ~/test-git/foobar.git ~/test-git/foobar cd ~/test-git/foobar git-update-server-info chgrp www-data -R ~/test-git/foobar chmod g+w -R ~/test-git/foobar # foo / bar echo foo:LZnSp4DCXHOGQ > ~/test-git/git.access /etc/init.d/apache2 reload cat << EOF >> ~/.netrc machine www.example.com login foo password bar EOF ----8<----------------------------------------------------------------- Now we have http://www.example.com/git/foobar clonable git repository ----8<----------------------------------------------------------------- cd /tmp git clone http://www.example.com/git/foobar cd foobar echo "this is a test" > foobar.txt git add foobar.txt git commit -m "foobar.txt test file added." git repack git prune git pull git push ----8<----------------------------------------------------------------- Last command fail with : ----8<----------------------------------------------------------------- Error: cannot lock existing info/refs error: failed to push to 'http://www.example.com/git/foobar' ----8<----------------------------------------------------------------- You can see the apache log in attachement. Regards. Val. -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Kernel: Linux 2.6.18 Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to fr_FR.UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages git-core depends on: ii cpio 2.9-11 GNU cpio -- a program to manage ar ii libc6 2.7-6 GNU C Library: Shared libraries ii libcurl3-gnutls 7.18.0-1 Multi-protocol file transfer libra ii libdigest-sha1-perl 2.11-2 NIST SHA-1 message digest algorith ii liberror-perl 0.17-1 Perl module for error/exception ha ii libexpat1 1.95.8-4 XML parsing C library - runtime li ii perl-modules 5.8.8-12 Core Perl modules ii zlib1g 1:1.2.3.3.dfsg-11 compression library - runtime Versions of packages git-core recommends: ii curl 7.18.0-1 Get a file from an HTTP, HTTPS or ii less 418-1 Pager program similar to more ii openssh-client [ssh-client] 1:4.7p1-2 secure shell client, an rlogin/rsh ii patch 2.5.9-4 Apply a diff file to an original ii rsync 2.6.9-6 fast remote file copy program (lik -- no debconf information
==> /var/log/apache2/access.log <== 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/info/refs HTTP/1.1" 200 59 "-" "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5 libssh2/0.18" 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/objects/81/87e2cf3f6bc67d422b90573d606a759f8c6319 HTTP/1.1" 404 344 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/objects/info/http-alternates HTTP/1.1" 404 323 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/objects/info/alternates HTTP/1.1" 404 318 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/objects/info/packs HTTP/1.1" 200 54 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/objects/pack/pack-e7b8c49375a4901c9446042160ac0f2bd90cc1ae.idx HTTP/1.1" 200 1136 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/objects/pack/pack-e7b8c49375a4901c9446042160ac0f2bd90cc1ae.pack HTTP/1.1" 200 246 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:21 +0000] "GET /git/foobar/HEAD HTTP/1.1" 200 23 "-" "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5 libssh2/0.18" ==> /var/log/apache2/error.log <== [Thu Feb 21 13:33:21 2008] [error] [client 127.0.0.1] File does not exist: /var/cache/git/foobar/objects/81 [Thu Feb 21 13:33:21 2008] [error] [client 127.0.0.1] File does not exist: /var/cache/git/foobar/objects/info/http-alternates [Thu Feb 21 13:33:21 2008] [error] [client 127.0.0.1] File does not exist: /var/cache/git/foobar/objects/info/alternates ==> /var/log/apache2/access.log <== 127.0.0.1 - foo [21/Feb/2008:13:33:23 +0000] "GET /git/foobar/info/refs HTTP/1.1" 200 59 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:23 +0000] "PROPFIND /git/foobar/ HTTP/1.1" 207 539 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:23 +0000] "HEAD /git/foobar/info/refs HTTP/1.1" 200 - "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:23 +0000] "HEAD /git/foobar/objects/info/packs HTTP/1.1" 200 - "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:23 +0000] "MKCOL /git/foobar/info HTTP/1.1" 301 333 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:23 +0000] "MKCOL /git/foobar/info/ HTTP/1.1" 405 325 "-" "git/1.5.4.2" 127.0.0.1 - foo [21/Feb/2008:13:33:23 +0000] "LOCK /git/foobar/info/refs HTTP/1.1" 400 312 "-" "git/1.5.4.2" ==> /var/log/apache2/error.log <== [Thu Feb 21 13:33:23 2008] [error] [client 127.0.0.1] XML Parser Error: XML parser error code: not well-formed (invalid token) (4)