Activity log for bug #1599459

Date Who What changed Old value New value Message
2016-07-06 10:37:01 David McBride bug added bug
2016-07-06 10:38:07 David McBride description Version: 1.0.78+nmu1ubuntu1 I am using debootstrap in my own minimal system bootstrapper, and am making use of the progress information reported to FH 3 as enabled by the --debian-installer command-line flag. Unfortunately, using this flag causes the behaviour of debootstrap to change, specifically in its handling of InRelease / Release files. During normal operation, debootstrap will first attempt to fetch an InRelease file from the repository; if this is unavailable, i.e. the fetch fails with 404, then debootstrap will normally fall back to fetching a Release file instead. Indeed, this is the behaviour of debootstrap if --debian-installer is not passed on the command-line. debootstrap uses the wgetprogress() function to fetch these URLs. It reads: wgetprogress () { [ ! "$VERBOSE" ] && QSWITCH="-q" 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 "$@" ret=$? fi return $ret } When the --debian-installer command-line flag is set, the first path of the if branch will be taken - running the output of wget through a pipe, so that the $PKGDETAILS command can be used to parse progress information provided by wget and report it to FH 3 in a format usable by debian-installer. However, if the URL passed to wget returns 404, then while the wget command will fail, the $PKGDETAILS command, and thus the pipeline as a whole, does not, and the wgetprocess () function thus erroneously returns success. As a consequence, debootstrap does not fall back to fetching and using a Release file as it should in this case, and the bootstrapping attempt as a whole fails. Because this is a POSIX shell-script, I don't believe there is a straightforward mechanism to fetch the exit status of the wget command when it is part of a pipeline. (See: http://cfajohnson.com/shell/cus-faq-2.html#Q11). It might be possible to enhance the code invoked by $PKGDETAILS to return a fatal exit status if it does not definitely see a successful file retrieval? A more direct work-around is to modify this function to unconditionally use the second code path that does not attempt to invoke wget as part of a pipeline. However, this does mean that you lose out on intra-file download progress reporting. Version: 1.0.78+nmu1ubuntu1 I am using debootstrap in my own minimal system bootstrapper, and am making use of the progress information reported to FH 3 as enabled by the --debian-installer command-line flag. Unfortunately, using this flag causes the behaviour of debootstrap to change, specifically in its handling of InRelease / Release files. During normal operation, debootstrap will first attempt to fetch an InRelease file from the repository; if this is unavailable, i.e. the fetch fails with 404, then debootstrap will normally fall back to fetching a Release file instead. Indeed, this is the behaviour of debootstrap if --debian-installer is not passed on the command-line. debootstrap uses the wgetprogress() function to fetch these URLs. It reads: wgetprogress () {         [ ! "$VERBOSE" ] && QSWITCH="-q"         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 "$@"                 ret=$?         fi         return $ret } When the --debian-installer command-line flag is set, the first path of the if branch will be taken - running the output of wget through a pipe, so that the $PKGDETAILS command can be used to parse progress information provided by wget and report it to FH 3 in a format usable by debian-installer. However, if the URL passed to wget returns 404, then while the wget command will fail, the $PKGDETAILS command, and thus the pipeline as a whole, does not, and the wgetprocess () function thus erroneously returns success. As a consequence, debootstrap does not fall back to fetching and using a Release file as it should in this case, and the bootstrapping attempt as a whole fails. Because this is a POSIX shell-script, I don't believe there is a straightforward mechanism to fetch the exit status of the wget command when it is part of a pipeline. (See: http://cfajohnson.com/shell/cus-faq-2.html#Q11). It might be possible to enhance the code invoked by $PKGDETAILS to return a fatal exit status if it does not definitely see a successful file retrieval? A more direct work-around is to modify this function to unconditionally use the second code path that does not attempt to invoke wget as part of a pipeline. However, this does mean that you lose out on intra-file download progress reporting.
2016-12-28 10:25:57 Launchpad Janitor debootstrap (Ubuntu): status New Confirmed
2016-12-28 10:27:28 Jacob Doherty bug added subscriber Jacob Doherty
2016-12-28 10:35:50 Jacob Doherty bug watch added http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829725
2016-12-28 10:35:50 Jacob Doherty bug task added debootstrap (Debian)
2016-12-28 11:53:39 Bug Watch Updater debootstrap (Debian): status Unknown New
2017-01-05 02:56:27 Jacob Doherty bug watch added https://github.com/dnschneid/crouton/issues/2966
2017-05-09 03:46:13 Sebastian Unger attachment added functions.diff https://bugs.launchpad.net/ubuntu/+source/debootstrap/+bug/1599459/+attachment/4873850/+files/functions.diff
2017-05-09 04:22:58 Ubuntu Foundations Team Bug Bot tags patch
2017-05-09 04:23:06 Ubuntu Foundations Team Bug Bot bug added subscriber Ubuntu Review Team
2018-01-17 15:43:21 David McBride bug added subscriber MCS Linux
2018-07-13 03:50:39 Bug Watch Updater debootstrap (Debian): status New Fix Committed
2018-08-11 16:57:29 Bug Watch Updater debootstrap (Debian): status Fix Committed Fix Released