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

Re: [PATCH v2] remove the impression of unexpectedness when access is denied

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 4, 2013, 03:10 UTC
Message-ID
<20130504031001.GA3734@elie.Belkin>
In-Reply-To
<20120619182449.GA99957@book.hvoigt.net>
Hi,
Heiko Voigt wrote:
Show 15 quoted lines
> --- a/connect.c
> +++ b/connect.c
> @@ -49,6 +49,16 @@ static void add_extra_have(struct extra_have_objects *extra, unsigned char *sha1
>  	extra->nr++;
>  }
>  
> +static void die_initial_contact(int got_at_least_one_head)
> +{
> +	if (got_at_least_one_head)
> +		die("The remote end hung up upon initial contact");
> +	else
> +		die("Could not read from remote repository.\n\n"
> +		    "Please make sure you have the correct access rights\n"
> +		    "and the repository exists.");
> +}
[...]
I ran into this message for the first time today.
 $ git fetch --all
 Fetching origin
 remote: Counting objects: 368, done.
[...]
 Fetching gitk
 fatal: Could not read from remote repository.
 Please make sure you have the correct access rights
 and the repository exists.
 error: Could not fetch gitk
 Fetching debian
 Fetching pape
[...]

The "gitk" remote refers to git://git.kernel.org/pub/scm/gitk/gitk. Using ls-remote to contact it produces the same result. The message is correct: the repository does not exist.

Impressions:
 * Looking at "Could not read", it is not clear what could not read
   and why.  GIT_TRACE_PACKET tells me the interaction was
	me> git-upload-pack /pub/scm/gitk/gitk\0host=git.kernel.org\0
	them> (hangup)
   Would it make sense for the server to send an "ERR" packet to give
   a more helpful diagnosis?
 * The spacing and capitalization is odd and makes it not flow well
   with the rest of the output.  I suspect it would be easier to read
   with the error separated from hints:
	Fetching gitk
	fatal: the remote server sent an empty response
	hint: does the repository exist?
	hint: do you have the correct access rights?
	error: Could not fetch gitk
	Fetching debian
   If a server is misconfigured and just decides to send an empty
   response for no good reason, the output would still be true.
 * The error message is the same whether the server returned no
   response or an incomplete pkt-line.  Maybe in the latter case it
   should print the "hung up unexpectedly" thing.
Thoughts?
Jonathan
Previous: Heiko VoigtNext: Junio C Hamano
Message 11 of 13 in “lessen the impression of unexpectedness on remote hangup”
  1. lessen the impression of unexpectedness on remote hangupHeiko Voigt, Jun 10, 2012
  2. Jonathan NiederJun 10, 2012
  3. Junio C HamanoJun 11, 2012
  4. Jeff KingJun 11, 2012
  5. Heiko VoigtJun 13, 2012
  6. remove the impression of unexpectedness when access is deniedHeiko Voigt, Jun 14, 2012
  7. Heiko VoigtJun 14, 2012
  8. Junio C HamanoJun 14, 2012
  9. Heiko VoigtJun 14, 2012
  10. remove the impression of unexpectedness when access is deniedHeiko Voigt, Jun 19, 2012
  11. Jonathan NiederMay 4, 2013
  12. Junio C HamanoMay 6, 2013
  13. Jeff KingMay 7, 2013

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.