{"thread":{"id":"23895","subject":"(Mosty harmless) protocol error when pushing","startedAt":"2010-05-25T06:51:34Z","lastAt":"2010-05-27T15:12:23Z","messageCount":5,"participants":["Björn Gustavsson","Jeff King","Ilari Liusvaara"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"142240","messageId":"AANLkTikbFaNhiDngY7Cgk0Ce0YhmNBGIpXtn7abjXnPR@mail.gmail.com","threadId":"23895","inReplyTo":null,"subject":"(Mosty harmless) protocol error when pushing","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2010-05-25T06:51:34Z","receivedAt":"2010-05-25T06:51:34Z","isPatch":false,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"I am not sure whether this has been reported before.\nI follow this mailing list, but I don't read all emails in\ndetail, so I could have missed a bug report or a fix\nfor the problem.\n\nAnyway, what seems to happen is that some protocol\nerror happens when an automatic GC is triggered\nduring a push. The push succeeded, despite the\nerror messages.\n\nMy version of git is 1.7.1.86.g0e460. Here is\nwhat happened (I force-pushed a single branch):\n\nCounting objects: 270, done.\nDelta compression using up to 8 threads.\nCompressing objects: 100% (71/71), done.\nWriting objects: 100% (184/184), 151.33 KiB, done.\nTotal 184 (delta 157), reused 134 (delta 113)\nAuto packing the repository for optimum performance.\nfatal: protocol error: bad line length character: Remo\nerror: error in sideband demultiplexer\nTo git@github.com:bjorng/otp.git\n + 7651a63...874192d bg/nif_error -> bg/nif_error (forced update)\nerror: failed to push some refs to 'git@github.com:bjorng/otp.git'\n\n-- \nBjörn Gustavsson, Erlang/OTP, Ericsson AB\n"},{"id":"142247","messageId":"20100525072824.GA19612@coredump.intra.peff.net","threadId":"23895","inReplyTo":"AANLkTikbFaNhiDngY7Cgk0Ce0YhmNBGIpXtn7abjXnPR@mail.gmail.com","subject":"Re: (Mosty harmless) protocol error when pushing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-05-25T07:28:24Z","receivedAt":"2010-05-25T07:28:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, May 25, 2010 at 08:51:34AM +0200, Björn Gustavsson wrote:\n\n> I am not sure whether this has been reported before.\n> I follow this mailing list, but I don't read all emails in\n> detail, so I could have missed a bug report or a fix\n> for the problem.\n\nI haven't seen it before, and I do read most of the emails (OK, I skip\nsome of the boring ones. :) ).\n\n> Counting objects: 270, done.\n> Delta compression using up to 8 threads.\n> Compressing objects: 100% (71/71), done.\n> Writing objects: 100% (184/184), 151.33 KiB, done.\n> Total 184 (delta 157), reused 134 (delta 113)\n> Auto packing the repository for optimum performance.\n> fatal: protocol error: bad line length character: Remo\n> error: error in sideband demultiplexer\n> To git@github.com:bjorng/otp.git\n>  + 7651a63...874192d bg/nif_error -> bg/nif_error (forced update)\n> error: failed to push some refs to 'git@github.com:bjorng/otp.git'\n\nI wasn't able to reproduce here, but I wonder if this would help\n(more or less a cut-and-paste from the hook-running code in\nreceive-pack):\n\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex bb34757..c0a6a3b 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -843,7 +843,20 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)\n \t\t\tconst char *argv_gc_auto[] = {\n \t\t\t\t\"gc\", \"--auto\", \"--quiet\", NULL,\n \t\t\t};\n-\t\t\trun_command_v_opt(argv_gc_auto, RUN_GIT_CMD);\n+\t\t\tstruct child_process proc;\n+\n+\t\t\tmemset(&proc, 0, sizeof(proc));\n+\t\t\tproc.no_stdin = 1;\n+\t\t\tproc.stdout_to_stderr = 1;\n+\t\t\tproc.err = use_sideband ? -1 : 0;\n+\t\t\tproc.git_cmd = 1;\n+\t\t\tproc.argv = argv_gc_auto;\n+\n+\t\t\tif (!start_command(&proc)) {\n+\t\t\t\tif (use_sideband)\n+\t\t\t\t\tcopy_to_sideband(proc.err, -1, NULL);\n+\t\t\t\tfinish_command(&proc);\n+\t\t\t}\n \t\t}\n \t\tif (auto_update_server_info)\n \t\t\tupdate_server_info(0);\n\nUnfortunately I can't actually test it. :)\n\n-Peff\n"},{"id":"142318","messageId":"AANLkTilc9-B79EhmmO2t-VsHFZdupQn8zX9LFYRrn5of@mail.gmail.com","threadId":"23895","inReplyTo":"20100525072824.GA19612@coredump.intra.peff.net","subject":"Re: (Mosty harmless) protocol error when pushing","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2010-05-26T05:58:29Z","receivedAt":"2010-05-26T05:58:29Z","isPatch":false,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"2010/5/25 Jeff King <peff@peff.net>:\n\n> diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\n> index bb34757..c0a6a3b 100644\n> --- a/builtin/receive-pack.c\n> +++ b/builtin/receive-pack.c\n> @@ -843,7 +843,20 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)\n>                        const char *argv_gc_auto[] = {\n>                                \"gc\", \"--auto\", \"--quiet\", NULL,\n>                        };\n> -                       run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);\n> +                       struct child_process proc;\n> +\n> +                       memset(&proc, 0, sizeof(proc));\n> +                       proc.no_stdin = 1;\n> +                       proc.stdout_to_stderr = 1;\n> +                       proc.err = use_sideband ? -1 : 0;\n> +                       proc.git_cmd = 1;\n> +                       proc.argv = argv_gc_auto;\n> +\n> +                       if (!start_command(&proc)) {\n> +                               if (use_sideband)\n> +                                       copy_to_sideband(proc.err, -1, NULL);\n> +                               finish_command(&proc);\n> +                       }\n>                }\n>                if (auto_update_server_info)\n>                        update_server_info(0);\n>\n> Unfortunately I can't actually test it. :)\n\nThanks!\n\nUnfortunately, I was also unable to reproduce the problem,\nso I can't test it either.\n\nThere is no easy way to force a GC on my repository at github,\nso I tried to push to a local repository having too many loose\nobjects using the \"file:\" protocol but the problem did not occur\n(i.e. the repository was auto packed but the protocol error did\nnot happen).\n\n-- \nBjörn Gustavsson, Erlang/OTP, Ericsson AB\n"},{"id":"142415","messageId":"20100527113305.GB7865@LK-Perkele-V2.elisa-laajakaista.fi","threadId":"23895","inReplyTo":"AANLkTilc9-B79EhmmO2t-VsHFZdupQn8zX9LFYRrn5of@mail.gmail.com","subject":"Re: (Mosty harmless) protocol error when pushing","fromName":"Ilari Liusvaara","fromEmail":"ilari.liusvaara@elisanet.fi","sentAt":"2010-05-27T11:33:05Z","receivedAt":"2010-05-27T11:33:05Z","isPatch":false,"sender":{"key":"ilari.liusvaara@elisanet.fi","avatar":null},"body":"On Wed, May 26, 2010 at 07:58:29AM +0200, Björn Gustavsson wrote:\n> 2010/5/25 Jeff King <peff@peff.net>:\n> \n> Unfortunately, I was also unable to reproduce the problem,\n> so I can't test it either.\n> \n> There is no easy way to force a GC on my repository at github,\n> so I tried to push to a local repository having too many loose\n> objects using the \"file:\" protocol but the problem did not occur\n> (i.e. the repository was auto packed but the protocol error did\n> not happen).\n\nI can't reproduce it either.\n\nI tried testing using git:// over TLS. I could trigger the auto-gc,\nbut got no messages about it (hmm... other sideband messages do\nwork...) and no protocol error.\n\nGit 1.7.1 on both sides.\n\n-Ilari\n"},{"id":"142439","messageId":"20100527151222.GA18590@coredump.intra.peff.net","threadId":"23895","inReplyTo":"20100527113305.GB7865@LK-Perkele-V2.elisa-laajakaista.fi","subject":"Re: (Mosty harmless) protocol error when pushing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-05-27T15:12:23Z","receivedAt":"2010-05-27T15:12:23Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 27, 2010 at 02:33:05PM +0300, Ilari Liusvaara wrote:\n\n> I can't reproduce it either.\n> \n> I tried testing using git:// over TLS. I could trigger the auto-gc,\n> but got no messages about it (hmm... other sideband messages do\n> work...) and no protocol error.\n\nSame here. But look at Björn's original error, which contained:\n\n  fatal: protocol error: bad line length character: Remo\n\nSo I think it may not just be an auto-gc, but an auto-gc which provokes\nprune-packed to say:\n\n  Removing duplicate objects: 100% (256/256), done.\n\nwhich happens only when it takes more than 2 seconds to remove all of\nthe objects. But I was still not able to reproduce it, even after\nremoving the delay:\n\ndiff --git a/builtin/prune-packed.c b/builtin/prune-packed.c\nindex f9463de..da1ab20 100644\n--- a/builtin/prune-packed.c\n+++ b/builtin/prune-packed.c\n@@ -48,7 +48,7 @@ void prune_packed_objects(int opts)\n \n \tif (opts == VERBOSE)\n \t\tprogress = start_progress_delay(\"Removing duplicate objects\",\n-\t\t\t256, 95, 2);\n+\t\t\t256, 95, 0);\n \n \tif (len > PATH_MAX - 42)\n \t\tdie(\"impossible object directory\");\n\nI notice that the original problem was seen when pushing to github. I\nwonder if they are running an older version, or even a custom version\nthat behaves differently (perhaps with stdout and stderr file\ndescriptors set up differently for the gc or something like that).\n\n-Peff\n"}]}