[Bug 1814543] Re: deal with EPIPE from json hooks

Brian Murray brian at ubuntu.com
Tue Mar 5 22:08:30 UTC 2019


Hello Julian, or anyone else affected,

Accepted apt into cosmic-proposed. The package will build now and be
available at https://launchpad.net/ubuntu/+source/apt/1.7.3 in a few
hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested and change the tag from
verification-needed-cosmic to verification-done-cosmic. If it does not
fix the bug for you, please add a comment stating that, and change the
tag to verification-failed-cosmic. In either case, without details of
your testing we will not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: apt (Ubuntu Cosmic)
       Status: In Progress => Fix Committed

** Tags added: verification-needed verification-needed-cosmic

** Changed in: apt (Ubuntu Bionic)
       Status: In Progress => Fix Committed

** Tags added: verification-needed-bionic

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1814543

Title:
  deal with EPIPE from json hooks

Status in apt package in Ubuntu:
  Fix Released
Status in apt source package in Bionic:
  Fix Committed
Status in apt source package in Cosmic:
  Fix Committed
Status in apt source package in Disco:
  Fix Released

Bug description:
  [Impact]
  json hooks ending with EPIPE on first read fail, but should simply do nothing. This causes spurious failures of uninstalled hooks.

  Also, there is a missing error exit, causing errors reported by the
  script to not exit.

  [Test case]
  For the first part, I cannot generate one. This was discovered by snapd ci, but I did not find a reproducer yet.

  FWIW, the change should be tiny enough to see that it is not wrong:
  -        if (errno != ECONNRESET)
  +        if (errno != ECONNRESET && errno != EPIPE)
              _error->Error("Could not read response to hello message from hook %s: %s", Opts->Value.c_str(), strerror(errno));

  
  The missing error handling is the next lines:
         else if (strstr(line, "error") != nullptr)
         {
           _error->Error("Hook %s reported an error during hello: %s", Opts->Value.c_str(), line);                                             
  +        goto out;
         }

  
  that can be checked:

  sudo apt -o AptCli::Hooks::Install::="/usr/bin/printf '{error should
  be json}\n\n' >&3" install

  
  [Regression potential]
  JSON hooks failures with EPIPE are now ignored, so if it fails with EPIPE for other reasons than just exiting, I guess we might miss it

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1814543/+subscriptions



More information about the foundations-bugs mailing list