← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1824341] Re: NoAllowedOrigin cause package removal

 

This bug was fixed in the package unattended-upgrades -
1.1ubuntu1.18.04.11

---------------
unattended-upgrades (1.1ubuntu1.18.04.11) bionic; urgency=medium

  * Detect changes to moved conffiles (LP: #1823872)
    - Add tests for checking conffile moves.
      Build depend on and use equivs to generate new test packages
    - Split() conffile data to set of names only once
    - Don't parse dpkg conffile db when there are no conffiles in the package
  * Detect unchanged moved conffiles.
    When a package moves a conffile properly without any change no conffile
    prompt needs to be shown thus the package can be upgraded unattended.
    (LP: #1823872)
  * Skip sending email when no package had to be installed, upgraded or removed
    (LP: #1821103) (Closes: #924554)
  * Make sure autoremovals don't start with a dirty cache and remove other
    packages (LP: #1824341)
  * Continue applying minimal sets when one set can't be marked for upgrade.
    Thanks to Anderson Luiz Alves for the patch, it needed minor modifications
    (LP: #1824341)
  * Stop raising NoAllowedOriginError when marking packages to upgrade/install
    fails (LP: #1824876)
  * Adjust only transitive dependencies in the fallback when a package from an
    allowed origin can't be marked to install/upgrade.
    This is a much lighter approach than marking every upgradable package
    because the full fallback was triggered on packages held back as well,
    using an excessive amount of CPU time.
    Also it crashed with packages not having any version in allowed origins.
    (LP: #1824804, #1824949)
  * Skip trying to upgrade held packages in call_adjusted() (LP: #1824804)
  * Follow all kinds of transitive dependencies when adjusting dependencies
  * Don't crash collecting transitive dependencies when package has no candidate
    (LP: #1825886)
  * Use mark_install_adjusted() in rewind_cache()
    The original cache had packages marked with adjustments thus rewinding
    should also do adjustments to reach the same state.
    Also not using mark_install_adjusted() crashes when apt raises error on
    held packages. (LP: #1826157)
    - test_rewind: Update test to check if adjustend rewinding took place

 -- Balint Reczey <rbalint@xxxxxxxxxx>  Mon, 29 Apr 2019 12:13:14 +0200

** Changed in: unattended-upgrades (Ubuntu Bionic)
       Status: Fix Committed => Fix Released

** Changed in: unattended-upgrades (Ubuntu Xenial)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1824341

Title:
  NoAllowedOrigin cause package removal

Status in unattended-upgrades package in Ubuntu:
  Fix Released
Status in unattended-upgrades source package in Xenial:
  Fix Released
Status in unattended-upgrades source package in Bionic:
  Fix Released
Status in unattended-upgrades source package in Cosmic:
  Fix Released
Status in unattended-upgrades source package in Disco:
  Fix Released

Bug description:
  [Impact]

   * When applying a minimal upgrade set fails raising an exception
  unattended-upgrades stops trying to install further sets and may
  remove packages left marked to remove in the dirty set.

  [Test Case]

   * Set up unattended-upgrades to always remove autoremovable packages:

     $ echo 'Unattended-Upgrade::Remove-Unused-Dependencies "false";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-remove
   * Install a package and mark it as autoremovable

     $ sudo apt install hello
     $ sudo apt-mark auto hello

   * Set up the custom package to trigger the failure with the exception when applying the minimal sets in a way that leaves packages to remove in the dirty cache. If the reporter can reproduce the issue on all releases then that's great, otherwise I provide an example with equivs.
    
   * Check if u-u still crashes
    $ sudo unattended-upgrades -d

  [Regression Potential]

   * The fix is catching the raised exceptions and trying to apply next minimal sets. In special circumstances this could fail again for all sets or could make systems's state worse if the installation is already broken. I can't come up with an example where it would make the system's state worse because when packages can't be safely installed Cache.commit() is expected to fail earlier, thust making the system's state worse seems unlikely.
   * OTOH when upgrading a set fails this would not block the installation of bigger sets anymore which is a big advantage of having this fix in u-u.

  [Original Bug Text]

  unattended-upgrades remove packages that shouldn't when there is a
  NoAllowedOrigin exception.

  Version:
  unattended-upgrades=1.1ubuntu1.18.04.10
  Ubuntu 18.04.2 LTS

  Description of problem:
  We have a internal package cliente-ldap that depends on samba, when u-u check for upgrade samba-common it raise a NoAllowedOrigin exception, then it doesn't clear apt.cache and it removes packages that shouldn't.

  Log that happens package removal:
  $ sudo unattended-upgrade -d
  [...]
  Packages that will be upgraded: libsmbclient libwbclient0 python-samba samba samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules smbclient
  Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
  debug: call_adjusted samba-common
  debug: marked_pkg: samba: install=False, upgrade=False, delete=True
  debug: marked_pkg: cliente-ldap: install=False, upgrade=False, delete=True
  Traceback (most recent call last):
    File "/usr/bin/unattended-upgrade", line 257, in call_adjusted
      self.allowed_origins)
    File "/usr/bin/unattended-upgrade", line 764, in ver_in_allowed_origin
      raise NoAllowedOriginError()
  NoAllowedOriginError
  debug: marked_pkg: samba-common: install=False, upgrade=True, delete=False
  debug: marked_pkg: smbclient: install=False, upgrade=False, delete=True
  debug: marked_pkg: samba-common-bin: install=False, upgrade=False, delete=True
  Exception:
  marking samba-common-bin for removal
  Keeping auto-removable samba-common-bin package(s) because it would also remove the following packages which should be kept in this step: samba-common
  marking cliente-ldap for removal
  (Reading database ... 213413 files and directories currently installed.)
  Removing cliente-ldap (1:2.17.15) ...
  marking libcephfs2 for removal
  (Reading database ... 213392 files and directories currently installed.)
  Removing libcephfs2 (12.2.11-0ubuntu0.18.04.1) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  marking ldap-auth-config for removal
  (Reading database ... 213386 files and directories currently installed.)
  Removing libpam-ldap:amd64 (186-4ubuntu1) ...
  Removing ldap-auth-config (0.5.3) ...
  Removing ldap-auth-client (0.5.3) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking python-samba for removal
  (Reading database ... 213332 files and directories currently installed.)
  Removing samba (2:4.7.6+dfsg~ubuntu-0ubuntu2.7) ...
  Removing samba-common-bin (2:4.7.6+dfsg~ubuntu-0ubuntu2.7) ...
  Removing python-samba (2:4.7.6+dfsg~ubuntu-0ubuntu2.7) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking nss-updatedb for removal
  (Reading database ... 212865 files and directories currently installed.)
  Removing nss-updatedb (10-3build1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking samba-vfs-modules for removal
  (Reading database ... 212859 files and directories currently installed.)
  Removing samba-vfs-modules (2:4.7.6+dfsg~ubuntu-0ubuntu2.7) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking librados2 for removal
  (Reading database ... 212770 files and directories currently installed.)
  Removing librados2 (12.2.11-0ubuntu0.18.04.1) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  marking libibverbs1 for removal
  (Reading database ... 212761 files and directories currently installed.)
  Removing ibverbs-providers:amd64 (17.1-1ubuntu0.1) ...
  Removing libibverbs1:amd64 (17.1-1ubuntu0.1) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  marking libpam-mount for removal
  (Reading database ... 212731 files and directories currently installed.)
  Removing libpam-mount (2.16-3ubuntu0.1) ...
  Processing triggers for sgml-base (1.29) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking ibverbs-providers for removal
  marking tdb-tools for removal
  (Reading database ... 212691 files and directories currently installed.)
  Removing tdb-tools (1.3.15-2) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking samba-dsdb-modules for removal
  (Reading database ... 212680 files and directories currently installed.)
  Removing samba-dsdb-modules (2:4.7.6+dfsg~ubuntu-0ubuntu2.7) ...
  marking libnss-ldap for removal
  (Reading database ... 212630 files and directories currently installed.)
  Removing libnss-ldap:amd64 (265-5ubuntu1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking smbclient for removal
  (Reading database ... 212609 files and directories currently installed.)
  Removing smbclient (2:4.7.6+dfsg~ubuntu-0ubuntu2.7) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking python-crypto for removal
  (Reading database ... 212581 files and directories currently installed.)
  Removing python-crypto (2.6.1-8ubuntu2) ...
  marking libnss-db for removal
  (Reading database ... 212416 files and directories currently installed.)
  Removing libnss-db (2.2.3pre1-6build2) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking nscd for removal
  (Reading database ... 212406 files and directories currently installed.)
  Removing nscd (2.27-3ubuntu1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking python-ldb for removal
  (Reading database ... 212398 files and directories currently installed.)
  Removing python-ldb:amd64 (2:1.2.3-1ubuntu0.1) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  marking libpam-ccreds for removal
  (Reading database ... 212390 files and directories currently installed.)
  Removing libpam-ccreds (10-6ubuntu1) ...
  marking samba for removal
  marking python-tdb for removal
  (Reading database ... 212375 files and directories currently installed.)
  Removing python-tdb (1.3.15-2) ...
  marking python-dnspython for removal
  (Reading database ... 212370 files and directories currently installed.)
  Removing python-dnspython (1.15.0-1) ...
  marking attr for removal
  (Reading database ... 212257 files and directories currently installed.)
  Removing attr (1:2.4.47-2build1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking auth-client-config for removal
  (Reading database ... 212244 files and directories currently installed.)
  Removing auth-client-config (0.9ubuntu1) ...
  Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
  marking libpam-ldap for removal
  marking ldap-auth-client for removal
  marking libhx28 for removal
  (Reading database ... 212238 files and directories currently installed.)
  Removing libhx28:amd64 (3.22-1) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...
  Packages that were successfully auto-removed: attr auth-client-config cliente-ldap ibverbs-providers ldap-auth-client ldap-auth-config libcephfs2 libhx28 libibverbs1 libnss-db libnss-ldap libpam-ccreds libpam-ldap libpam-mount librados2 nscd nss-updatedb python-crypto python-dnspython python-ldb python-samba python-tdb samba samba-common-bin samba-dsdb-modules samba-vfs-modules smbclient tdb-tools
  Packages that are kept back: samba-common-bin
  InstCount=0 DelCount=0 BrokenCount=0
  Extracting content from /var/log/unattended-upgrades/unattended-upgrades-dpkg.log since 2019-04-11 09:34:02

  .

  Log of what should happen:
  $ sudo unattended-upgrade -d --dry-run
  [...]
  Option --dry-run given, *not* performing real actions
  Packages that will be upgraded: libsmbclient libwbclient0 python-samba samba samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules smbclient
  Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
  debug: call_adjusted samba-common
  debug: marked_pkg: samba: install=False, upgrade=False, delete=True
  debug: marked_pkg: cliente-ldap: install=False, upgrade=False, delete=False
  Traceback (most recent call last):
    File "/usr/bin/unattended-upgrade", line 257, in call_adjusted
      self.allowed_origins)
    File "/usr/bin/unattended-upgrade", line 764, in ver_in_allowed_origin
      raise NoAllowedOriginError()
  NoAllowedOriginError
  debug: marked_pkg: samba-common: install=False, upgrade=True, delete=False
  debug: marked_pkg: smbclient: install=False, upgrade=False, delete=True
  debug: marked_pkg: samba-common-bin: install=False, upgrade=False, delete=True
  debug: call_adjusted libsmbclient
  debug: marked_pkg: python-samba: install=False, upgrade=True, delete=False
  debug: marked_pkg: libwbclient0: install=False, upgrade=True, delete=False
  debug: marked_pkg: samba: install=False, upgrade=True, delete=False
  debug: marked_pkg: samba-dsdb-modules: install=False, upgrade=True, delete=False
  debug: marked_pkg: samba-libs: install=False, upgrade=True, delete=False
  debug: marked_pkg: samba-common: install=False, upgrade=True, delete=False
  debug: marked_pkg: samba-vfs-modules: install=False, upgrade=True, delete=False
  debug: marked_pkg: libsmbclient: install=False, upgrade=True, delete=False
  debug: marked_pkg: smbclient: install=False, upgrade=True, delete=False
  debug: marked_pkg: samba-common-bin: install=False, upgrade=True, delete=False
  applying set ['python-samba', 'libwbclient0', 'samba', 'samba-dsdb-modules', 'samba-libs', 'samba-common', 'samba-vfs-modules', 'libsmbclient', 'smbclient', 'samba-common-bin']
  Preconfiguring packages ...
  /usr/bin/dpkg --status-fd 9 --no-triggers --unpack --auto-deconfigure --recursive /tmp/apt-dpkg-install-ZHXRWe
  /usr/bin/dpkg --status-fd 9 --configure --pending
  left to upgrade set()
  All upgrades installed
  InstCount=0 DelCount=0 BrokenCount=0

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1824341/+subscriptions