{"thread":{"id":"3492","subject":"fatal: unexpected EOF","startedAt":"2006-02-28T13:02:15Z","lastAt":"2006-03-02T22:23:28Z","messageCount":5,"participants":["Brian Gerst","Linus Torvalds","Tony Luck","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"16902","messageId":"440449D7.3010508@didntduck.org","threadId":"3492","inReplyTo":null,"subject":"fatal: unexpected EOF","fromName":"Brian Gerst","fromEmail":"bgerst@didntduck.org","sentAt":"2006-02-28T13:02:15Z","receivedAt":"2006-02-28T13:02:15Z","isPatch":false,"sender":{"key":"bgerst@didntduck.org","avatar":null},"body":"Lately I've been receiving this error frequently from git.kernel.org:\n\nFetching pack (head and objects)...\nfatal: unexpected EOF\ncg-fetch: fetching pack failed\n\nWhat is causing this?\n\n--\n\t\t\t\t\t\tBrian Gerst\n"},{"id":"16908","messageId":"Pine.LNX.4.64.0602280731210.22647@g5.osdl.org","threadId":"3492","inReplyTo":"440449D7.3010508@didntduck.org","subject":"Re: fatal: unexpected EOF","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-02-28T15:34:49Z","receivedAt":"2006-02-28T15:34:49Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 28 Feb 2006, Brian Gerst wrote:\n>\n> Lately I've been receiving this error frequently from git.kernel.org:\n> \n> Fetching pack (head and objects)...\n> fatal: unexpected EOF\n> cg-fetch: fetching pack failed\n> \n> What is causing this?\n\nAlmost any error will cause the pack sending to abort, and the git:// \nprotocol only opens a single socket for data, so there is no way for the \nother end to say _what_ failed.\n\nWith git.kernel.org, I suspect the reason for the failure is almost always \nthe same, though: the mirroring is not complete, so it doesn't have all \nobject files. The mirroring from master.kernel.org to the actual public \nmachines is just a rsync script, so there's no atomicity guarantees.\n\nThat said, it might be a load issue too - I don't know what limits \nPeter & co put on the git daemons, and it might also be that it's set up \nto accept at most <n> connections and will close anything else.\n\n\t\tLinus\n"},{"id":"16909","messageId":"44046F94.3070806@didntduck.org","threadId":"3492","inReplyTo":"Pine.LNX.4.64.0602280731210.22647@g5.osdl.org","subject":"Re: fatal: unexpected EOF","fromName":"Brian Gerst","fromEmail":"bgerst@didntduck.org","sentAt":"2006-02-28T15:43:16Z","receivedAt":"2006-02-28T15:43:16Z","isPatch":false,"sender":{"key":"bgerst@didntduck.org","avatar":null},"body":"Linus Torvalds wrote:\n> \n> On Tue, 28 Feb 2006, Brian Gerst wrote:\n> \n>>Lately I've been receiving this error frequently from git.kernel.org:\n>>\n>>Fetching pack (head and objects)...\n>>fatal: unexpected EOF\n>>cg-fetch: fetching pack failed\n>>\n>>What is causing this?\n> \n> \n> Almost any error will cause the pack sending to abort, and the git:// \n> protocol only opens a single socket for data, so there is no way for the \n> other end to say _what_ failed.\n> \n> With git.kernel.org, I suspect the reason for the failure is almost always \n> the same, though: the mirroring is not complete, so it doesn't have all \n> object files. The mirroring from master.kernel.org to the actual public \n> machines is just a rsync script, so there's no atomicity guarantees.\n> \n> That said, it might be a load issue too - I don't know what limits \n> Peter & co put on the git daemons, and it might also be that it's set up \n> to accept at most <n> connections and will close anything else.\n> \n> \t\tLinus\n> \n> \n\nI doubt it is a problem with mirroring, since it affects all repos \n(kernel, git, cogito, etc.) at the same time.\n\n--\n\t\t\t\tBrian Gerst\n"},{"id":"16910","messageId":"12c511ca0602280759t2e584a4bkd7b6f4d97ade92f7@mail.gmail.com","threadId":"3492","inReplyTo":"44046F94.3070806@didntduck.org","subject":"Re: fatal: unexpected EOF","fromName":"Tony Luck","fromEmail":"tony.luck@gmail.com","sentAt":"2006-02-28T15:59:09Z","receivedAt":"2006-02-28T15:59:09Z","isPatch":false,"sender":{"key":"tony.luck@gmail.com","avatar":null},"body":"> I doubt it is a problem with mirroring, since it affects all repos\n> (kernel, git, cogito, etc.) at the same time.\n\nDitto.  Jes has been grumbling overnight that he can't get a reliable pull\nfrom my kernel repo ... and that hasn't been updated in 10 days, so the\nmirror code shouldn't be touching it.  His error was:\n\n  fatal: read error (Connection reset by peer)\n  Fetch failure: git://git.kernel.org/pub/...\n\nHe also reported that after a few retries it worked.\n\nDoes the git daemon log any errors to syslog on the server?  If so, can someone\nwith access go take a look.\n\n-Tony\n"},{"id":"17077","messageId":"20060302222328.GF6183@steel.home","threadId":"3492","inReplyTo":"12c511ca0602280759t2e584a4bkd7b6f4d97ade92f7@mail.gmail.com","subject":"Re: fatal: unexpected EOF","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-03-02T22:23:28Z","receivedAt":"2006-03-02T22:23:28Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Tony Luck, Tue, Feb 28, 2006 16:59:09 +0100:\n> > I doubt it is a problem with mirroring, since it affects all repos\n> > (kernel, git, cogito, etc.) at the same time.\n> \n> Ditto.  Jes has been grumbling overnight that he can't get a reliable pull\n> from my kernel repo ... and that hasn't been updated in 10 days, so the\n> mirror code shouldn't be touching it.  His error was:\n> \n>   fatal: read error (Connection reset by peer)\n>   Fetch failure: git://git.kernel.org/pub/...\n> \n> He also reported that after a few retries it worked.\n\nI had the problems too and even made the patch (below) to see what it\nwas. I saw to A-records for zeus-pub.kernel.org (git.kernel.org is an\nalias of it) where one of them (I believe it was 204.152.191.37)\nsometimes didn't answer or dropped connection.\n\n---\n\n connect.c |   41 +++++++++++++++++++++++++++++++++++++++--\n 1 files changed, 39 insertions(+), 2 deletions(-)\n\nb5ceb5f3f1c6ff62a3ccb13f360a34b07b9c8482\ndiff --git a/connect.c b/connect.c\nindex 3f2d65c..e911fde 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -322,6 +322,23 @@ static enum protocol get_protocol(const \n \n #ifndef NO_IPV6\n \n+static const char *ai_name(const struct addrinfo *ai)\n+{\n+\tstatic char addr[INET_ADDRSTRLEN];\n+\tif ( AF_INET == ai->ai_family ) {\n+\t\tstruct sockaddr_in *in;\n+\t\tin = (struct sockaddr_in *)ai->ai_addr;\n+\t\tinet_ntop(ai->ai_family, &in->sin_addr, addr, sizeof(addr));\n+\t} else if ( AF_INET6 == ai->ai_family ) {\n+\t\tstruct sockaddr_in6 *in;\n+\t\tin = (struct sockaddr_in6 *)ai->ai_addr;\n+\t\tinet_ntop(ai->ai_family, &in->sin6_addr, addr, sizeof(addr));\n+\t} else {\n+\t\tstrcpy(addr, \"(unknown)\");\n+\t}\n+\treturn addr;\n+}\n+\n static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path)\n {\n \tint sockfd = -1;\n@@ -329,6 +346,7 @@ static int git_tcp_connect(int fd[2], co\n \tchar *port = STR(DEFAULT_GIT_PORT);\n \tstruct addrinfo hints, *ai0, *ai;\n \tint gai;\n+\tint cnt = 0;\n \n \tif (host[0] == '[') {\n \t\tend = strchr(host + 1, ']');\n@@ -355,15 +373,23 @@ static int git_tcp_connect(int fd[2], co\n \tif (gai)\n \t\tdie(\"Unable to look up %s (%s)\", host, gai_strerror(gai));\n \n-\tfor (ai0 = ai; ai; ai = ai->ai_next) {\n+\tfor (ai0 = ai; ai; ++cnt, ai = ai->ai_next) {\n \t\tsockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);\n \t\tif (sockfd < 0)\n \t\t\tcontinue;\n \t\tif (connect(sockfd, ai->ai_addr, ai->ai_addrlen) < 0) {\n+\t\t\tfprintf(stderr, \"%s: %s[%d: %s]: net=%s, errno=%s\\n\",\n+\t\t\t\targv0,\n+\t\t\t\thost,\n+\t\t\t\tcnt,\n+\t\t\t\tai_name(ai),\n+\t\t\t\thstrerror(h_errno),\n+\t\t\t\tstrerror(errno));\n \t\t\tclose(sockfd);\n \t\t\tsockfd = -1;\n \t\t\tcontinue;\n \t\t}\n+\t\tfprintf(stderr, \"using %s[%s]\\n\", host, ai_name(ai));\n \t\tbreak;\n \t}\n \n@@ -389,6 +415,7 @@ static int git_tcp_connect(int fd[2], co\n \tstruct sockaddr_in sa;\n \tchar **ap;\n \tunsigned int nport;\n+\tint cnt;\n \n \tif (host[0] == '[') {\n \t\tend = strchr(host + 1, ']');\n@@ -420,7 +447,7 @@ static int git_tcp_connect(int fd[2], co\n \t\tnport = se->s_port;\n \t}\n \n-\tfor (ap = he->h_addr_list; *ap; ap++) {\n+\tfor (cnt = 0, ap = he->h_addr_list; *ap; ap++, cnt++) {\n \t\tsockfd = socket(he->h_addrtype, SOCK_STREAM, 0);\n \t\tif (sockfd < 0)\n \t\t\tcontinue;\n@@ -431,10 +458,20 @@ static int git_tcp_connect(int fd[2], co\n \t\tmemcpy(&sa.sin_addr, *ap, he->h_length);\n \n \t\tif (connect(sockfd, (struct sockaddr *)&sa, sizeof sa) < 0) {\n+\t\t\tfprintf(stderr, \"%s: %s[%d: %s]: net=%s, errno=%s\\n\",\n+\t\t\t\targv0,\n+\t\t\t\thost,\n+\t\t\t\tcnt,\n+\t\t\t\tinet_ntoa(*(struct in_addr *)&sa.sin_addr),\n+\t\t\t\thstrerror(h_errno),\n+\t\t\t\tstrerror(errno));\n \t\t\tclose(sockfd);\n \t\t\tsockfd = -1;\n \t\t\tcontinue;\n \t\t}\n+\t\tfprintf(stderr, \"using %s[%s]\\n\",\n+\t\t\thost,\n+\t\t\tinet_ntoa(*(struct in_addr *)&sa.sin_addr));\n \t\tbreak;\n \t}\n \n-- \n1.2.3.g3987\n"}]}