git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Yuri <yuri@rawbw.com>
Cc: git@vger.kernel.org
Subject: Re: git quietly fails on https:// URL, https errors are never reported to user
Date: Thu, 16 Jan 2014 13:03:10 -0500	[thread overview]
Message-ID: <20140116180310.GA27180@sigill.intra.peff.net> (raw)
In-Reply-To: <52D7D017.107@rawbw.com>

On Thu, Jan 16, 2014 at 04:27:03AM -0800, Yuri wrote:

> While debugging, I find that remove_junk() deletes all directories
> from under __cxa_finalize.
> Before this, exit(128) is called from recvline_fh ("Debug: Remote
> helper quit.) And this function in turn is called from under
> refs = transport_get_remote_refs(transport);
> 
> I think you need to make sure that any https errors (in this and
> other locations) are reported to the user, and git never quits on
> error without saying what the error is.

We used to print "Reading from helper 'git-remote-https' failed" in this
instance. But in the majority of cases, remote-https has printed a
useful message already to stderr, and the extra line just confused
people. The downside, as you noticed, is that when the helper dies
without printing an error, the user is left with no message.

Unfortunately, detecting whether the helper printed a useful message is
non-trivial. It's possible we could do more detection based on the
helper's death (e.g., if it died by signal, print a message) and at
least say _something_.

But even if we do so, the message isn't going to tell you what went
wrong, only that something unexpected happened.  It is up to the helper
to print something useful, and if it didn't, it should be fixed.  So the
most important bug to fix here, IMHO, is figuring out why
git-remote-https died without printing an error message.

Is it possible to strace (or truss) the helper process? What it was
doing when it died may be helpful. Rather than picking through "strace
-f" output, you can use this hack to trace just the helper process:

  cat >/in/your/$PATH/git-remote-strace <<\EOF
  #!/bin/sh
  protocol=$(echo "$2" | cut -d: -f1)
  exec strace git-remote-$protocol "$@"
  EOF

  git clone strace::https://github.com/your/repo.git

-Peff

  reply	other threads:[~2014-01-16 18:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 12:27 git quietly fails on https:// URL, https errors are never reported to user Yuri
2014-01-16 18:03 ` Jeff King [this message]
2014-01-16 19:28   ` Yuri
2014-01-17  9:40   ` Yuri
2014-01-17 19:43     ` Junio C Hamano
2014-01-17 20:13       ` Jeff King
2014-01-17 20:18         ` Jeff King
2014-01-17 20:39         ` Yuri
2014-01-17 21:10           ` 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=20140116180310.GA27180@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=yuri@rawbw.com \
    /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).