Skip to contentSkip to conversation

Git Daemon on Windows fatal error.

DISCUSSION Hector Santos 2 participants 2 messages May 31, 2017 – Jun 1, 2017

lore
Share & tools
lore
#0 lore raw

Hi, I am relatively new to GIT (coming from CVS and SVN) and I am trying to setup "Git Daemon" on windows.

I got it working for Local network communications:

d:\local\wc5\testgit>git clone git://localhost/http clone10 Cloning into 'clone10'...
remote: Counting objects: 526, done.
remote: Compressing objects: 100% (520/520), done. Receiving objects: 100% (526/526), 1.38 MiB | 0 bytes/s, done.
remote: Total 526 (delta 81), reused 0 (delta 0) Resolving deltas: 100% (81/81), done.

but it fails over the wire when using the public host domain:

d:\local\wc5\testgit>git clone git://public.example.dom/http clone11 Cloning into 'clone11'...
remote: Counting objects: 526, done.
remote: Compressing objects: 100% (520/520), done.
remote: Total 526 (delta 81), reused 0 (delta 0)
fatal: read error: Invalid argument
fatal: early EOF
fatal: index-pack failed

Sometimes its a different initial fatal error but generally the same. Once or twice, a repeat MAY work, but often not.

Short of digging into the git source code, I did as much research online and tried the various config options suggestions, changing the packet size, etc, to no avail.

To me, this seems like a "Socket Half Close" problem. If anyone is aware of what appears to be a long time "known" problem, and have a real solution, it would be greatly appreciated. Otherwise, I am very interesting in exploring the Half Close solution as I've seen similar behavior in other internet hosting servers in the past. A simple closesocket() wrapper funciton did the trick:

// HalfCloseSocket() performs a TCP Half Close by calling shutdown() // which signals the remote that no more data is going to be // sent (FIN signal). HalfCloseSocket() then goes into a // recv() loop to wait for the remote to acknowledge the close. // This acknowledgment comes as a recv() return value
// of zero (less).

BOOL HalfCloseSocket(SOCKET socket)

{
    if (shutdown(socket,SD_SENT) != 0) {
        return FALSE;
    }
    int ret = 0;
    int msecs = 10; // poor man sanity check
    char buf[8*1024];
    while ((ret = recv(socket, buf,sizeof(buf),0)) > 0) {
        buf[0] = 0;
        buf[1] = 0;
        msecs--;
        if (msecs == 0) break;
    }
    return closesocket(socket);
}

While I rather not get into the source, I am willing to explore the effort if there is no other option.

Thanks for any input you can provide

Hector Santos
Santronics Software, Inc.

Signature · 1 line
HLS
#1 lore raw
Quoted 23 lines · Hector Santos

Hi, I am relatively new to GIT (coming from CVS and SVN) and I am trying to setup "Git Daemon" on windows.

I got it working for Local network communications:

d:\local\wc5\testgit>git clone git://localhost/http clone10 Cloning into 'clone10'...
remote: Counting objects: 526, done.
remote: Compressing objects: 100% (520/520), done. Receiving objects: 100% (526/526), 1.38 MiB | 0 bytes/s, done.
remote: Total 526 (delta 81), reused 0 (delta 0) Resolving deltas: 100% (81/81), done.

but it fails over the wire when using the public host domain:

d:\local\wc5\testgit>git clone git://public.example.dom/http clone11 Cloning into 'clone11'...
remote: Counting objects: 526, done.
remote: Compressing objects: 100% (520/520), done.
remote: Total 526 (delta 81), reused 0 (delta 0)
fatal: read error: Invalid argument
fatal: early EOF
fatal: index-pack failed

Quoted 1 line

Sometimes its a different initial fatal error but generally the same. Once or twice, a repeat MAY work, but often not.

[] snip

First of all, welcome to Git.
Second, which version of Git are you using ? And which version of Windows ? Third, I don't think that this has to do with Git Daemon.
When I look at "read error: Invalid argument", it may be fixed in the latest version.
And that why it is important to know the version you are using.

And, there is a special place to report problems with Git for Windows:
https://github.com/git-for-windows/git/wiki (hope I got it right), but please feel free to continue here on the mailing list.