Git Daemon (unable to connect to a socket)
$ git clone git://myserver.net/home/git/ehsa/omega_ehsa
Cloning into omega_ehsa…
electricjet.net[0: 66.228.55.188]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
If I run git daemon on the server I get:
$ git daemon
fatal: unable to allocate any listen sockets on port 9418
But yet everything appear to be listening properly:
$ sudo netstat -an | egrep 'Proto|LISTEN'
[sudo] password for tim:
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:9418 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp6 0 0 :::9418 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
I've been Googling for hours on this and am at a loss – anybody have an idea here?
4 Replies
The failure you get from trying to run git daemon manually is likely due to the existing daemon already listening on the port. If you add a "-p" onto the netstat you can verify which process is on which port.
– David
$ nmap 66.228.55.188 -p 9418
Starting Nmap 5.21 (
Nmap scan report for li297-188.members.linode.com (66.228.55.188)
Host is up (0.044s latency).
PORT STATE SERVICE
9418/tcp open git
And now when I run a git clone I get a new error:
$ git clone git://myserver.net/home/git/ehsa/omega_ehsa
fatal: The remote end hung up unexpectedly
So, it appears I solved my original problem but am faced with a new one.
Any ideas to check?
Thanks a ton
> fatal: The remote end hung up unexpectedly
Normally means authentication failed, have you enabled public access to that repo? Does the git daemon user have read access to the files?
The last problem (authentication) was caused by a bad path in my /etc/service/git-daemon/run file (which defaulted to /var/cache/git). Fixed my path and everything is finally running smoothly, thanks for the help.