not possible to use "Repair broken packages"

Bug #1799839 reported by Brian Murray on 2018-10-24
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
friendly-recovery (Ubuntu)
High
Unassigned
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned
ubuntu-release-upgrader (Ubuntu)
High
Brian Murray
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned

Bug Description

[Impact]
It is not possible to use "Repair broken packages" in friendly recovery as it calls dist-upgrade.py and that fails as it checks to see if the python symlink, not python3 symlink is good.

[Test Case]
Run the following as root:

env RELEASE_UPGRADER_NO_SCREEN=1 python3 "/usr/lib/python3/dist-packages/DistUpgrade/dist-upgrade.py" --partial --frontend DistUpgradeViewText --datadir /usr/share/ubuntu-release-upgrader

With the version in the archive you'll receive an error regarding your python install being corrupted, with the version from --proposed you won't.

Also after installing the new version of python3-distupgrade the system should be booted into recovery mode and it confirmed that the "Repair broken packages" menu item works.

[Regression Potential]
The code is just being updated to use python3 instead of python so there isn't any change of a regression.

The menu item "Repair broken packages" calls the following command:

env RELEASE_UPGRADER_NO_SCREEN=1 python3 "/usr/lib/python3/dist-packages/DistUpgrade/dist-upgrade.py" --partial --frontend DistUpgradeViewText --datadir /usr/share/ubuntu-release-upgrader

However, that fails with the following:

Your python install is corrupted. Please fix the '/usr/bin/python' symlink.

This is because of the _pythonSymlinkCheck function in DistUpgradeController.py (provided by ubuntu-release-upgrader) using os.readlink('/usr/bin/python') but not os.readlink() on what the first os.readlink() call returned. That being said the whole function should be updated to see if python3 is being used.

Brian Murray (brian-murray) wrote :

See also the following ubuntu-release-upgrader bug LP: #1798872.

tags: added: bionic cosmic rls-dd-incoming
Changed in friendly-recovery (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in friendly-recovery (Ubuntu):
status: Triaged → Invalid
Changed in friendly-recovery (Ubuntu):
status: Invalid → Triaged
description: updated
description: updated
Changed in ubuntu-release-upgrader (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Brian Murray (brian-murray)
description: updated
Julian Andres Klode (juliank) wrote :

We probably should sanity check all of python, python2, python3; not just the most recent one. The python sanity checking exists to make sure pyclean and friends work and don't cause a ton of upgrade failure reports.

Julian Andres Klode (juliank) wrote :

I think that's actually the same bug as the one I just opened: bug 1800823, but as mentioned, the solution should cover all python symlinks and not just python3.

Julian Andres Klode (juliank) wrote :

To further expand on the "all symlinks":

> [Regression Potential]
> The code is just being updated to use python3 instead of python so there isn't any change of a regression.

That's wrong. You can now clearly symlink python to python3 (or 2.6) and you'd get a ton of errors from postinsts.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:19.04.1

---------------
ubuntu-release-upgrader (1:19.04.1) disco; urgency=medium

  * DistUpgrade/{EOL,Devel}ReleaseAnnouncement,
    DistUpgrade/window_main.ui,
    data/gtkbuilder/DistUpgrade.ui,
    data/DistUpgrade.cfg,
    pre-build.sh:
    - updated for 18.10 -> 19.04
  * DistUpgrade/DistUpgradeController.py: check all the python symlinks and
    versions instead of the python one. Thanks to juliank for the assistance.
    (LP: #1799839)
  * do-release-upgrade: Do not block release upgrades if the installable
    updates are ones which are not fully phased. (LP: #1799710)

 -- Brian Murray <email address hidden> Wed, 31 Oct 2018 15:14:25 -0700

Changed in ubuntu-release-upgrader (Ubuntu):
status: In Progress → Fix Released

Hello Brian, or anyone else affected,

Accepted ubuntu-release-upgrader into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:18.10.11.1 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-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. 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 Cosmic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-cosmic
Łukasz Zemczak (sil2100) wrote :

Hello Brian, or anyone else affected,

Accepted ubuntu-release-upgrader into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:18.04.28 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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 Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Brian Murray (brian-murray) wrote :

I installed the version of ubuntu-release-upgrader from -proposed on an Ubuntu 18.10 system then rebooted into recovery mode and was able to successfully launch "repair broken packages".

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Brian Murray (brian-murray) wrote :

I tested this on Ubuntu 18.04 and while the original test case did not fail, the version of ubuntu-release-upgrader from -proposed also works. I think it is worth installing this update as it is an improvement and checks both python and python3 and we don't know what kind of crazy things people do to their systems.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:18.04.28

---------------
ubuntu-release-upgrader (1:18.04.28) bionic; urgency=medium

  * DistUpgrade/DistUpgradeController.py: check all the python symlinks and
    versions instead of the python one. Thanks to juliank for the assistance.
    (LP: #1799839)
  * do-release-upgrade: Do not block release upgrades if the installable
    updates are ones which are not fully phased. (LP: #1799710)

 -- Brian Murray <email address hidden> Thu, 01 Nov 2018 10:17:43 -0700

Changed in ubuntu-release-upgrader (Ubuntu Bionic):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:18.10.11.1

---------------
ubuntu-release-upgrader (1:18.10.11.1) cosmic; urgency=medium

  * DistUpgrade/DistUpgradeController.py: check all the python symlinks and
    versions instead of the python one. Thanks to juliank for the assistance.
    (LP: #1799839)
  * do-release-upgrade: Do not block release upgrades if the installable
    updates are ones which are not fully phased. (LP: #1799710)

 -- Brian Murray <email address hidden> Wed, 31 Oct 2018 16:15:17 -0700

Changed in ubuntu-release-upgrader (Ubuntu Cosmic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for ubuntu-release-upgrader has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in friendly-recovery (Ubuntu):
status: Triaged → Invalid
Changed in friendly-recovery (Ubuntu Bionic):
status: New → Invalid
Changed in friendly-recovery (Ubuntu Cosmic):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers