22.04: python3* mismatched phasing breaks dist-upgrades

Bug #1990586 reported by Jeremy Bícha
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Critical
Julian Andres Klode
Jammy
Fix Released
Undecided
Julian Andres Klode
python3-defaults (Ubuntu)
Fix Released
Critical
Unassigned
python3-stdlib-extensions (Ubuntu)
Fix Released
Critical
Unassigned
python3.10 (Ubuntu)
Fix Released
Critical
Unassigned

Bug Description

Impact
------
Users who manually run sudo apt dist-upgrade without paying attention can remove essential parts of their system

Test Plan
---------
autopkgtests run the integration test suite. We have added a simplified version of the EDSP file attached here with additional fields for the phasing info (and support to the EDSP reader) to automatically check this as part of the test suite.

The changes made were to essentially only include installed and phased python3.10, python3-defaults upgrades. And then we run the solver on that and check the exact actions it takes, which is an autoremove of systemd-hwe-hwdb which is fine.

Before the change, it was removing half the system.

Original test case:
This test case won't work as well if phasing is set to 0% or 100%

Create /etc/apt/apt.conf.d/phasing and set its contents to
APT::Machine-ID 2c030cfce3b4487f9810f12a3ac6e87c;

Then run

sudo apt update
sudo apt dist-upgrade

Where problems could occur
--------------------------
This fix touches the dist-upgrade code and the enablement for the test case also touches the EDSP writer and reader, so problems can occur in the EDSP debugging bits and during dist-upgrades, related to phasing upgrades.

Workaround In Advance
---------------------
Don't run sudo apt dist-upgrade. Just run sudo apt upgrade
Or use Update Manager or the Ubuntu Store to apply updates

Workaround Afterwards
---------------------
Fortunately, apt phasing is ignored for new package installs. So to get your Ubuntu Desktop back, just run

sudo apt install ubuntu-desktop

Other Info
----------
These 3 updates were published today:
python3-stdlib-extensions
python3-defaults
python3.10

Suggested Fix
-------------
Fully phase those 3 source packages to 100%

Apt Output
----------
The following packages were automatically installed and are no longer required:
  apg apport-symptoms aptdaemon-data avahi-utils cups-pk-helper distro-info gdb gedit-common genisoimage gir1.2-dbusmenu-glib-0.4 gir1.2-dee-1.0 gir1.2-goa-1.0 gir1.2-gst-plugins-base-1.0
  gir1.2-gtksource-4 gir1.2-gudev-1.0 gir1.2-notify-0.7 gir1.2-packagekitglib-1.0 gir1.2-rb-3.0 gir1.2-secret-1 gir1.2-snapd-1 gir1.2-totem-1.0 gir1.2-totemplparser-1.0 gir1.2-udisks-2.0
  gir1.2-unity-7.0 gir1.2-vte-2.91 gir1.2-wnck-3.0 gnome-control-center-faces gnome-software-common gnome-terminal-data hplip-data ibus-data ibus-gtk4 libbabeltrace1 libboost-regex1.74.0
  libc6-dbg libcolord-gtk1 libdebuginfod-common libdebuginfod1 libdmapsharing-3.0-2 libglu1-mesa libgpod-common libgpod4 libgsound0 libgssdp-1.2-0 libgupnp-1.2-1 libgupnp-av-1.0-3
  libgupnp-dlna-2.0-4 libhpmud0 libimagequant0 libipt2 liblirc-client0 libmalcontent-0-0 libnetplan0 libraqm0 librsync2 librygel-core-2.6-2 librygel-db-2.6-2 librygel-renderer-2.6-2
  librygel-server-2.6-2 libsane-hpaio libsgutils2-2 libsource-highlight-common libsource-highlight4v5 libwhoopsie-preferences0 libwnck-3-0 libwnck-3-common libxatracker2 libxres1 libxss1
  libxvmc1 mobile-broadband-provider-info network-manager-gnome patch printer-driver-hpcups printer-driver-postscript-hp python-apt-common python3-blinker python3-certifi python3-cffi-backend
  python3-chardet python3-click python3-colorama python3-cryptography python3-dateutil python3-debconf python3-debian python3-defer python3-distro-info python3-fasteners python3-future
  python3-httplib2 python3-idna python3-importlib-metadata python3-jeepney python3-jwt python3-keyring python3-launchpadlib python3-lazr.restfulclient python3-lazr.uri python3-lockfile
  python3-louis python3-monotonic python3-more-itertools python3-oauthlib python3-olefile python3-pexpect python3-pkg-resources python3-problem-report python3-ptyprocess python3-pyparsing
  python3-requests python3-rfc3339 python3-secretstorage python3-six python3-tz python3-urllib3 python3-wadllib python3-xkit python3-zipp rygel whoopsie-preferences x11-apps x11-session-utils
  xbitmaps xbrlapi xcvt xfonts-scalable xinit xinput xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-libinput xserver-xorg-input-wacom xserver-xorg-video-all
  xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-nouveau xserver-xorg-video-qxl xserver-xorg-video-radeon
  xserver-xorg-video-vesa xserver-xorg-video-vmware
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  apport apport-gtk aptdaemon apturl apturl-common command-not-found deja-dup duplicity gedit gnome-control-center gnome-online-accounts gnome-software gnome-software-plugin-snap gnome-terminal
  hplip ibus ibus-table language-selector-common language-selector-gnome nautilus-extension-gnome-terminal nautilus-share netplan.io networkd-dispatcher orca python3-apport python3-apt
  python3-aptdaemon python3-aptdaemon.gtk3widgets python3-bcrypt python3-brlapi python3-cairo python3-commandnotfound python3-cups python3-cupshelpers python3-dbus python3-distupgrade
  python3-gi python3-gi-cairo python3-ibus-1.0 python3-macaroonbakery python3-mako python3-markupsafe python3-nacl python3-netifaces python3-paramiko python3-pil python3-protobuf
  python3-pyatspi python3-pymacaroons python3-renderpm python3-reportlab python3-reportlab-accel python3-software-properties python3-systemd python3-uno python3-update-manager python3-yaml
  rhythmbox-plugin-alternative-toolbar rhythmbox-plugins software-properties-common software-properties-gtk system-config-printer system-config-printer-common system-config-printer-udev
  totem-plugins ubuntu-advantage-desktop-daemon ubuntu-advantage-tools ubuntu-desktop ubuntu-desktop-minimal ubuntu-drivers-common ubuntu-minimal ubuntu-release-upgrader-core
  ubuntu-release-upgrader-gtk ubuntu-session unattended-upgrades update-manager update-manager-core update-notifier update-notifier-common usb-creator-common usb-creator-gtk xorg xserver-xorg
The following NEW packages will be installed:
  gnome-session
The following packages have been kept back:
  grub-efi-amd64-bin grub-efi-amd64-signed gzip libnss-systemd libpam-systemd libpython3-stdlib libpython3.10 libpython3.10-minimal libpython3.10-stdlib libspeechd2 libsystemd0 libudev1 python3
  python3-gdbm python3-lib2to3 python3-minimal python3-speechd python3.10 python3.10-minimal speech-dispatcher speech-dispatcher-audio-plugins speech-dispatcher-espeak-ng systemd systemd-oomd
  systemd-sysv systemd-timesyncd udev xwayland
0 upgraded, 1 newly installed, 83 to remove and 28 not upgraded.

Jeremy Bícha (jbicha)
Changed in python3-stdlib-extensions (Ubuntu):
status: New → Triaged
importance: Undecided → Critical
Changed in python3-defaults (Ubuntu):
importance: Undecided → Critical
Changed in apt (Ubuntu):
importance: Undecided → Critical
status: New → Triaged
Changed in python3-defaults (Ubuntu):
status: New → Triaged
description: updated
Jeremy Bícha (jbicha)
description: updated
tags: added: rls-jj-incoming
Jeremy Bícha (jbicha)
description: updated
Revision history for this message
Julian Andres Klode (juliank) wrote :

Same issue as [Bug 1990525] [NEW] E: Internal Error, AutoRemover broke stuff. See the comment there.

Changed in apt (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Julian Andres Klode (juliank) wrote :

I've been thinking about both some more and I believe we can fix this more easily than I thought earlier, but I'd still like the data to be able to reproduce this.

Because obviously no such issues occured during testing.

In the meantime could SRU team please pull the python3.10 update, or phase it to 0 should work too?

tags: added: regression-update
Revision history for this message
Steve Langasek (vorlon) wrote :

python3{.10,-defaults,-stdlib-extensions} have all had their phasing set to 100% now to avoid this issue.

Changed in python3-defaults (Ubuntu):
status: Triaged → Fix Released
Changed in python3-stdlib-extensions (Ubuntu):
status: Triaged → Fix Committed
status: Fix Committed → Fix Released
Changed in python3.10 (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Jeremy Bícha (jbicha) wrote :
Revision history for this message
Jeremy Bícha (jbicha) wrote :

I attached the edsp file. Hope it helps.

Revision history for this message
Julian Andres Klode (juliank) wrote :

I have the fix ready in https://salsa.debian.org/apt-team/apt/-/merge_requests/262, as well as adding support for phased updates to EDSP, I'm just working on adding test cases (basically minimizing the EDSP and dumping it in the dir tbh).

Changed in apt (Ubuntu):
status: Incomplete → In Progress
Benjamin Drung (bdrung)
tags: added: foundtations-todo
description: updated
no longer affects: python3-defaults (Ubuntu Jammy)
no longer affects: python3-stdlib-extensions (Ubuntu Jammy)
no longer affects: python3.10 (Ubuntu Jammy)
Changed in apt (Ubuntu Jammy):
status: New → Triaged
assignee: nobody → Julian Andres Klode (juliank)
Changed in apt (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
Revision history for this message
Robie Basak (racb) wrote :

In terms of risk, touching apt is always going to be high risk because users need apt to revert or upgrade away from any regression. QA is therefore essential. Normally I'd like this to "bake" in the development release first, but given the nature of the bug, that's probably not going to give us any practical benefit over testing this in jammy-proposed. In terms of the details of testing, I can't think of anything that we could do better over relying on the test suite, and I'm happy to see that these bugfixes come with corresponding tests.

Since Kinetic is in beta freeze but this bugfix is urgent, I think it makes sense to accept this into jammy-proposed immediately to maximise testing opportunity.

tags: added: foundations-todo
removed: foundtations-todo
Changed in apt (Ubuntu Jammy):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Jeremy, or anyone else affected,

Accepted apt into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt/2.4.8 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Tests have passed successfully for 2.4.8 on all architectures (except i386, which is expected):

(276/290) Testcase test-ubuntu-bug-1990586: W: Ignoring failure of dpkg --add-architecture as it is likely due to pkg-config-dpkghook (see #824774)
 P P

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
tags: removed: rls-jj-incoming
Revision history for this message
Brian Murray (brian-murray) wrote :

When releasing this to -updates it seems to me like we should fully phase the update rather than having it phase and risking more issues.

Revision history for this message
Julian Andres Klode (juliank) wrote :

@Brian Phasing apt is not an issue, it's only when multiple SRUs depend on each other that the issues being fixed here actually happen.

Revision history for this message
Brian Murray (brian-murray) wrote :

Sure my concern was the SRUs coming while apt is still phasing and creating another issue.

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

This bug was fixed in the package apt - 2.5.3

---------------
apt (2.5.3) unstable; urgency=medium

  [ Povilas Kanapickas ]
  * doc: Explain that apt-get download ensures package authenticity

  [ David Kalnischkies ]
  * Keep color disabled if APT::Color was set to false
  * Don't reuse filename for in-tree builds of apt
  * Respect users pkg order on `apt install` for resolving

  [ Hideki Yamane ]
  * Fix typo in Japanese program translation

  [ lancethepants ]
  * porting (musl):
    - apt-pkg/contrib/fileutl.h Explicitly include sys/stat.h

  [ Khem Raj ]
  * porting (clang15):
    - typecast time_t and suseconds_t from std::chrono
    - interactive-helper: Undefine _FORTIFY_SOURCE

  [ Julian Andres Klode ]
  * edsp: Add support for phased updates (test in LP#1990586)
  * Check state of dependency, not depender in dependency keep back
    (LP: #1990684)
  * full-upgrade: Mark phased upgrades for keep before anything else
    (LP: #1990586)

 -- Julian Andres Klode <email address hidden> Wed, 28 Sep 2022 17:16:41 +0200

Changed in apt (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 2.4.8

---------------
apt (2.4.8) jammy; urgency=medium

  * edsp: Add support for phased updates (test in LP#1990586)
  * Check state of dependency, not dependee in dependency keep back
    (LP: #1990684)
  * full-upgrade: Mark phased upgrades for keep before anything else
    (LP: #1990586)

 -- Julian Andres Klode <email address hidden> Wed, 28 Sep 2022 17:37:51 +0200

Changed in apt (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Update Released

The verification of the Stable Release Update for apt has completed successfully and the package is now being 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.

Benjamin Drung (bdrung)
tags: removed: foundations-todo
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.