Activity log for bug #1776218

Date Who What changed Old value New value Message
2018-06-11 12:13:22 Michael Vogt bug added bug
2018-06-27 07:31:11 Julian Andres Klode apt (Ubuntu): status New In Progress
2018-06-27 07:31:14 Julian Andres Klode apt (Ubuntu): importance Undecided High
2018-06-27 07:31:17 Julian Andres Klode apt (Ubuntu): assignee Julian Andres Klode (juliank)
2018-06-27 12:37:00 Francis Ginther tags id-5b333ce4c9e5f90176d2242c
2018-07-10 09:04:02 Julian Andres Klode description The new style (json-rpc) hooks are great. However when using them in snapd we noticed the following problem. When shipping a hook in /etc/apt/apt.conf.d/20snapd.conf like: ``` AptCli::Hooks::Install { "[ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt || true"; }; ``` this works fine. However when the snapd package is removed apt fails with: ``` ... Purging configuration files for snapd (1337.2.32.8) ... Final directory cleanup Discarding preserved snap namespaces Removing extra snap-confine apparmor rules Removing snapd cache Removing snapd state E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt || true: Connection reset by peer E: Could not read message separator line after handshake from [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt || true: Connection reset by peer quiet: end of output. ``` I.e. if the hook is not there apt still expectes a handshake. [Impact] The new style (json-rpc) hooks are great. However when using them in snapd we noticed the following problem. When shipping a hook in /etc/apt/apt.conf.d/20snapd.conf like: ``` AptCli::Hooks::Install { "[ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt || true"; }; ``` this works fine. However when the snapd package is removed apt fails with: ``` ... Purging configuration files for snapd (1337.2.32.8) ... Final directory cleanup Discarding preserved snap namespaces Removing extra snap-confine apparmor rules Removing snapd cache Removing snapd state E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt || true: Connection reset by peer E: Could not read message separator line after handshake from [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt || true: Connection reset by peer quiet: end of output. ``` I.e. if the hook is not there apt still expectes a handshake. [Test case] cat > rootdir/etc/apt/apt.conf.d/99-json-hooks << EOF AptCli::Hooks::Install:: "true"; AptCli::Hooks::Search:: "true"; EOF and run an install. This test and some more error handling tests are part of the test suite, too, so autopkgtest covers that for us. [Regression potential] Hooks that do not respond to the initial handshake and just exit with 0 are silently ignored. [Other info] There are some more changes in the patch that fix other cases of error handling: As can be seen above, there are 2 error messages for one error, because the code did not abort early, but tried to carry on, reading more data. It now goes directly to the end.
2018-07-10 09:04:10 Julian Andres Klode nominated for series Ubuntu Bionic
2018-07-10 09:04:10 Julian Andres Klode bug task added apt (Ubuntu Bionic)
2018-07-10 09:04:16 Julian Andres Klode apt (Ubuntu): status In Progress Fix Committed
2018-07-10 09:13:00 Julian Andres Klode apt (Ubuntu Bionic): status New In Progress
2018-07-10 10:27:26 Launchpad Janitor apt (Ubuntu): status Fix Committed Fix Released
2018-07-12 13:37:37 Łukasz Zemczak apt (Ubuntu Bionic): status In Progress Fix Committed
2018-07-12 13:37:39 Łukasz Zemczak bug added subscriber Ubuntu Stable Release Updates Team
2018-07-12 13:37:40 Łukasz Zemczak bug added subscriber SRU Verification
2018-07-12 13:37:42 Łukasz Zemczak tags id-5b333ce4c9e5f90176d2242c id-5b333ce4c9e5f90176d2242c verification-needed verification-needed-bionic
2018-07-13 07:52:30 Julian Andres Klode tags id-5b333ce4c9e5f90176d2242c verification-needed verification-needed-bionic id-5b333ce4c9e5f90176d2242c verification-done verification-done-bionic
2018-07-19 08:44:22 Launchpad Janitor apt (Ubuntu Bionic): status Fix Committed Fix Released
2018-07-19 08:44:26 Łukasz Zemczak removed subscriber Ubuntu Stable Release Updates Team