NoAllowedOrigin cause package removal

Bug #1824341 reported by Anderson Luiz Alves on 2019-04-11
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Undecided
Unassigned
Disco
Undecided
Unassigned

Bug Description

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

Anderson Luiz Alves (alacn1) wrote :

The proposed fix is clear cache on NoAllowedOriginError exception.

description: updated

The attachment "fix clear cache on exception" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
description: updated
Anderson Luiz Alves (alacn1) wrote :

full log that removed packages that shouldn't

description: updated
tags: added: bionic disco rls-dd-incoming
Balint Reczey (rbalint) wrote :
Changed in unattended-upgrades (Ubuntu):
status: New → In Progress

Hello Anderson, or anyone else affected,

Accepted unattended-upgrades into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/1.10ubuntu4 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-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. 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 unattended-upgrades (Ubuntu Disco):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-disco
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 1.10ubuntu4

---------------
unattended-upgrades (1.10ubuntu4) disco; urgency=medium

  * 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)

 -- Balint Reczey <email address hidden> Tue, 16 Apr 2019 00:01:56 +0200

Changed in unattended-upgrades (Ubuntu Disco):
status: Fix Committed → Fix Released
Anderson Luiz Alves (alacn1) wrote :

The package unattended-upgrades=1.10ubuntu5 fixes the problem on Ubuntu 18.04 LTS bionic.

tags: added: verification-done verification-done-disco
removed: verification-needed verification-needed-disco
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments