Debian Bug report logs - #552121
daemon should send errors to client ("The remote end hung up unexpectedly" is unhelpful)

version graph

Package: git; Maintainer for git is Gerrit Pape <pape@smarden.org>; Source for git is src:git.

Reported by: "Eugene V. Lyubimkin" <jackyf@debian.org>

Date: Fri, 23 Oct 2009 14:39:02 UTC

Severity: important

Tags: patch, upstream

Found in versions git/1:1.6.5-1, git/1:1.7.1-1

Fixed in version 1:1.7.8~rc0-1

Done: Jonathan Nieder <jrnieder@gmail.com>

Bug is archived. No further changes may be made.

Forwarded to http://thread.gmane.org/gmane.comp.version-control.git/145456/focus=145573

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Gerrit Pape <pape@smarden.org>:
Bug#552121; Package git-core. (Fri, 23 Oct 2009 14:39:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Eugene V. Lyubimkin" <jackyf@debian.org>:
New Bug report received and forwarded. Copy sent to Gerrit Pape <pape@smarden.org>. (Fri, 23 Oct 2009 14:39:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Eugene V. Lyubimkin" <jackyf@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: git-core: misleading error message when trying to push to read-only repo
Date: Fri, 23 Oct 2009 17:22:48 +0300
Package: git-core
Version: 1:1.6.5-1
Severity: normal

$ git push
fatal: The remote end hung up unexpectedly

Isn't helpful at all and made me think about server's problem.

Please print a graceful error message when the real error is trying to
push to read-only repository.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages git-core depends on:
ii  libc6                  2.10.1-1          GNU C Library: Shared libraries
ii  libcurl3-gnutls        7.19.5-1.1        Multi-protocol file transfer libra
ii  libdigest-sha1-perl    2.12-1            NIST SHA-1 message digest algorith
ii  liberror-perl          0.17-1            Perl module for error/exception ha
ii  libexpat1              2.0.1-4           XML parsing C library - runtime li
ii  perl-modules           5.10.1-5          Core Perl modules
ii  zlib1g                 1:1.2.3.3.dfsg-15 compression library - runtime

Versions of packages git-core recommends:
ii  less                          436-1      pager program similar to more
ii  openssh-client [ssh-client]   1:5.1p1-7  secure shell client, an rlogin/rsh
ii  patch                         2.5.9-5    Apply a diff file to an original
ii  rsync                         3.0.6-1    fast remote file copy program (lik

Versions of packages git-core suggests:
pn  git-arch                      <none>     (no description available)
pn  git-cvs                       <none>     (no description available)
pn  git-daemon-run                <none>     (no description available)
pn  git-doc                       <none>     (no description available)
pn  git-email                     <none>     (no description available)
pn  git-gui                       <none>     (no description available)
ii  git-svn                       1:1.6.5-1  fast, scalable, distributed revisi
pn  gitk                          <none>     (no description available)
pn  gitweb                        <none>     (no description available)

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Gerrit Pape <pape@smarden.org>:
Bug#552121; Package git-core. (Sun, 07 Mar 2010 01:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <pape@smarden.org>. (Sun, 07 Mar 2010 01:36:03 GMT) Full text and rfc822 format available.

Message #10 received at 552121@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: "Eugene V. Lyubimkin" <jackyf@debian.org>
Cc: 552121@bugs.debian.org
Subject: Re: git-core: misleading error message when trying to push to read-only repo
Date: Sat, 6 Mar 2010 19:32:49 -0600
tags 552121 + upstream
retitle 552121 git daemon: "The remote end hung up unexpectedly" is not a useful message
thanks

Hi Eugene,

Eugene V. Lyubimkin wrote:

> $ git push
> fatal: The remote end hung up unexpectedly
> 
> Isn't helpful at all and made me think about server's problem.

I assume you are using git-daemon on the other end?

The git daemon is very simple; see Documentation/technical/pack-protocol.txt
Basically it runs one of a number of helpers and dumps its output over
the wire.  For example, one helper is 'git receive-pack', used to
handle push requests.

If you run 'git receive-pack' yourself, you can see what output it
would provide:

 $ git receive-pack /nonexistent
 fatal: '/nonexistent' does not appear to be a git repository

This message went to stderr.  Similarly, when git cannot write an
object file, it writes an appropriate message to stderr.  So your
request becomes to get ‘git push’ to report what receive-pack wrote to
stderr.

The relevant code from daemon.c looks like this:

	memset(&cld, 0, sizeof(cld));
	cld.argv = argv;
	cld.git_cmd = 1;
	cld.err = -1;
	if (start_command(&cld))
		return -1;

	close(0);
	close(1);

	copy_to_log(cld.err);

	return finish_command(&cld);

That is, it captures stderr from the child and writes it to the
daemon’s log.  All you have to do is figure out where to send this
output instead, and we’ll be done.

Ideas welcome.

See https://kerneltrap.org/mailarchive/git/2008/10/24/3794834

Hope that helps,
Jonathan




Changed Bug title to 'daemon should send errors to client ("The remote end hung up unexpectedly" is unhelpful)' from 'git-core: misleading error message when trying to push to read-only repo' Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Sun, 07 Mar 2010 03:03:09 GMT) Full text and rfc822 format available.

Added tag(s) upstream. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Sun, 07 Mar 2010 03:03:10 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Gerrit Pape <pape@smarden.org>:
Bug#552121; Package git-core. (Sun, 07 Mar 2010 07:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Eugene V. Lyubimkin" <jackyf@debian.org>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <pape@smarden.org>. (Sun, 07 Mar 2010 07:48:03 GMT) Full text and rfc822 format available.

Message #19 received at 552121@bugs.debian.org (full text, mbox):

From: "Eugene V. Lyubimkin" <jackyf@debian.org>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: 552121@bugs.debian.org
Subject: Re: git-core: misleading error message when trying to push to read-only repo
Date: Sun, 07 Mar 2010 09:30:00 +0200
[Message part 1 (text/plain, inline)]
Jonathan Nieder wrote:
> Eugene V. Lyubimkin wrote:
>=20
>> $ git push
>> fatal: The remote end hung up unexpectedly
>>
>> Isn't helpful at all and made me think about server's problem.
>=20
> I assume you are using git-daemon on the other end?
>
I can't say for sure, because I don't remember which repository I tried t=
o
push to.

> The git daemon is very simple; see Documentation/technical/pack-protoco=
l.txt
> Basically it runs one of a number of helpers and dumps its output over
> the wire.  For example, one helper is 'git receive-pack', used to
> handle push requests.
>=20
>[...]
>=20
> That is, it captures stderr from the child and writes it to the
> daemon=E2=80=99s log.  All you have to do is figure out where to send t=
his
> output instead, and we=E2=80=99ll be done.
>=20
I am not familiar with git's code, so can't analyze much.

Instead, as the real cause was the fact that I set remote to read-only
address, can this be checked by client side by checking the scheme of rem=
ote
URI? E.g. at least warning ("you are trying to push to read-only reposito=
ry").

--=20
Eugene V. Lyubimkin aka JackYF, JID: jackyf.devel(maildog)gmail.com
C++/Perl developer, Debian Developer

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Gerrit Pape <pape@smarden.org>:
Bug#552121; Package git-core. (Sun, 07 Mar 2010 16:36:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <pape@smarden.org>. (Sun, 07 Mar 2010 16:36:06 GMT) Full text and rfc822 format available.

Message #24 received at 552121@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: "Eugene V. Lyubimkin" <jackyf@debian.org>
Cc: 552121@bugs.debian.org
Subject: Re: git-core: misleading error message when trying to push to read-only repo
Date: Sun, 7 Mar 2010 10:35:06 -0600
Eugene V. Lyubimkin wrote:

> I am not familiar with git's code, so can't analyze much.
> 
> Instead, as the real cause was the fact that I set remote to read-only
> address, can this be checked by client side by checking the scheme of remote
> URI? E.g. at least warning ("you are trying to push to read-only repository").

The thing is, push over git:// is a perfectly valid thing to do, even
if it is rare because unauthenticated.  It might make sense to give
advice based on the _hunch_ that the other side must be read-only, but
that would be annoying in cases where the heuristic proves wrong.

It would be much better IMHO for git to _know_ that the other end is a
read-only repository, or could not fork for lack of address space, or
is failing for whatever reason.  For this, the git protocol needs a
slight change to make the error information available.

Or maybe the git protocol would already allow it.  I am not very
familiar with the git protocol.  It’s a matter of whether there is a
chance to for the server to negotiate a side channel (the
side-band-64k capability) before it is time to hang up.

For reference, some _similar_ (but not identical) work is in progress
to support transfering output from hooks over HTTP [1].

Anyway, thanks for the report.  I will be thinking more about this.

Hoping that is clearer,
Jonathan

[1] See commit 6d525d (receive-pack: Send hook output over side band
#2, 2010-02-05).




Bug Marked as found in versions git-core/1:1.7.0-1. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Tue, 09 Mar 2010 19:51:11 GMT) Full text and rfc822 format available.

Bug reassigned from package 'git-core' to 'git'. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 03 May 2010 05:03:12 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions git-core/1:1.6.5-1 and git-core/1:1.7.0-1. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 03 May 2010 05:03:12 GMT) Full text and rfc822 format available.

Bug Marked as found in versions git/1:1.6.5-1. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 03 May 2010 05:03:13 GMT) Full text and rfc822 format available.

Bug Marked as found in versions git/1:1.7.1-1. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 03 May 2010 05:03:13 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'http://thread.gmane.org/gmane.comp.version-control.git/145456/focus=145573'. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 03 May 2010 05:03:14 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Gerrit Pape <pape@smarden.org>:
Bug#552121; Package git. (Mon, 03 Jan 2011 23:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <pape@smarden.org>. (Mon, 03 Jan 2011 23:21:03 GMT) Full text and rfc822 format available.

Message #41 received at 552121@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: "Eugene V. Lyubimkin" <jackyf@debian.org>
Cc: 552121@bugs.debian.org
Subject: Re: git-core: misleading error message when trying to push to read-only repo
Date: Mon, 3 Jan 2011 17:17:12 -0600
severity 552121 important
tags 552121 + patch
quit

Eugene V. Lyubimkin wrote:

> $ git push
> fatal: The remote end hung up unexpectedly
> 
> Isn't helpful at all and made me think about server's problem.

Sad story: a rough fix for this has been available for months[1]
but I dropped the ball and didn't find time to write some test
cases.  Help would be appreciated.  Adjusting severity to make
sure this doesn't fall off the radar again.

Thanks again for a thoughtful report.

Regards,
Jonathan

[1] http://thread.gmane.org/gmane.comp.version-control.git/145456/focus=145573




Severity set to 'important' from 'normal' Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 03 Jan 2011 23:21:07 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 03 Jan 2011 23:21:08 GMT) Full text and rfc822 format available.

Added indication that bug 552121 blocks 611843 Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Thu, 03 Feb 2011 21:12:31 GMT) Full text and rfc822 format available.

Reply sent to Jonathan Nieder <jrnieder@gmail.com>:
You have taken responsibility. (Tue, 08 Nov 2011 04:09:04 GMT) Full text and rfc822 format available.

Notification sent to "Eugene V. Lyubimkin" <jackyf@debian.org>:
Bug acknowledged by developer. (Tue, 08 Nov 2011 04:09:04 GMT) Full text and rfc822 format available.

Message #52 received at 552121-done@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: 552121-done@bugs.debian.org
Subject: Re: git-core: misleading error message when trying to push to read-only repo
Date: Mon, 7 Nov 2011 22:06:58 -0600
Version: 1:1.7.8~rc0-1

Jonathan Nieder wrote:
> Eugene V. Lyubimkin wrote:
 
>> $ git push
>> fatal: The remote end hung up unexpectedly
>> 
>> Isn't helpful at all and made me think about server's problem.
>
> Sad story: a rough fix for this has been available for months[1]
> but I dropped the ball

Yes!  Duy picked it up again.  Fixed by v1.7.8-rc0~28^2 (daemon: give
friendlier error messages to clients, 2011-10-14).




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 22 Jan 2012 07:34:32 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 00:15:31 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.