Bug#866401: Please print proper error message when download fails

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#866401: Please print proper error message when download fails

Ian Jackson-11
Package: debootstrap
Version: 1.0.67

I run an automated test system.  Recently we had a test fail, because
an invocation of "xt-install-image" from the xen-tools package failed.
xt-install-image printed this:

 Installation method: debootstrap
 Running command 'xt-install-image --hostname=debian.guest.osstest
 --location=/tmp/enTikPkbpQ --dist=jessie --install-method=debootstrap
 --mirror=http://ftp.debian.org/debian --cache=yes
 --cachedir=/var/cache/apt/archives/ --arch=armhf 2>&1' failed with
 exit code 32512.
 Aborting
 See /var/log/xen-tools/debian.guest.osstest.log for details

In that logfile (which was nominated by xt-install-image) there is only
this:

 I: Retrieving Release
 I: Retrieving Release.gpg
 I: Checking Release signature
 I: Valid Release signature (key id 75DDC3C4A499F1A18CB5F3C8CBF8D6FD518E17E1)
 I: Retrieving Packages
 I: Retrieving Packages
 E: Couldn't download dists/jessie/main/binary-armhf/Packages
 Running command '/usr/sbin/debootstrap  --arch armhf jessie
 /tmp/enTikPkbpQ http://ftp.debian.org/debian 2>&1' failed with exit
 code 256.

I think the final message was printed by xt-install-image, and the
previous messages by debootstrap.

My complaint is about this message:

  E: Couldn't download dists/jessie/main/binary-armhf/Packages

I would like to know:

 * What URL (or other downlaod technique) was being used
 * What IPv4 or IPv6 address was being communicated with
 * Whether the error was due to
    - a corrupted file
        and if so please state the location of the corrupted
        copy and the expected checksum so that the corrupted
        file can be inspected to see what is wrong
    - an http error response
        and if so please print at least the HTTP status line
        and ideally log the error document somewhere
    - an http protocol violation
        and if so a description of what the violation was
    - a networking system call failure
        and if so which system call
        and what the errno value was
    - something else
        including appropriate details

Thanks,
Ian.

Reply | Threaded
Open this post in threaded view
|

Bug#866401: Please print proper error message when download fails

Hideki Yamane-2
control: tags -1 +patch

On Wed, 21 Mar 2018 18:15:06 +0900 Hideki Yamane <[hidden email]> wrote:
>  Then, how about to change it to "-nv" (no-verbose) option?

 Here's a proposed patch.


diff --git a/functions b/functions
index bb7dae1..a4651ef 100644
--- a/functions
+++ b/functions
@@ -74,13 +74,13 @@ progress_next () {
 }
 
 wgetprogress () {
-       [ ! "$VERBOSE" ] && QSWITCH="-q"
+       [ ! "$VERBOSE" ] && NVSWITCH="-nv"
        local ret=0
        if [ "$USE_DEBIANINSTALLER_INTERACTION" ] && [ "$PROGRESS_NEXT" ]; then
                wget "$@" 2>&1 >/dev/null | $PKGDETAILS "WGET%" $PROGRESS_NOW $PROGRESS_NEXT $PROGRESS_END >&3
                ret=$?
        else
-               wget $QSWITCH "$@"
+               wget $NVSWITCH "$@"
                ret=$?
        fi
        return $ret

Reply | Threaded
Open this post in threaded view
|

Bug#866401: Please print proper error message when download fails

Raphael Hertzog-3
Hi,

On Wed, 21 Mar 2018, Hideki Yamane wrote:
> On Wed, 21 Mar 2018 18:15:06 +0900 Hideki Yamane <[hidden email]> wrote:
> >  Then, how about to change it to "-nv" (no-verbose) option?
>
>  Here's a proposed patch.

busybox's wget does not fail with this option but it also does not change
its behaviour. And we already have the verbose option to enable verbose
logging so this is really not necessary.

I think that your whole interpretation of this bug report is flawed. The bug
reporter complains of this error message:

E: Couldn't download dists/jessie/main/binary-armhf/Packages

And fixing it to include the full URL is not hard:

--- a/functions
+++ b/functions
@@ -675,7 +675,7 @@ download_release_indices () {
                        if get "$m/$path" "$pkgdest" $ext; then break; fi
                done
                if [ ! -f "$pkgdest" ]; then
-                       error 1 COULDNTDL "Couldn't download %s" "$path"
+                       error 1 COULDNTDL "Couldn't download %s" "$m/$path"
                fi
                donepkgs="$(($donepkgs + ${i#* }))"
                progress $donepkgs $totalpkgs DOWNPKGS "Downloading Packages files"
@@ -722,7 +722,7 @@ download_debs () {
                                        echo >>$TARGET/debootstrap/deburis "$p $ver $m/$fil"
                                        echo >>$TARGET/debootstrap/debpaths "$p $debdest"
                                else
-                                       warning COULDNTDL "Couldn't download package %s (ver %s arch %s)" "$p" "$ver" "$arc"
+                                       warning COULDNTDL "Couldn't download package %s (ver %s arch %s) at %s" "$p" "$ver" "$arc" "$m/$fil"
                                        leftover="$leftover $p"
                                fi
                        fi

I fixed another similar error message at the same time.

And this error message does not seem to be generated by debootstrap

Cheers,
--
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/

Reply | Threaded
Open this post in threaded view
|

Bug#866401: Please print proper error message when download fails

Hideki Yamane-2
On Thu, 22 Mar 2018 09:59:21 +0100
Raphael Hertzog <[hidden email]> wrote:
> busybox's wget does not fail with this option but it also does not change
> its behaviour. And we already have the verbose option to enable verbose
> logging so this is really not necessary.

 Yes, but we don't always use busybox's one, and verbose logging is
 too much. non-verbose is better than quiet and verbose, IMHO.


> I think that your whole interpretation of this bug report is flawed. The bug
> reporter complains of this error message:
>
> E: Couldn't download dists/jessie/main/binary-armhf/Packages
>
> And fixing it to include the full URL is not hard:

 Awesome, thanks for the patch!


--
Regards,

 Hideki Yamane     henrich @ debian.org/iijmio-mail.jp