git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Heiko Voigt <hvoigt@hvoigt.net>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] remove the impression of unexpectedness when access is denied
Date: Fri, 3 May 2013 20:10:01 -0700	[thread overview]
Message-ID: <20130504031001.GA3734@elie.Belkin> (raw)
In-Reply-To: <20120619182449.GA99957@book.hvoigt.net>

Hi,

Heiko Voigt wrote:

> --- 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

  reply	other threads:[~2013-05-04  3:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-10 18:23 [PATCH] lessen the impression of unexpectedness on remote hangup Heiko Voigt
2012-06-10 18:44 ` Jonathan Nieder
2012-06-11 16:41 ` Junio C Hamano
2012-06-11 19:02 ` Jeff King
2012-06-13 21:28   ` Heiko Voigt
2012-06-14  7:13   ` [PATCH] remove the impression of unexpectedness when access is denied Heiko Voigt
2012-06-14  7:39     ` Heiko Voigt
2012-06-14 17:11     ` Junio C Hamano
2012-06-14 20:37       ` Heiko Voigt
2012-06-19 18:24         ` [PATCH v2] " Heiko Voigt
2013-05-04  3:10           ` Jonathan Nieder [this message]
2013-05-06 14:02             ` Junio C Hamano
2013-05-07 18:39               ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130504031001.GA3734@elie.Belkin \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).