I verified ubuntu-pro-client from noble-proposed. First, reproducing the bug with old python3-minimal and current pro client (notice *** installed versions):
root@n:~# apt-cache policy python3-minimal ubuntu-pro-client python3-minimal: Install�: 3.12.3-0ubuntu1 Candidat�: 3.12.3-0ubuntu2 Table de version�: 3.12.3-0ubuntu2 500 (phased 80%) 500 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages 100 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages *** 3.12.3-0ubuntu1 500 500 http://br.archive.ubuntu.com/ubuntu noble/main amd64 Packages 100 /var/lib/dpkg/status ubuntu-pro-client: Install�: 32.3.1~24.04 Candidat�: 32.3.1~24.04 Table de version�: 33.2~24.04.1 100 100 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages *** 32.3.1~24.04 500 500 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages 100 /var/lib/dpkg/status 31.2.3 500 500 http://br.archive.ubuntu.com/ubuntu noble/main amd64 Packages root@n:~# apt install ubuntu-pro-client --reinstall Lecture des listes de paquets... Fait Construction de l'arbre des d�pendances... Fait Lecture des informations d'�tat... Fait 0 mis � jour, 0 nouvellement install�s, 1 r�install�s, 0 � enlever et 57 non mis � jour. Il est n�cessaire de prendre 229 ko dans les archives. Apr�s cette op�ration, 0 o d'espace disque suppl�mentaires seront utilis�s. R�ception de�:1 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 ubuntu-pro-client amd64 32.3.1~24.04 [229 kB] 229 ko r�ceptionn�s en 0s (2�031 ko/s) (Lecture de la base de donn�es... 34410 fichiers et r�pertoires d�j� install�s.) Pr�paration du d�paquetage de .../ubuntu-pro-client_32.3.1~24.04_amd64.deb ... Traceback (most recent call last): File "/usr/bin/py3clean", line 210, in <module> main() File "/usr/bin/py3clean", line 196, in main pfiles = set(dpf.from_package(options.package)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/python3/debpython/files.py", line 54, in from_package stdout = str(stdout, 'utf-8') ^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 584: invalid continuation byte Now I upgrade pro-client to the noble-proposed version. What I expect is that python3-minimal will be pulled in due to pro's Breaks, and no backtrace: root@n:~# apt install ubuntu-pro-client -t noble-proposed Lecture des listes de paquets... Fait Construction de l'arbre des d�pendances... Fait Lecture des informations d'�tat... Fait Les paquets suppl�mentaires suivants seront install�s�: libpython3-stdlib python3 python3-minimal ubuntu-pro-client-l10n Paquets sugg�r�s�: python3-doc python3-tk python3-venv Les paquets suivants seront mis � jour�: libpython3-stdlib python3 python3-minimal ubuntu-pro-client ubuntu-pro-client-l10n 5 mis � jour, 0 nouvellement install�s, 0 � enlever et 86 non mis � jour. Il est n�cessaire de prendre 311 ko dans les archives. Apr�s cette op�ration, 12,3 ko d'espace disque suppl�mentaires seront utilis�s. Souhaitez-vous continuer�? [O/n] R�ception de�:1 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 python3-minimal amd64 3.12.3-0ubuntu2 [27,4 kB] R�ception de�:2 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 python3 amd64 3.12.3-0ubuntu2 [23,0 kB] R�ception de�:3 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 libpython3-stdlib amd64 3.12.3-0ubuntu2 [10,0 kB] R�ception de�:4 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 ubuntu-pro-client-l10n amd64 33.2~24.04.1 [19,3 kB] R�ception de�:5 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 ubuntu-pro-client amd64 33.2~24.04.1 [231 kB] 311 ko r�ceptionn�s en 0s (2�900 ko/s) (Lecture de la base de donn�es... 34410 fichiers et r�pertoires d�j� install�s.) Pr�paration du d�paquetage de .../python3-minimal_3.12.3-0ubuntu2_amd64.deb ... D�paquetage de python3-minimal (3.12.3-0ubuntu2) sur (3.12.3-0ubuntu1) ... Param�trage de python3-minimal (3.12.3-0ubuntu2) ... (Lecture de la base de donn�es... 34410 fichiers et r�pertoires d�j� install�s.) Pr�paration du d�paquetage de .../python3_3.12.3-0ubuntu2_amd64.deb ... running python pre-rtupdate hooks for python3.12... D�paquetage de python3 (3.12.3-0ubuntu2) sur (3.12.3-0ubuntu1) ... Pr�paration du d�paquetage de .../libpython3-stdlib_3.12.3-0ubuntu2_amd64.deb ... D�paquetage de libpython3-stdlib:amd64 (3.12.3-0ubuntu2) sur (3.12.3-0ubuntu1) ... Pr�paration du d�paquetage de .../ubuntu-pro-client-l10n_33.2~24.04.1_amd64.deb ... D�paquetage de ubuntu-pro-client-l10n (33.2~24.04.1) sur (32.3.1~24.04) ... Pr�paration du d�paquetage de .../ubuntu-pro-client_33.2~24.04.1_amd64.deb ... D�paquetage de ubuntu-pro-client (33.2~24.04.1) sur (32.3.1~24.04) ... Param�trage de libpython3-stdlib:amd64 (3.12.3-0ubuntu2) ... Param�trage de python3 (3.12.3-0ubuntu2) ... running python rtupdate hooks for python3.12... running python post-rtupdate hooks for python3.12... Param�trage de ubuntu-pro-client (33.2~24.04.1) ... Installation de la nouvelle version du fichier de configuration /etc/apparmor.d/ubuntu_pro_apt_news ... Param�trage de ubuntu-pro-client-l10n (33.2~24.04.1) ... Traitement des actions diff�r�es (��triggers��) pour man-db (2.12.0-4build2)�... 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. And reinstall also works: root@n:~# apt reinstall ubuntu-pro-client Lecture des listes de paquets... Fait Construction de l'arbre des d�pendances... Fait Lecture des informations d'�tat... Fait 0 mis � jour, 0 nouvellement install�s, 1 r�install�s, 0 � enlever et 54 non mis � jour. Il est n�cessaire de prendre 231 ko dans les archives. Apr�s cette op�ration, 0 o d'espace disque suppl�mentaires seront utilis�s. R�ception de�:1 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 ubuntu-pro-client amd64 33.2~24.04.1 [231 kB] 231 ko r�ceptionn�s en 0s (12,7 Mo/s) (Lecture de la base de donn�es... 34411 fichiers et r�pertoires d�j� install�s.) Pr�paration du d�paquetage de .../ubuntu-pro-client_33.2~24.04.1_amd64.deb ... D�paquetage de ubuntu-pro-client (33.2~24.04.1) sur (33.2~24.04.1) ... Param�trage de ubuntu-pro-client (33.2~24.04.1) ... Traitement des actions diff�r�es (��triggers��) pour man-db (2.12.0-4build2)�... 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. Final versions installed: root@n:~# apt-cache policy python3-minimal ubuntu-pro-client python3-minimal: Install�: 3.12.3-0ubuntu2 Candidat�: 3.12.3-0ubuntu2 Table de version�: *** 3.12.3-0ubuntu2 500 (phased 80%) 500 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages 100 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages 100 /var/lib/dpkg/status 3.12.3-0ubuntu1 500 500 http://br.archive.ubuntu.com/ubuntu noble/main amd64 Packages ubuntu-pro-client: Install�: 33.2~24.04.1 Candidat�: 33.2~24.04.1 Table de version�: *** 33.2~24.04.1 100 100 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages 100 /var/lib/dpkg/status 32.3.1~24.04 500 500 http://br.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages 31.2.3 500 500 http://br.archive.ubuntu.com/ubuntu noble/main amd64 Packages -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to dh-python in Ubuntu. https://bugs.launchpad.net/bugs/2075337 Title: [SRU] py3clean fails when using alternate character set Status in cloud-init package in Ubuntu: New Status in dh-python package in Ubuntu: Invalid Status in python3-defaults package in Ubuntu: Fix Released Status in ubuntu-advantage-tools package in Ubuntu: New Status in cloud-init source package in Jammy: Invalid Status in dh-python source package in Jammy: Invalid Status in python3-defaults source package in Jammy: Fix Released Status in ubuntu-advantage-tools source package in Jammy: Invalid Status in cloud-init source package in Noble: Fix Committed Status in dh-python source package in Noble: Invalid Status in python3-defaults source package in Noble: Fix Released Status in ubuntu-advantage-tools source package in Noble: Fix Committed Bug description: [ Impact ] With the current version of python3-defaults in jammy and noble, packages which utilize py3compile and py3clean in their maintscripts (which is more or less any package which includes Python modules), and which also are affected by diversions installed by dpkg-divert, will fail to install/upgrade/remove on systems with non-UTF-8 locales, which include non-ASCII characters in their localized dpkg -L messages (and which therefore produce output that is not valid UTF-8). As this has the potential to break apt upgrade, the impact is quite severe (especially if this occurs during a dist-upgrade). However, the scope is probably *fairly* limited given this only affects systems with non-UTF-8 locales (something that has not been the default for many years), and which produce non-ASCII output (e.g. French characters with diacriticals) in their localized messages for dpkg -L. [ Rectification Plan ] Firstly, python3-defaults must be patched in oracular, noble, and jammy. doko has uploaded the fix upstream and synced this to oracular. Benjamin has sponsored the noble and jammy SRUs. Next, affected packages must be patched to include a "Breaks" line on earlier versions of python3-minimal (the python3-defaults binary package containing py3clean and py3compile). Packages which install Python modules are easily selected, but those affected by diversions are (computationally) impossible to select (see comment 18 for details). Thus, determining the set of affected packages was non-trivial, but Benjamin has kindly produced such a list by empirical means (see comment 24). These will be added to the ticket as they are uploaded. [ Known affected packages ] ``` $ for section in main restricted universe multiverse; do echo "noble $section:"; sqlite3 affected.sqlite3 "SELECT package, source FROM package_affected WHERE section = '$section' and install_affected = 1 AND (remove_affected = 1 OR remove_affected ISNULL) ORDER BY package;"; echo; done noble main: cloud-init|cloud-init nvme-stas|nvme-stas python3-rtslib-fb|python-rtslib-fb targetcli-fb|targetcli-fb ubiquity|ubiquity ubiquity-frontend-debconf|ubiquity ubiquity-frontend-gtk|ubiquity ubuntu-drivers-common|ubuntu-drivers-common ubuntu-pro-client|ubuntu-advantage-tools walinuxagent|walinuxagent noble restricted: noble universe: a2d|a2d apertium-apy|apertium-apy blueman|blueman borgmatic|borgmatic condor|condor cpupower-gui|cpupower-gui debomatic|debomatic dell-recovery|dell-recovery deluge-web|deluge depthcharge-tools|depthcharge-tools dhcpy6d|dhcpy6d dkimpy-milter|dkimpy-milter fenrir|fenrir galileo|galileo glances|glances graphite-carbon|graphite-carbon grokmirror|grokmirror guerillabackup|guerillabackup ionit|ionit jupyterhub|jupyterhub liquidctl|liquidctl localslackirc|localslackirc logdata-anomaly-miner|logdata-anomaly-miner lomiri|lomiri mailman3|mailman3 mailman3-full|mailman3 matrix-sydent|matrix-sydent mom|mom mopidy|mopidy mpd-sima|mpd-sima nordugrid-arc-arex|nordugrid-arc notus-scanner|notus-scanner nrpe-ng|nrpe-ng onionprobe|onionprobe openscap-daemon|openscap-daemon ospd-openvas|ospd-openvas pagekite|pagekite pagure|pagure pagure-ev-server|pagure pagure-milters|pagure pglistener|pglistener policyd-rate-limit|policyd-rate-limit postfix-mta-sts-resolver|postfix-mta-sts-resolver powa-collector|powa-collector prelude-correlator|prelude-correlator prometheus-pgbouncer-exporter|prometheus-pgbouncer-exporter prometheus-xmpp-alerts|prometheus-xmpp-alerts pyroman|pyroman python3-autopilot|autopilot python3-btchip|btchip-python python3-pyro5|pyro5 qweborf|weborf razercfg|razercfg sgt-launcher|sgt-launcher sms4you|sms4you supervisor|supervisor syncplay-server|syncplay timekpr-next|timekpr-next twms|twms ubiquity-frontend-kde|ubiquity vanguards|vanguards vaultlocker|vaultlocker voctomix-outcasts|voctomix-outcasts xdiagnose|xdiagnose noble multiverse: r4d|r4d virtualbox|virtualbox ``` On Ubuntu 22.04 (jammy) only packages in universe are affected: ``` $ sqlite3 affected-jammy.sqlite3 "SELECT package, source FROM package_affected WHERE install_affected = 1 AND (remove_affected = 1 OR remove_affected ISNULL) ORDER BY package;" ganeti-3.0|ganeti sgt-launcher|sgt-launcher ``` Note: Due to time constraints, 3861/59351 (6 %) universe package haven't been analyzed. Code and resulting database can be found on https://github.com/bdrung/bdrung-scripts/tree/lp-2075337-find-affected [ Test Plan ] Where $series is jammy or noble as appropriate, and $package is the name of the affected package being SRU'd: $ lxc launch ubuntu:$series py3clean-test $ lxc shell py3clean-test # locale-gen fr_FR Generating locales (this might take a while)... fr_FR.ISO-8859-1... done Generation complete. # update-locale LANG=fr_FR # exit # adjust terminal to ISO-8859-1 $ lxc shell py3clean-test # apt update && apt install --reinstall $package With the current version of python3-defaults in jammy and noble this should fail at the final apt install --reinstall step. With the proposed version, it should succeed. [ What Could Go Wrong? ] The potential for regression is low since the python3-defaults changes are minimal and have been reasonably tested, and the only change to affected packages is the addition of a Breaks clause (i.e. the content of the packages are unaffected, just the meta-data). The major cause for concern is that we are not 100% certain that the Breaks addition is sufficient to fix this. The Debian policy manual is ambiguous as to whether Breaks implies that the fixed package must be unpacked *before* the prerm maintscript of the package it breaks is executed; the policy manual mentions this must happen before the "unpack" phase, but prerm scripts run *before* the unpack phase. However, in all experiments run so far, this did indeed resolve the problem. Still, as an extra hedge against failure here, we intend that the python3-defaults SRU is released ASAP, and that we then delay a week to allow it to propagate before releasing SRUs for the affected packages. [ Original Description ] We noticed this in bug 2060769 but think it is a separate issue. dh_python3 is putting a py3clean invocation into package prerm maintainer scripts. When that runs, it explodes if the system character set is for example ISO-8859-1. This appears to affect every package for which dh_python3 has inserted a call to py3clean into the package prerm. python3-minimal 3.12.3-0ubuntu1 In this reproducer, cloud-init is at 24.1.3-0ubuntu3.3. Steps to reproduce: $ lxc launch ubuntu:noble rbasak-pro-l8n $ lxc shell rbasak-pro-l8n # locale-gen fr_FR Generating locales (this might take a while)... fr_FR.ISO-8859-1... done Generation complete. # update-locale LANG=fr_FR # exit # adjust terminal to ISO-8859-1 $ lxc shell rbasak-pro-l8n # apt update && apt install --reinstall cloud-init Expected results: success Actual results: Lecture des listes de paquets... Fait Construction de l'arbre des dépendances... Fait Lecture des informations d'état... Fait 0 mis à jour, 0 nouvellement installés, 1 réinstallés, 0 à enlever et 5 non mis à jour. Il est nécessaire de prendre 598 ko dans les archives. Après cette opération, 0 o d'espace disque supplémentaires seront utilisés. Réception de :1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 cloud-init all 24.1.3-0ubuntu3.3 [598 kB] 598 ko réceptionnés en 1s (926 ko/s) Préconfiguration des paquets... (Lecture de la base de données... 34406 fichiers et répertoires déjà installés.) Préparation du dépaquetage de .../cloud-init_24.1.3-0ubuntu3.3_all.deb ... Traceback (most recent call last): File "/usr/bin/py3clean", line 210, in <module> main() File "/usr/bin/py3clean", line 196, in main pfiles = set(dpf.from_package(options.package)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/python3/debpython/files.py", line 54, in from_package stdout = str(stdout, 'utf-8') ^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 2417: invalid continuation byte dpkg: avertissement: le sous-processus ancien paquet cloud-init script pre-removal a renvoyé un état de sortie d'erreur 1 dpkg: tentative d'exécution du script du nouveau paquet à la place... Traceback (most recent call last): File "/usr/bin/py3clean", line 210, in <module> main() File "/usr/bin/py3clean", line 196, in main pfiles = set(dpf.from_package(options.package)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/python3/debpython/files.py", line 54, in from_package stdout = str(stdout, 'utf-8') ^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 2417: invalid continuation byte dpkg: erreur de traitement de l'archive /var/cache/apt/archives/cloud-init_24.1.3-0ubuntu3.3_all.deb (--unpack) : le sous-processus nouveau cloud-init paquet pre-removal script a renvoyé un état de sortie d'erreur 1 dmesg: read kernel buffer failed: Operation not permitted Traceback (most recent call last): File "/usr/bin/py3compile", line 323, in <module> main() File "/usr/bin/py3compile", line 302, in main compile(files, versions, File "/usr/bin/py3compile", line 185, in compile for fn, versions_to_compile in filter_files(files, e_patterns, versions): File "/usr/bin/py3compile", line 128, in filter_files for fpath in files: File "/usr/share/python3/debpython/files.py", line 71, in filter_public for fn in files: File "/usr/share/python3/debpython/files.py", line 54, in from_package stdout = str(stdout, 'utf-8') ^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 2417: invalid continuation byte dpkg: erreur lors du nettoyage: le sous-processus paquet cloud-init script post-installation installé a renvoyé un état de sortie d'erreur 1 Des erreurs ont été rencontrées pendant l'exécution : /var/cache/apt/archives/cloud-init_24.1.3-0ubuntu3.3_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2075337/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp