threads / discuss / 15605

Problems with git over http

Subject: Problems with git over http

## tl;dr

7 messages between Sep 20, 2008 and Sep 21, 2008.

replies: 6people: 4as markdown or json

Sean Davis· Sep 20, 2008, 17:13 UTC · lore

I am new to git and trying to set up a remote repository over http. I have configured apache2 and the bare, empty repository. Using curl, I can get the file HEAD without a password (seems .netrc is correct?). However, when I try to push to the repository, I get the following:

sdavis@lestrade:/tmp/testing> git push http://sdavis@watson.nci.nih.gov/git/sean_git.git/ master fatal: exec http-push failed. error: failed to push some refs to 'http://sdavis@watson.nci.nih.gov/git/sean_git.git/'

What can I do to try to debug this, as the error message isn't helping me to sort out what is wrong. The client and server are both running git-1.5.x (although the minor versions are a bit different). Any suggestions?

Thanks, Sean

Uwe Kleine-König· Sep 20, 2008, 18:42 UTC · re: Sean Davis · lore

Re: Problems with git over http

Hello Sean,
On Sat, Sep 20, 2008 at 01:13:53PM -0400, Sean Davis wrote:
Show 15 quoted lines
> I am new to git and trying to set up a remote repository over http.  I
> have configured apache2 and the bare, empty repository.  Using curl, I
> can get the file HEAD without a password (seems .netrc is correct?).
> However, when I try to push to the repository, I get the following:
> 
> sdavis@lestrade:/tmp/testing> git push
> http://sdavis@watson.nci.nih.gov/git/sean_git.git/ master
> fatal: exec http-push failed.
> error: failed to push some refs to
> 'http://sdavis@watson.nci.nih.gov/git/sean_git.git/'
> 
> What can I do to try to debug this, as the error message isn't helping
> me to sort out what is wrong.  The client and server are both running
> git-1.5.x (although the minor versions are a bit different).  Any
> suggestions?

Try cloning first. And check the error log of apache. I don't know how pushing over http works, but maybe you installed git into /usr/local and /usr/local/bin is not in the PATH for the apache user?

Best regards Uwe

Sean Davis· Sep 20, 2008, 20:40 UTC · re: Uwe Kleine-König · lore

Re: Problems with git over http

On Sat, Sep 20, 2008 at 2:42 PM, Uwe Kleine-König <ukleinek@strlen.de> wrote:
Show 21 quoted lines
> Hello Sean,
>
> On Sat, Sep 20, 2008 at 01:13:53PM -0400, Sean Davis wrote:
>> I am new to git and trying to set up a remote repository over http.  I
>> have configured apache2 and the bare, empty repository.  Using curl, I
>> can get the file HEAD without a password (seems .netrc is correct?).
>> However, when I try to push to the repository, I get the following:
>>
>> sdavis@lestrade:/tmp/testing> git push
>> http://sdavis@watson.nci.nih.gov/git/sean_git.git/ master
>> fatal: exec http-push failed.
>> error: failed to push some refs to
>> 'http://sdavis@watson.nci.nih.gov/git/sean_git.git/'
>>
>> What can I do to try to debug this, as the error message isn't helping
>> me to sort out what is wrong.  The client and server are both running
>> git-1.5.x (although the minor versions are a bit different).  Any
>> suggestions?
> Try cloning first.  And check the error log of apache.  I don't know how
> pushing over http works, but maybe you installed git into /usr/local and
> /usr/local/bin is not in the PATH for the apache user?
Thanks, Uwe.  Good idea.  On the client:

orf-01569049:/tmp sdavis$ git clone http://sdavis@watson.nci.nih.gov/git/sean_git.git/ Initialized empty Git repository in /tmp/sean_git/.git/ cat: /tmp/sean_git/.git/refs/remotes/origin/master: No such file or directory /usr/local/bin/git-clone: line 4: cd: /tmp/sean_git/.git/refs/remotes/origin: No such file or directory fatal: Not a valid object name HEAD

Nothing in the error_log on apache. Why would git be looking for a remotes origin since I am cloning from a remote source?

Sean
Jakub Narebski· Sep 20, 2008, 21:42 UTC · re: Sean Davis · lore

Re: Problems with git over http

"Sean Davis" <sdavis2@mail.nih.gov> writes:
Show 10 quoted lines
> I am new to git and trying to set up a remote repository over http.  I
> have configured apache2 and the bare, empty repository.  Using curl, I
> can get the file HEAD without a password (seems .netrc is correct?).
> However, when I try to push to the repository, I get the following:
> 
> sdavis@lestrade:/tmp/testing> git push
> http://sdavis@watson.nci.nih.gov/git/sean_git.git/ master
> fatal: exec http-push failed.
> error: failed to push some refs to
> 'http://sdavis@watson.nci.nih.gov/git/sean_git.git/'

Errr... to _push_ via https you have to enable WebDAV. See Documentation/howto/setup-git-server-over-http.txt

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Sean Davis· Sep 20, 2008, 22:27 UTC · re: Jakub Narebski · lore

Re: Problems with git over http

On Sat, Sep 20, 2008 at 5:42 PM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 15 quoted lines
> "Sean Davis" <sdavis2@mail.nih.gov> writes:
>
>> I am new to git and trying to set up a remote repository over http.  I
>> have configured apache2 and the bare, empty repository.  Using curl, I
>> can get the file HEAD without a password (seems .netrc is correct?).
>> However, when I try to push to the repository, I get the following:
>>
>> sdavis@lestrade:/tmp/testing> git push
>> http://sdavis@watson.nci.nih.gov/git/sean_git.git/ master
>> fatal: exec http-push failed.
>> error: failed to push some refs to
>> 'http://sdavis@watson.nci.nih.gov/git/sean_git.git/'
>
> Errr... to _push_ via https you have to enable WebDAV.
> See Documentation/howto/setup-git-server-over-http.txt
WebDAV is enabled and authentication is working.
Sean
Matthieu Moy· Sep 21, 2008, 16:25 UTC · re: Sean Davis · lore

Re: Problems with git over http

"Sean Davis" <sdavis2@mail.nih.gov> writes:
Show 8 quoted lines
> I am new to git and trying to set up a remote repository over http.  I
> have configured apache2 and the bare, empty repository.  Using curl, I
> can get the file HEAD without a password (seems .netrc is correct?).
> However, when I try to push to the repository, I get the following:
>
> sdavis@lestrade:/tmp/testing> git push
> http://sdavis@watson.nci.nih.gov/git/sean_git.git/ master
> fatal: exec http-push failed.
Do you have git-http-push somewhere? What does "git http-push" say?

Probably you have a version of Git compiled with a too old libcurl (IIRC, it could have "worked", but a bug in the old libcurl could cause repository corruption, and therefore, git refuses to build http-push with such version of libcurl).

-- 
Matthieu
Sean Davis· Sep 21, 2008, 20:51 UTC · re: Matthieu Moy · lore

Re: Problems with git over http

On Sun, Sep 21, 2008 at 12:25 PM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
Show 17 quoted lines
> "Sean Davis" <sdavis2@mail.nih.gov> writes:
>
>> I am new to git and trying to set up a remote repository over http.  I
>> have configured apache2 and the bare, empty repository.  Using curl, I
>> can get the file HEAD without a password (seems .netrc is correct?).
>> However, when I try to push to the repository, I get the following:
>>
>> sdavis@lestrade:/tmp/testing> git push
>> http://sdavis@watson.nci.nih.gov/git/sean_git.git/ master
>> fatal: exec http-push failed.
>
> Do you have git-http-push somewhere? What does "git http-push" say?
>
> Probably you have a version of Git compiled with a too old libcurl
> (IIRC, it could have "worked", but a bug in the old libcurl could
> cause repository corruption, and therefore, git refuses to build
> http-push with such version of libcurl).

That was dumb on my part. That is, indeed, an issue. Both the mac binary that I found and the rpm for opensuse do not include git-http-push.

Sean

← back to recent threads