threads / discuss / 14119

git-clone works with ssh but not with http/https/git

Subject: git-clone works with ssh but not with http/https/git

## tl;dr

20 messages between Jun 24, 2008 and Jun 25, 2008.

replies: 19people: 9as markdown or json

Erez Zilber· Jun 24, 2008, 11:15 UTC · lore
Hi,
I'm able to git-clone a tree using ssh:

[root@kd001 t]# git-clone ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ erez.zilber@kites's password: remote: Counting objects: 9, done. remote: Compressing objects: 100% (5/5), done. remote: Total 9 (delta 0), reused 0 (delta 0) Receiving objects: 100% (9/9), done.

However, it doesn't work with http/https/git:

[root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ Cannot get remote repository information. Perhaps git-update-server-info needs to be run there?

[root@kd001 t]# git-clone https://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ Cannot get remote repository information. Perhaps git-update-server-info needs to be run there?

[root@kd001 t]# git-clone git://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ kites[0: 172.16.1.11]: errno=Connection refused fatal: unable to connect a socket (Connection refused) fetch-pack from 'git://kites/pub/git/erez.zilber/my_test.git' failed.

What's the problem?

Thanks, Erez

Matthias Kestenholz· Jun 24, 2008, 11:21 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, 2008-06-24 at 14:15 +0300, Erez Zilber wrote:
Show 20 quoted lines
> Hi,
> 
> I'm able to git-clone a tree using ssh:
> 
> [root@kd001 t]# git-clone
> ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
> erez.zilber@kites's password:
> remote: Counting objects: 9, done.
> remote: Compressing objects: 100% (5/5), done.
> remote: Total 9 (delta 0), reused 0 (delta 0)
> Receiving objects: 100% (9/9), done.
> 
> However, it doesn't work with http/https/git:
> 
> [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
> Cannot get remote repository information.
> Perhaps git-update-server-info needs to be run there?
> 

Maybe you should run git-update-server-info in the repository on the server?

> [root@kd001 t]# git-clone https://kites/pub/git/erez.zilber/my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
> Cannot get remote repository information.
> Perhaps git-update-server-info needs to be run there?
Maybe you should run git-update-server-info in the repository on the
server?

By the way, try enabling the post-update hook -- it runs update-server-info for you automatically after pushing to your server (make the script $GIT_DIR/hooks/post-update executable)

Show 6 quoted lines
> [root@kd001 t]# git-clone git://kites/pub/git/erez.zilber/my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
> kites[0: 172.16.1.11]: errno=Connection refused
> fatal: unable to connect a socket (Connection refused)
> fetch-pack from 'git://kites/pub/git/erez.zilber/my_test.git' failed.
> 

Is the git daemon running on your server? You need to configure inetd or git-daemon yourself, that is not done automatically for you.

-- 
http://spinlock.ch/blog/
Erez Zilber· Jun 24, 2008, 11:45 UTC · re: Matthias Kestenholz · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 2:21 PM, Matthias Kestenholz <mk@spinlock.ch> wrote:
Show 24 quoted lines
> On Tue, 2008-06-24 at 14:15 +0300, Erez Zilber wrote:
>> Hi,
>>
>> I'm able to git-clone a tree using ssh:
>>
>> [root@kd001 t]# git-clone
>> ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
>> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
>> erez.zilber@kites's password:
>> remote: Counting objects: 9, done.
>> remote: Compressing objects: 100% (5/5), done.
>> remote: Total 9 (delta 0), reused 0 (delta 0)
>> Receiving objects: 100% (9/9), done.
>>
>> However, it doesn't work with http/https/git:
>>
>> [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git
>> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
>> Cannot get remote repository information.
>> Perhaps git-update-server-info needs to be run there?
>>
>
> Maybe you should run git-update-server-info in the repository on the
> server?

Forgot to mention - I tried to run git-update-server-info from the repository on the server. I got the same results. BTW - if it works OK with ssh, I can only guess that git-update-server-info won't help for http. right?

Show 13 quoted lines
>
>> [root@kd001 t]# git-clone https://kites/pub/git/erez.zilber/my_test.git
>> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
>> Cannot get remote repository information.
>> Perhaps git-update-server-info needs to be run there?
>
>
> Maybe you should run git-update-server-info in the repository on the
> server?
>
> By the way, try enabling the post-update hook -- it runs
> update-server-info for you automatically after pushing to your server
> (make the script $GIT_DIR/hooks/post-update executable)

Make it executable on the client side before pushing (i.e. in .git/hooks/post-update) or on the server side after pushing?

Show 11 quoted lines
>
>> [root@kd001 t]# git-clone git://kites/pub/git/erez.zilber/my_test.git
>> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
>> kites[0: 172.16.1.11]: errno=Connection refused
>> fatal: unable to connect a socket (Connection refused)
>> fetch-pack from 'git://kites/pub/git/erez.zilber/my_test.git' failed.
>>
>
> Is the git daemon running on your server? You need to configure inetd or
> git-daemon yourself, that is not done automatically for you.
>
I ran git-daemon on the server side like this:
sudo git-daemon --base-path=/pub/git/ --export-all --listen=kites
Erez
Johannes Schindelin· Jun 24, 2008, 11:48 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

Hi,
On Tue, 24 Jun 2008, Erez Zilber wrote:
Show 14 quoted lines
> On Tue, Jun 24, 2008 at 2:21 PM, Matthias Kestenholz <mk@spinlock.ch> wrote:
> > On Tue, 2008-06-24 at 14:15 +0300, Erez Zilber wrote:
> >
> >> [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git
> >> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
> >> Cannot get remote repository information.
> >> Perhaps git-update-server-info needs to be run there?
> >>
> >
> > Maybe you should run git-update-server-info in the repository on the
> > server?
> 
> Forgot to mention - I tried to run git-update-server-info from the
> repository on the server.

No, you did not. Otherwise, the message would not appear. It can be that you have _another_ repository on the server, but running update-server-info there does not help.

> I got the same results. BTW - if it works OK with ssh, I can only guess 
> that git-update-server-info won't help for http. right?

Wrong again. ssh transport is special, and does not need the information update-server-info provides.

Hth, Dscho

Erez Zilber· Jun 24, 2008, 12:07 UTC · re: Johannes Schindelin · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 2:48 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 22 quoted lines
> Hi,
>
> On Tue, 24 Jun 2008, Erez Zilber wrote:
>
>> On Tue, Jun 24, 2008 at 2:21 PM, Matthias Kestenholz <mk@spinlock.ch> wrote:
>> > On Tue, 2008-06-24 at 14:15 +0300, Erez Zilber wrote:
>> >
>> >> [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git
>> >> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
>> >> Cannot get remote repository information.
>> >> Perhaps git-update-server-info needs to be run there?
>> >>
>> >
>> > Maybe you should run git-update-server-info in the repository on the
>> > server?
>>
>> Forgot to mention - I tried to run git-update-server-info from the
>> repository on the server.
>
> No, you did not.  Otherwise, the message would not appear.  It can be that
> you have _another_ repository on the server, but running
> update-server-info there does not help.

Thanks for the quick answer. I'm sure that something _is_ wrong. Otherwise, everything should have worked already.

I think that I'm using the right repository for git-clone because it's the same path that I used for git push:

[root@kd001 my_test.git]# git-push --all
ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
erez.zilber@kites's password:
Counting objects: 9, done.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (9/9), 740 bytes, done.
Total 9 (delta 0), reused 0 (delta 0)
To ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
 * [new branch]      master -> master
Now, on the server side:

-sh-3.1$ cd my_test.git/ -sh-3.1$ ls info/ exclude -sh-3.1$ git-update-server-info -sh-3.1$ ls info/ exclude refs

looks like git-update-server-info did some work (added the refs file).
Back to the client:

[root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ Cannot get remote repository information. Perhaps git-update-server-info needs to be run there?

The path is the same path that was used for pushing the repository. What did I miss here?

Thanks, Erez

Jakub Narebski· Jun 24, 2008, 12:25 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

"Erez Zilber" <erezzi.list@gmail.com> writes:
Show 5 quoted lines
> I think that I'm using the right repository for git-clone because it's
> the same path that I used for git push:
> 
> [root@kd001 my_test.git]# git-push --all
> ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
[...]
Show 11 quoted lines
> looks like git-update-server-info did some work (added the refs file).
> 
> Back to the client:
> 
> [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
> Cannot get remote repository information.
> Perhaps git-update-server-info needs to be run there?
> 
> The path is the same path that was used for pushing the repository.
> What did I miss here?
First, obvious question: do you have web server enabled?

Second, less obvious: how this server maps pathname information from URL into path in the filesystem?

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Erez Zilber· Jun 24, 2008, 13:42 UTC · re: Jakub Narebski · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 3:25 PM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 23 quoted lines
> "Erez Zilber" <erezzi.list@gmail.com> writes:
>
>> I think that I'm using the right repository for git-clone because it's
>> the same path that I used for git push:
>>
>> [root@kd001 my_test.git]# git-push --all
>> ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
>
> [...]
>> looks like git-update-server-info did some work (added the refs file).
>>
>> Back to the client:
>>
>> [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git
>> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
>> Cannot get remote repository information.
>> Perhaps git-update-server-info needs to be run there?
>>
>> The path is the same path that was used for pushing the repository.
>> What did I miss here?
>
> First, obvious question: do you have web server enabled?
>
Yes
> Second, less obvious: how this server maps pathname information from
> URL into path in the filesystem?

I guess that the problem is that no proper mapping exists. That's why I see the following in /var/log/httpd/error_log:

[Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not exist: /var/www/html/pub

What do I need to add in /etc/httpd/conf.d/ in order to set the mapping to /pub/git instead of /var/www/html/pub ? Is there an example that shows how to map?

Thanks, Erez

Anton Gladkov· Jun 24, 2008, 13:54 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 05:42:14PM +0400, Erez Zilber wrote:
Show 9 quoted lines
> I guess that the problem is that no proper mapping exists. That's why
> I see the following in /var/log/httpd/error_log:
> 
> [Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not
> exist: /var/www/html/pub
> 
> What do I need to add in /etc/httpd/conf.d/ in order to set the
> mapping to /pub/git instead of /var/www/html/pub ? Is there an example
> that shows how to map?

IMO the simplest way is to create a symlink 'pub' in /var/www/html directory pointing to /pub and to add 'Options FollowSymLinks' to <Directory /> in httpd.conf.

-- 
Best regards,
		Anton
mailto:agladkov@parallels.com
Anton Gladkov· Jun 24, 2008, 13:59 UTC · re: Anton Gladkov · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 05:54:29PM +0400, Anton Gladkov wrote:
Show 13 quoted lines
> On Tue, Jun 24, 2008 at 05:42:14PM +0400, Erez Zilber wrote:
> > I guess that the problem is that no proper mapping exists. That's why
> > I see the following in /var/log/httpd/error_log:
> >
> > [Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not
> > exist: /var/www/html/pub
> >
> > What do I need to add in /etc/httpd/conf.d/ in order to set the
> > mapping to /pub/git instead of /var/www/html/pub ? Is there an example
> > that shows how to map?
> 
> IMO the simplest way is to create a symlink 'pub' in /var/www/html directory
> pointing to /pub and to add 'Options FollowSymLinks' to <Directory /> in httpd.conf.

But, I think it will not help you. AFAIK you need a gitweb.

-- 
Best regards,
		Anton
mailto:agladkov@parallels.com
Matthias Kestenholz· Jun 24, 2008, 14:02 UTC · re: Anton Gladkov · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, 2008-06-24 at 17:59 +0400, Anton Gladkov wrote:
Show 18 quoted lines
> On Tue, Jun 24, 2008 at 05:54:29PM +0400, Anton Gladkov wrote:
> > On Tue, Jun 24, 2008 at 05:42:14PM +0400, Erez Zilber wrote:
> > > I guess that the problem is that no proper mapping exists. That's why
> > > I see the following in /var/log/httpd/error_log:
> > >
> > > [Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not
> > > exist: /var/www/html/pub
> > >
> > > What do I need to add in /etc/httpd/conf.d/ in order to set the
> > > mapping to /pub/git instead of /var/www/html/pub ? Is there an example
> > > that shows how to map?
> > 
> > IMO the simplest way is to create a symlink 'pub' in /var/www/html directory
> > pointing to /pub and to add 'Options FollowSymLinks' to <Directory /> in httpd.conf.
> 
> But, I think it will not help you.
> AFAIK you need a gitweb.
> 

To be able to use the HTTP git transport? No. If you use the HTTP transport to clone a repository, gitweb is not used in any way.

-- 
http://spinlock.ch/blog/
Erez Zilber· Jun 24, 2008, 14:16 UTC · re: Anton Gladkov · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 4:54 PM, Anton Gladkov <agladkov@parallels.com> wrote:
Show 13 quoted lines
> On Tue, Jun 24, 2008 at 05:42:14PM +0400, Erez Zilber wrote:
>> I guess that the problem is that no proper mapping exists. That's why
>> I see the following in /var/log/httpd/error_log:
>>
>> [Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not
>> exist: /var/www/html/pub
>>
>> What do I need to add in /etc/httpd/conf.d/ in order to set the
>> mapping to /pub/git instead of /var/www/html/pub ? Is there an example
>> that shows how to map?
>
> IMO the simplest way is to create a symlink 'pub' in /var/www/html directory
> pointing to /pub and to add 'Options FollowSymLinks' to <Directory /> in httpd.conf.
Adding the symlink solved the cloning with http problem.

Thanks, Erez

Jakub Narebski· Jun 24, 2008, 18:58 UTC · re: Anton Gladkov · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, 24 Jun 2008, Anton Gladkov wrote:
Show 14 quoted lines
> On Tue, Jun 24, 2008 at 05:42:14PM +0400, Erez Zilber wrote:
> >
> > I guess that the problem is that no proper mapping exists. That's why
> > I see the following in /var/log/httpd/error_log:
> > 
> > [Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not
> > exist: /var/www/html/pub
> > 
> > What do I need to add in /etc/httpd/conf.d/ in order to set the
> > mapping to /pub/git instead of /var/www/html/pub ? Is there an example
> > that shows how to map?
> 
> IMO the simplest way is to create a symlink 'pub' in /var/www/html directory
> pointing to /pub and to add 'Options FollowSymLinks' to <Directory /> in httpd.conf.

Another solution (not necessary simplest, but it might be preferred from the security point of view) is to do some URL rewriting / redirection. See your web server documentation for details...

-- 
Jakub Narebski
Poland
Matthieu Moy· Jun 24, 2008, 14:05 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

"Erez Zilber" <erezzi.list@gmail.com> writes:
Show 9 quoted lines
> I guess that the problem is that no proper mapping exists. That's why
> I see the following in /var/log/httpd/error_log:
>
> [Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not
> exist: /var/www/html/pub
>
> What do I need to add in /etc/httpd/conf.d/ in order to set the
> mapping to /pub/git instead of /var/www/html/pub ? Is there an example
> that shows how to map?

Try to access the repository from a web browser first. If you don't have directory listing enabled, opening a file like HEAD should work.

-- 
Matthieu
Johannes Sixt· Jun 24, 2008, 12:41 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

Erez Zilber schrieb:
Show 29 quoted lines
> [root@kd001 my_test.git]# git-push --all
> ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
> erez.zilber@kites's password:
> Counting objects: 9, done.
> Compressing objects: 100% (5/5), done.
> Writing objects: 100% (9/9), 740 bytes, done.
> Total 9 (delta 0), reused 0 (delta 0)
> To ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git
>  * [new branch]      master -> master
> 
> Now, on the server side:
> 
> -sh-3.1$ cd my_test.git/
> -sh-3.1$ ls info/
> exclude
> -sh-3.1$ git-update-server-info
> -sh-3.1$ ls info/
> exclude  refs
> 
> looks like git-update-server-info did some work (added the refs file).
> 
> Back to the client:
> 
> [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/
> Cannot get remote repository information.
> Perhaps git-update-server-info needs to be run there?
> 
> The path is the same path that was used for pushing the repository.
No, it's not. You pushed via ssh, but you clone via http.
When you point your web browser to
 http://kites/pub/git/erez.zilber/my_test.git
what do you see? Error 404 or a directory listing?
-- Hannes
Robert Haines· Jun 24, 2008, 12:35 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

> I ran git-daemon on the server side like this:
>
> sudo git-daemon --base-path=/pub/git/ --export-all --listen=kites

So your clone address for git:// is wrong, you don't need the /pub/git: git clone git://erez.zilber@kites/erez.zilber/my_test.git As you've moved the root of the filesystem as far as git-daemon is concerned to /pub/git with the --base-path option. I suspect a similar problem for http[s] depending on how you've mapped /pub/git into your webserver.

rather than: git clone ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git for ssh which does start at the root of the filesystem.

Cheers, Rob

Erez Zilber· Jun 24, 2008, 13:53 UTC · re: Robert Haines · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 3:35 PM, Robert Haines <rhaines@manchester.ac.uk> wrote:
Show 8 quoted lines
>> I ran git-daemon on the server side like this:
>>
>> sudo git-daemon --base-path=/pub/git/ --export-all --listen=kites
>
> So your clone address for git:// is wrong, you don't need the /pub/git:
> git clone git://erez.zilber@kites/erez.zilber/my_test.git
> As you've moved the root of the filesystem as far as git-daemon is concerned
> to /pub/git with the --base-path option.
I understand. However, when I try to run it according to your suggestion:

[root@kd001 t]# git clone git://erez.zilber@kites/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ fatal: Unable to look up erez.zilber@kites (port 9418) (Name or service not known) fetch-pack from 'git://erez.zilber@kites/erez.zilber/my_test.git' failed.

I also tried to run it without "erez.zilber@":

[root@kd001 t]# git clone git://kites/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ kites[0: 172.16.1.11]: errno=Connection refused fatal: unable to connect a socket (Connection refused) fetch-pack from 'git://kites/erez.zilber/my_test.git' failed.

Is there any log file on the server that can help me trace this problem (something like /var/log/httpd/error_log but for the git protocol)?

Thanks, Erez

Robert Haines· Jun 24, 2008, 14:08 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

Show 18 quoted lines
>> So your clone address for git:// is wrong, you don't need the /pub/ 
>> git:
>> git clone git://erez.zilber@kites/erez.zilber/my_test.git
>> As you've moved the root of the filesystem as far as git-daemon is  
>> concerned
>> to /pub/git with the --base-path option.
>
> I understand. However, when I try to run it according to your  
> suggestion:
>
> [root@kd001 t]# git clone git://erez.zilber@kites/erez.zilber/ 
> my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/ 
> my_test/.git/
> fatal: Unable to look up erez.zilber@kites (port 9418) (Name or
> service not known)
> fetch-pack from 'git://erez.zilber@kites/erez.zilber/my_test.git'  
> failed.

That error is saying that the name of the service is wrong, so you're right to do it without the "erez.zilber@" bit.

Show 8 quoted lines
> I also tried to run it without "erez.zilber@":
>
> [root@kd001 t]# git clone git://kites/erez.zilber/my_test.git
> Initialized empty Git repository in /home/erez.zilber/work/tmp/t/ 
> my_test/.git/
> kites[0: 172.16.1.11]: errno=Connection refused
> fatal: unable to connect a socket (Connection refused)
> fetch-pack from 'git://kites/erez.zilber/my_test.git' failed.

This looks like that either there is nothing listening (if you're running though xinetd have you restarted it? And have you added the right bits to /etc/services?) or there's a firewall in the way... git defaults to 9418 so check that it's open.

> Is there any log file on the server that can help me trace this
> problem (something like /var/log/httpd/error_log but for the git
> protocol)?

on my machine (running via xinetd) it goes straight into /var/log/ messages. A grep -i git on that file should produce something.

Cheers, Rob

Erez Zilber· Jun 24, 2008, 14:45 UTC · re: Robert Haines · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 5:08 PM, Robert Haines <rhaines@manchester.ac.uk> wrote:
Show 31 quoted lines
>>> So your clone address for git:// is wrong, you don't need the /pub/git:
>>> git clone git://erez.zilber@kites/erez.zilber/my_test.git
>>> As you've moved the root of the filesystem as far as git-daemon is
>>> concerned
>>> to /pub/git with the --base-path option.
>>
>> I understand. However, when I try to run it according to your suggestion:
>>
>> [root@kd001 t]# git clone git://erez.zilber@kites/erez.zilber/my_test.git
>> Initialized empty Git repository in
>> /home/erez.zilber/work/tmp/t/my_test/.git/
>> fatal: Unable to look up erez.zilber@kites (port 9418) (Name or
>> service not known)
>> fetch-pack from 'git://erez.zilber@kites/erez.zilber/my_test.git' failed.
>
> That error is saying that the name of the service is wrong, so you're right
> to do it without the "erez.zilber@" bit.
>
>> I also tried to run it without "erez.zilber@":
>>
>> [root@kd001 t]# git clone git://kites/erez.zilber/my_test.git
>> Initialized empty Git repository in
>> /home/erez.zilber/work/tmp/t/my_test/.git/
>> kites[0: 172.16.1.11]: errno=Connection refused
>> fatal: unable to connect a socket (Connection refused)
>> fetch-pack from 'git://kites/erez.zilber/my_test.git' failed.
>
> This looks like that either there is nothing listening (if you're running
> though xinetd have you restarted it? And have you added the right bits to
> /etc/services?) or there's a firewall in the way... git defaults to 9418 so
> check that it's open.

The problem was that it listened to requests coming from the local machine. Now (after fixing that), everything seems to work. Thanks for the help.

BTW - I'm currently running git-daemon in the following way:
sudo git-daemon --base-path=/pub/git/ --export-all
Is there any advantage to run it through xinetd? How do you run it?

Thanks, Erez

Daniel Barkalow· Jun 24, 2008, 17:10 UTC · re: Erez Zilber · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, 24 Jun 2008, Erez Zilber wrote:
Show 5 quoted lines
> BTW - I'm currently running git-daemon in the following way:
> 
> sudo git-daemon --base-path=/pub/git/ --export-all
> 
> Is there any advantage to run it through xinetd? How do you run it?

You probably want to run it from something that init runs, or you'll have to figure it out again when you reboot the server in a while. So you either want a suitable init script (Gentoo, for example, has one in their git package), or to run it through xinetd (which you almost certainly have an init script for).

	-Daniel
*This .sig left intentionally blank*
Erez Zilber· Jun 25, 2008, 06:56 UTC · re: Daniel Barkalow · lore

Re: git-clone works with ssh but not with http/https/git

On Tue, Jun 24, 2008 at 8:10 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 17 quoted lines
> On Tue, 24 Jun 2008, Erez Zilber wrote:
>
>> BTW - I'm currently running git-daemon in the following way:
>>
>> sudo git-daemon --base-path=/pub/git/ --export-all
>>
>> Is there any advantage to run it through xinetd? How do you run it?
>
> You probably want to run it from something that init runs, or you'll have
> to figure it out again when you reboot the server in a while. So you
> either want a suitable init script (Gentoo, for example, has one in their
> git package), or to run it through xinetd (which you almost certainly have
> an init script for).
>
>        -Daniel
> *This .sig left intentionally blank*
>

Thanks. I was able to config xinetd, and everything seems to work now. I would like to thank everyone here for the quick and very useful help.

Erez

← back to recent threads