cannot upgrade from 23.10 to 24.04, error in _install_t64_replacement_packages

Bug #2067071 reported by miccs
74
This bug affects 12 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Invalid
High
Nick Rosbrook
Noble
Fix Committed
High
Nick Rosbrook

Bug Description

[Impact]

Upgrades to Noble may crash while searching for t64 replacement packages.

[Test Plan]

One way to reproduce this is by setting Pin-Priority: -1 for a t64 replacement package so that `replacement` will have no candidate.

$ apt install -y libts0
$ cat > /etc/apt/preferences.d/lp2067071 << EOF
Package: libts0t64
Pin: release a=noble
Pin-Priority: -1
EOF
$ do-release-upgrade --proposed

Before the patch, that will lead to the same crash shown in this bug report.

[Where problems could occur]

The patch is confined to the t64 replacement quirk. Any other issues would be there. The fix is to simply make sure the replacement has a candidate (i.e. replacement.candidate is not None) before accessing more attributes.

[Original Description]

it crashes while calculating space - cannot proceed to package downloading.

short from the logs:

File "/tmp/ubuntu-release-upgrader-4lhpwkx7/DistUpgrade/DistUpgradeCache.py", line 497, in pre_upgrade_rule
    self.quirks.run("PreDistUpgradeCache")
  File "/tmp/ubuntu-release-upgrader-4lhpwkx7/DistUpgrade/DistUpgradeQuirks.py", line 95, in run
    func()
  File "/tmp/ubuntu-release-upgrader-4lhpwkx7/DistUpgrade/DistUpgradeQuirks.py", line 191, in PreDistUpgradeCache
    self._install_t64_replacement_packages()
  File "/tmp/ubuntu-release-upgrader-4lhpwkx7/DistUpgrade/DistUpgradeQuirks.py", line 1845, in _install_t64_replacement_packages
    if replacement.candidate._cand != ver:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_cand'

full logs attached as files.

Related branches

Revision history for this message
miccs (meomic) wrote :
Revision history for this message
miccs (meomic) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
Nick Rosbrook (enr0n)
tags: added: rls-nn-incoming
Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → High
Benjamin Drung (bdrung)
tags: added: foundations-bugs
removed: rls-nn-incoming
tags: added: foundations-todo
removed: foundations-bugs
Nick Rosbrook (enr0n)
Changed in ubuntu-release-upgrader (Ubuntu):
assignee: nobody → Nick Rosbrook (enr0n)
Revision history for this message
Nick Rosbrook (enr0n) wrote :

This quirk should not be used for upgrades to oracular, so marking invalid for that release. Only needs to be fixed in noble.

description: updated
Changed in ubuntu-release-upgrader (Ubuntu Noble):
importance: Undecided → High
assignee: nobody → Nick Rosbrook (enr0n)
status: New → Triaged
Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Invalid
Nick Rosbrook (enr0n)
Changed in ubuntu-release-upgrader (Ubuntu Noble):
status: Triaged → In Progress
Revision history for this message
mike@papersolve.com (mike-papersolve) wrote :

It looks like you made some code changes to fix, but I did try the upgrade again and fails the same way:

   res = f(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^
  File "/tmp/ubuntu-release-upgrader-vh4mksxv/DistUpgrade/DistUpgradeCache.py", line 626, in distUp
grade
    self.pre_upgrade_rule()
  File "/tmp/ubuntu-release-upgrader-vh4mksxv/DistUpgrade/DistUpgradeCache.py", line 497, in pre_up
grade_rule
    self.quirks.run("PreDistUpgradeCache")
  File "/tmp/ubuntu-release-upgrader-vh4mksxv/DistUpgrade/DistUpgradeQuirks.py", line 95, in run
    func()
  File "/tmp/ubuntu-release-upgrader-vh4mksxv/DistUpgrade/DistUpgradeQuirks.py", line 191, in PreDi
stUpgradeCache
    self._install_t64_replacement_packages()
  File "/tmp/ubuntu-release-upgrader-vh4mksxv/DistUpgrade/DistUpgradeQuirks.py", line 1845, in _install_t64_replacement_packages
    if replacement.candidate._cand != ver:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_cand'

Any chance the changes could be released or is there a way I can test them?

Revision history for this message
mike@papersolve.com (mike-papersolve) wrote :

Actually - I just removed libts0 - which wanted to uninstall a few apps that I made note of to reinstall later - and then I was able to upgrade to 24.04.

Revision history for this message
Andreas Hasenack (ahasenack) wrote : Please test proposed package

Hello miccs, or anyone else affected,

Accepted ubuntu-release-upgrader into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:24.04.19 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, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. 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 ubuntu-release-upgrader (Ubuntu Noble):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Juanjo Aparicio (bnt) wrote :

Run into the same problem upgrading 23.10 to 24.04.

I run do-release-upgrade. Checking /var/log/dist-upgrade/main.log, I could see that the problem was:

    2024-06-14 21:00:38,539 DEBUG Searching for replacement for libts0
    2024-06-14 21:00:38,562 ERROR not handled exception:
    ...
      File "/tmp/ubuntu-release-upgrader-t3r65jm_/DistUpgrade/DistUpgradeQuirks.py", line 1845, in _install_t64_replacement_packages
        if replacement.candidate._cand != ver:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

    AttributeError: 'NoneType' object has no attribute '_cand'

Replaced libts0:1.22.1 with libts0t64 1.22.1-1build1 instead of removing it, and this allowed me to proceed with the upgrade.

It hasn't completed yet, I don't know whether I'll find something else.

Revision history for this message
Juanjo Aparicio (bnt) wrote :

Quick followup: upgrade completed without issues.

Revision history for this message
Owen Pahl (owenp) wrote :

Hi Andreas,

The upgrade process downloads the old version (release-upgrader version '24.04.18' started from /var/log/dist-upgrade/main.apt) even though I have 24.04.19 installed (ii ubuntu-release-upgrader-core 1:24.04.19). I even tried pinning the noble-proposed packages to 600 to no avail.

Is there a way to get the upgrade process get the new version from noble-proposed too?

Revision history for this message
Lupe Christoph (lupe) wrote :

I tried an upgrade myself and it failed like before. I checked and just like Owen described, it ran release-upgrader 24.04.18.

I had 24.04.19 installed and this added to the normal /etc/apt:

/etc/apt/sources.list.d/noble-proposed.list
deb http://de.archive.ubuntu.com/ubuntu/ noble-proposed multiverse restricted universe main

/etc/apt/preferences.d/proposed-updates
Package: ubuntu-release-upgrader*
Pin: release a=noble-proposed
Pin-Priority: 700

No use. At an early stage of do-release-upgrade apt-cache complained about this. And since there is a noble-proposed.list.distUpgrade left behind I assume that the upgrade process disabled noble-proposed.list. Just great!

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Can you please try do-release-upgrade with the -p switch? If this works, I'll amend the test case.

  -p, --proposed Try upgrading to the latest release using the upgrader
                        from $distro-proposed

Revision history for this message
Nick Rosbrook (enr0n) wrote :
Download full text (4.4 KiB)

I have verified the fix using ubuntu-release-upgrader from noble-proposed (via do-release-upgrade --proposed):

root@m:~# cat /etc/os-release
PRETTY_NAME="Ubuntu 23.10"
NAME="Ubuntu"
VERSION_ID="23.10"
VERSION="23.10 (Mantic Minotaur)"
VERSION_CODENAME=mantic
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=mantic
LOGO=ubuntu-logo
root@m:~# apt install -y libts0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libts0
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 62.0 kB of archives.
After this operation, 313 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu mantic/universe amd64 libts0 amd64 1.22-1 [62.0 kB]
Fetched 62.0 kB in 0s (136 kB/s)
Selecting previously unselected package libts0:amd64.
(Reading database ... 33603 files and directories currently installed.)
Preparing to unpack .../libts0_1.22-1_amd64.deb ...
Unpacking libts0:amd64 (1.22-1) ...
Setting up libts0:amd64 (1.22-1) ...
Processing triggers for man-db (2.11.2-3) ...
Processing triggers for libc-bin (2.38-1ubuntu6.3) ...
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@m:~# cat > /etc/apt/preferences.d/lp2067071 << EOF
Package: libts0t64
Pin: release a=noble
Pin-Priority: -1
EOF
root@m:~# 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.co...

Read more...

description: updated
tags: added: verification-done verification-done-noble
removed: verification-needed verification-needed-noble
Revision history for this message
Javier Martin (Habbit) (habbit) wrote (last edit ):

Same as #13, I confirm that the fix works for me with do-release-upgrade -p. The upgrade from Mantic to Noble ran to completion and everything seems fine. I did not have to change anything about libts beforehand.

Revision history for this message
Àlex Magaz (rivaldi8) wrote :

I can also confirm the fix has worked for me upgrading from 23.10 to 24.04.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.