threads / discuss / 25545

git via http problem

Subject: git via http problem

## tl;dr

5 messages between Oct 25, 2010 and Oct 26, 2010.

replies: 4people: 2as markdown or json

Aleksey Egorov· Oct 25, 2010, 10:34 UTC · lore
Good day
I have installed apache2, Webdav and git-core on my Debian.
I added next information to the apache conf
        Alias /linter.git /var/www/linter.git
<Location /linter.git>
DAV On
AuthType Basic
Authname "localhost"
AuthUserFile /etc/apache2/users/pwd
Require valid-user
</Location>
pwd file was created by htpasswd, wich contain user test and password test.
my home/.netrc file contains
       machine localhost
       login test
       password test
And then when I type
       git push upload master
I see next errors
      error: Cannot access URL http://localhost/linter.git/, return code 22
      error: failed to push some refs to 'http://localhost/linter.git/'
In browaser all is ok, when I type http://localhost/linter.git/, user test and
password test, it shows directory on the server.
If I change apache conf to
      Alias /linter.git /var/www/linter.git
<Location /linter.git>
DAV On
AuthType Basic
Authname "localhost"
</Location>
git starts normal:
     git push upload master
     Fetching remote heads...
     refs/
     refs/heads/
     refs/tags/
     updating 'refs/heads/master'
     from 0000000000000000000000000000000000000000
     to aa36be4c3e46e619f73faa0cea071688cb380d25
What is the problem can be?
Tay Ray Chuan· Oct 25, 2010, 12:39 UTC · re: Aleksey Egorov · lore

Re: git via http problem

Hi,
On Mon, Oct 25, 2010 at 6:34 PM, Aleksey Egorov <alekseyandni@mail.ru> wrote:
Show 7 quoted lines
> If I change apache conf to
>      Alias /linter.git /var/www/linter.git
> <Location /linter.git>
> DAV On
> AuthType Basic
> Authname "localhost"
> </Location>
I noticed that you left out AuthUserFile here.
Could it be that you didn't load mod_authn_file? (wild guess)

Also, what version of git are you running? I'm guessing it's an authentication problem.

-- 
Cheers,
Ray Chuan
Алексей Егоров· Oct 25, 2010, 13:12 UTC · lore

Re[2]: git via http problem

I'm using git-core 1:1.5.6.5-3+lenny3.2
I can see list of files using cadaver: 
cadaver http://test@localhost/linter.git
Authentication required for localhost on server `localhost':
Username: test
Password: 
dav:/linter.git/> ls
Listing collection `/linter.git/': succeeded.
Coll:   branches                               0  Окт 25 12:45
Coll:   hooks                                  0  Окт 25 12:45
Coll:   info                                   0  Окт 25 12:45
Coll:   objects                                0  Окт 25 12:45
Coll:   refs                                   0  Окт 25 12:45
        HEAD                                  23  Окт 25 12:45
        config                                66  Окт 25 12:45
        description                           58  Окт 25 12:45
dav:/linter.git/> quit
Connection to `localhost' closed.
In /etc/apache2/mods-enabled   I see @authn_file.load  with the text
 LoadModule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so
Mon, 25 Oct 2010 20:39:44 +0800 письмо от Tay Ray Chuan <rctay89@gmail.com>:
Show 16 quoted lines
> Hi,
> On Mon, Oct 25, 2010 at 6:34 PM, Aleksey Egorov <alekseyandni@mail.ru> wrote:
> > If I change apache conf to
> > ? ? ?Alias /linter.git /var/www/linter.git
> > <Location /linter.git>
> > DAV On
> > AuthType Basic
> > Authname "localhost"
> > </Location>
> I noticed that you left out AuthUserFile here.
> Could it be that you didn't load mod_authn_file? (wild guess)
> Also, what version of git are you running? I'm guessing it's an
> authentication problem.
> -- 
> Cheers,
> Ray Chuan
Tay Ray Chuan· Oct 25, 2010, 14:20 UTC · re: Алексей Егоров · lore

Re: Re[2]: git via http problem

Hi,
2010/10/25 Алексей Егоров <alekseyandni@mail.ru>:
> I'm using git-core 1:1.5.6.5-3+lenny3.2
> I can see list of files using cadaver:
Probably a problem with git. Could you try updating your git installation?
-- 
Cheers,
Ray Chuan
Алексей Егоров· Oct 26, 2010, 07:40 UTC · lore

Re[4]: git via http problem

I installed git-core git/1.7.1 from Squeeze branch compilled for lenny. Now when i type git push upload master

it request password twice (I entered right password test and test)
Password: 
Password: 
and then shows:
Fetching remote heads...
  refs/
  refs/heads/
  refs/tags/
updating 'refs/heads/master'
  from 0000000000000000000000000000000000000000
  to   aa36be4c3e46e619f73faa0cea071688cb380d25
    sending 183322 objects
LOCK HTTP error 412
Unable to refresh lock for http://test@localhost/linter.git/info/refs
LOCK HTTP error 412
Unable to refresh lock for http://test@localhost/linter.git/info/refs
LOCK HTTP error 412
Unable to refresh lock for http://test@localhost/linter.git/refs/heads/master
LOCK HTTP error 412
Unable to refresh lock for http://test@localhost/linter.git/info/refs
LOCK HTTP error 412
Unable to refresh lock for http://test@localhost/linter.git/refs/heads/master
UNLOCK HTTP error 400
LOCK HTTP error 412
Unable to refresh lock for http://test@localhost/linter.git/info/refs
Updating remote server info
UNLOCK HTTP error 400
fatal: git-http-push failed
 
What is the problem can be?
Mon, 25 Oct 2010 22:20:05 +0800 письмо от Tay Ray Chuan <rctay89@gmail.com>:
Show 8 quoted lines
> Hi,
> 2010/10/25 Алексей Егоров <alekseyandni@mail.ru>:
> > I'm using git-core 1:1.5.6.5-3+lenny3.2
> > I can see list of files using cadaver:
> Probably a problem with git. Could you try updating your git installation?
> -- 
> Cheers,
> Ray Chuan

← back to recent threads