[Bug 2076913] Re: 'DistUpgradeController' object has no attribute 'force_obsoletes'

Nick Rosbrook 2076913 at bugs.launchpad.net
Thu Aug 22 14:00:56 UTC 2024


I have verified the fix using ubuntu-release-upgrader 1:24.04.22 from
noble-proposed:

nr at six:~$ lxc launch ubuntu:jammy j
Launching j
nr at six:~$ lxc exec j bash                          
root at j:~# apt-add-repository -y ppa:enr0n/lp2076913
Repository: 'deb https://ppa.launchpadcontent.net/enr0n/lp2076913/ubuntu/ jammy main'
Description:
SRU verification helper for LP: #2076913.
More info: https://launchpad.net/~enr0n/+archive/ubuntu/lp2076913
Adding repository.
Adding deb entry to /etc/apt/sources.list.d/enr0n-ubuntu-lp2076913-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/enr0n-ubuntu-lp2076913-jammy.list
Adding key to /etc/apt/trusted.gpg.d/enr0n-ubuntu-lp2076913.gpg with fingerprint C07E653049D16CF04E411A88261693C099E054E5
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]        
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]                                           
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]                                             
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1769 kB]
Get:6 https://ppa.launchpadcontent.net/enr0n/lp2076913/ubuntu jammy InRelease [18.0 kB] 
Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]            
Get:8 https://ppa.launchpadcontent.net/enr0n/lp2076913/ubuntu jammy/main amd64 Packages [556 B]    
Get:9 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [290 kB]                             
Get:10 https://ppa.launchpadcontent.net/enr0n/lp2076913/ubuntu jammy/main Translation-en [396 B]                     
Get:11 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [13.2 kB]                    
Get:12 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2308 kB]
Get:13 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [398 kB]          
Get:14 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [890 kB]          
Get:15 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [175 kB]    
Get:16 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [19.0 kB]    
Get:17 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.2 kB]          
Get:18 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7588 B]    
Get:19 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [228 B]
Get:20 http://archive.ubuntu.com/ubuntu jammy/universe Translation-en [5652 kB]   
Get:21 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B]
Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [17.8 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1112 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [260 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [26.0 kB]
Get:29 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [43.3 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [10.8 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [444 B]
Get:32 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [92.4 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [11.1 kB]
Get:34 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
Get:35 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]
Get:36 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [31.4 kB]
Get:37 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.5 kB]
Get:38 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [672 B]
Get:39 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 28.3 MB in 6s (5040 kB/s) 
Reading package lists... Done
root at j:~# apt install -y hello
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  hello
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 53.4 kB of archives.
After this operation, 279 kB of additional disk space will be used.
Get:1 https://ppa.launchpadcontent.net/enr0n/lp2076913/ubuntu jammy/main amd64 hello amd64 2.10-2ubuntu4.1~ppa1 [53.4 kB]
Fetched 53.4 kB in 3s (17.1 kB/s)                          
Selecting previously unselected package hello.
(Reading database ... 33953 files and directories currently installed.)
Preparing to unpack .../hello_2.10-2ubuntu4.1~ppa1_amd64.deb ...
Unpacking hello (2.10-2ubuntu4.1~ppa1) ...
Setting up hello (2.10-2ubuntu4.1~ppa1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for install-info (6.8-4build1) ...
Scanning processes...                                                                                                  

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root at j:~# do-release-upgrade --proposed
Checking for a new Ubuntu release

= Welcome to Ubuntu 24.04 LTS 'Noble Numbat' =

The Ubuntu team is proud to announce Ubuntu 24.04 LTS 'Noble Numbat'.

To see what's new in this release, visit:
  https://wiki.ubuntu.com/NobleNumbat/ReleaseNotes

Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.

We hope you enjoy Ubuntu.

== Feedback and Helping ==

If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at

  http://www.ubuntu.com/community/participate/

Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever.  If you feel
that you have found a bug please read:

  http://help.ubuntu.com/community/ReportingBugs

Then report bugs using apport in Ubuntu.  For example:

  ubuntu-bug linux

will open a bug report in Launchpad regarding the linux package.

If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:

  http://help.ubuntu.com/community/InternetRelayChat
  http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
  http://www.ubuntuforums.org/


== More Information ==

You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:

  http://www.ubuntu.com/


To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:

  http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce


Continue [yN] y
Get:1 Upgrade tool signature [833 B]                                                                                  
Get:2 Upgrade tool [1277 kB]                                                                                          
Fetched 1278 kB in 0s (0 B/s)                                                                                         
authenticate 'noble.tar.gz' against 'noble.tar.gz.gpg' 
extracting 'noble.tar.gz'
[screen is terminating]
root at j:~# grep "Foreign" /var/log/dist-upgrade/main.log
2024-08-22 13:51:17,468 DEBUG Foreign: hello
2024-08-22 13:57:30,215 DEBUG Foreign: 

** Tags removed: verification-needed verification-needed-noble
** Tags added: verification-done verification-done-noble

-- 
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/2076913

Title:
  'DistUpgradeController' object has no attribute 'force_obsoletes'

Status in ubuntu-release-upgrader package in Ubuntu:
  Fix Released
Status in ubuntu-release-upgrader source package in Noble:
  Fix Committed

Bug description:
  [Impact]

  It looks like the latest SRU has introduced a bug in
  https://git.launchpad.net/ubuntu-release-
  upgrader/commit/?id=8c592abdf5047a6bd4da20dab1e444c6dcf8c842

  There is a typo in s/force_obosoletes/forced_obsoletes/ which causes upgrades from noble to oracular to
  fail:

    File "/tmp/ubuntu-release-upgrader-l77uthwp/DistUpgrade/DistUpgradeController.py", line 1578, in doPostUpgrade
      if pkgname in self.foreign_pkgs and pkgname in self.force_obsoletes:
                                                     ^^^^^^^^^^^^^^^^^^^^
  AttributeError: 'DistUpgradeController' object has no attribute 'force_obsoletes'. Did you mean: 'forced_obsoletes'?

  [Test Plan]

  This code path is only hit when some "foreign" packages are installed,
  e.g. from a PPA. The best way to reproduce this is to install a
  package from a PPA and then perform an upgrade. I created
  https://launchpad.net/~enr0n/+archive/ubuntu/lp2076913 for convenience
  in testing.

  $ apt-add-repository -y ppa:enr0n/lp2076913
  $ apt install -y hello
  $ do-release-upgrade -d

  On an affected system, the AttributeError would be shown during the
  searching for obsoletes stage. One should confirm that some "foreign"
  packages were logged, otherwise the code path would not be taken:

  $ grep "Foreign" /var/log/dist-upgrade/main.log

  [Where problems could occur]

  The patch changes the typo self.force_obsoletes to the correct
  self.forced_obsoletes. Another typo would lead to the same problem!

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2076913/+subscriptions




More information about the foundations-bugs mailing list