git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Useless error message?

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 21, 2010, 22:19 UTC
Message-ID
<20100421221953.GA25348@progeny.tock>
In-Reply-To
<z2o3abd05a91004211417v263d5a0eg497341ddf7bd79a5@mail.gmail.com>
Aghiles wrote:
> "fatal: The remote end hung up unexpectedly"
> 
> Is that really meaningful ? Or maybe it is a configuration problem
> on my side ?
Please, fix it. :)

The problem is this: as far as I can tell, the git protocols are designed around the success case. Sometimes if there is an error or other interesting event, the servers are kind enough to notify the user “on the side”. But in the end, all too often, they do not bother to inform the client _program_ that a fatal error occured.

We can’t just throw away this hang-up message because sometimes when the remote host hangs up it really was unexpected.

So the trick is to make it expected more often. See the side-band-64k capability in Documentation/technical/protocol-capabilities.txt: the goal is to have fatal error messages for as many failure modes as possible.

Examples (I could be missing nuances; I am just trying to convey the idea):

upload-archive:
 - a pipe(), write(), or poll() failure when communicating over
   the wire or between local processes will result in an unexpected
   hangup.  I have not checked, but I suspect a SIGPIPE can kill
   upload-archive, too.
 - On the bright side, all other error conditions are properly
   handled.  The code for this is very nice and worth imitating.
upload-pack:
 - a missing or shallow repo, HEAD or some other ref pointing to
   a nonexistent object, early protocol error, or failure to start
   rev-list or pack-objects will result in an unexpected hangup.
 - errors from rev-list, pack-objects, or the transition of the
   generated pack are correctly handled.
receive-pack:
 - all errors result in unexpected hup as far as I can tell.
daemon:
 - hangs up without an explanation (except to syslog) for invalid
   or disabled repositories
 - if the underlying service hangs up, hangs up.  If the underlying
   service writes a message to stderr, writes that message to
   syslog.  Surely the client is not interested...

If any other information would help, please let me know. Jonathan

Previous: Kim EbertNext: Junio C Hamano
Message 3 of 13 in “Useless error message?”
  1. AghilesApr 21, 2010
  2. Kim EbertApr 21, 2010
  3. Jonathan NiederApr 21, 2010
  4. Junio C HamanoApr 22, 2010
  5. Jonathan NiederApr 22, 2010
  6. Andreas EricssonApr 22, 2010
  7. Jonathan NiederApr 22, 2010
  8. Andreas EricssonApr 22, 2010
  9. Jonathan NiederApr 22, 2010
  10. Ilari LiusvaaraApr 22, 2010
  11. daemon: report inaccessible repositories to userJonathan Nieder, Apr 22, 2010
  12. Petr BaudisApr 22, 2010
  13. AghilesApr 22, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.