[Bug 2077358] Re: upgrades fail when package in ForcedObsoletes does not exist
Launchpad Bug Tracker
2077358 at bugs.launchpad.net
Tue Aug 27 10:40:13 UTC 2024
This bug was fixed in the package ubuntu-release-upgrader - 1:24.04.22
---------------
ubuntu-release-upgrader (1:24.04.22) noble; urgency=medium
[ Tobias Heider ]
* Fix typo in force_obsoletes. (LP: #2076913)
[ Nick Rosbrook ]
* DistUpgrade: handle cache key error when removing obsolete packages
(LP: #2077358)
* deb2snap: switch snap-store and firmware-updater tracks
(LP: #2077344)
* Run pre-build.sh: updating mirrors, demotions, and translations.
ubuntu-release-upgrader (1:24.04.21) noble; urgency=medium
* DistUpgradeQuirks: disable stub resolver on upgrades from jammy
(LP: #2043820)
* DistUpgrade: show a message about denied package removals
(LP: #2073278)
* data: add cryptsetup-initramfs to removal_denylist.cfg
(LP: #2067622)
* DistUpgradeQuirks: abort if system is not /usr-merged
(LP: #2058648)
* DistUpgradeQuirks: disable cloud-init on upgrade
(LP: #2075968)
* DistUpgradeQuirks: abort if rabbitmq-server installed
(LP: #2074309)
* Run pre-build.sh: updating mirrors, demotions, and translations.
ubuntu-release-upgrader (1:24.04.20) noble; urgency=medium
[ Mate Kukri ]
* DistUpgradeQuirks: make sure GRUB "cloud_style_installation" is set in cloud images (LP: #2054103)
[ Julian Andres Klode ]
* Move the actiongroup out of the obsoletes loop
* Reimplement obsolete removal with resolve_by_keep (LP: #1874272)
[ Nick Rosbrook ]
* Run pre-build.sh: updating mirrors, demotions, and translations.
-- Nick Rosbrook <enr0n at ubuntu.com> Wed, 21 Aug 2024 12:55:15 -0400
** Changed in: ubuntu-release-upgrader (Ubuntu Noble)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-release-upgrader in
Ubuntu.
https://bugs.launchpad.net/bugs/2077358
Title:
upgrades fail when package in ForcedObsoletes does not exist
Status in ubuntu-release-upgrader package in Ubuntu:
Fix Released
Status in ubuntu-release-upgrader source package in Noble:
Fix Released
Bug description:
[Impact]
With ubuntu-release-upgrader in noble-proposed, I get the following
error when upgrading Ubuntu Desktop:
2024-08-19 14:48:13,087 ERROR not handled exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apt/cache.py", line 281, in __getitem__
# It might be excluded due to not having a version or something
KeyError: 'gnome-app-install'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/nr/24.04.22/./noble", line 8, in <module>
sys.exit(main())
File "/home/nr/24.04.22/DistUpgrade/DistUpgradeMain.py", line 241, in main
if app.run():
File "/home/nr/24.04.22/DistUpgrade/DistUpgradeController.py", line 2639, in run
return self.fullUpgrade()
File "/home/nr/24.04.22/DistUpgrade/DistUpgradeController.py", line 2615, in fullUpgrade
self.doPostUpgrade()
File "/home/nr/24.04.22/DistUpgrade/DistUpgradeController.py", line 2033, in doPostUpgrade
if not self.cache[pkgname].marked_delete:
File "/usr/lib/python3/dist-packages/apt/cache.py", line 283, in __getitem__
raise KeyError("The cache has no package named %r" % key)
KeyError: "The cache has no package named 'gnome-app-install'"
This is because the new forced obsoletes code does not handle key
errors with the cache.
[Test Plan]
The simplest way to test this is doing an upgrade of Ubuntu Desktop,
because the DistUpgrade.cfg has a ForceObsoletes= section for `ubuntu-
desktop` that contains at least one package that no longer exists in
the archive.
$ do-release-upgrade -d
The upgrade should succeed past the "removing obsoletes" section.
[Where problems could occur]
The patch here is to check for the package name as a key in the cache
before attempting to access it. Any more problems would be contained
in the "searching/removing obsoletes" logic.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2077358/+subscriptions
More information about the foundations-bugs
mailing list