package sosreport 4.4-1ubuntu0.18.04.1 failed to install/upgrade: installed sosreport package post-installation script subprocess returned error exit status 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sosreport (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Fix Committed
|
High
|
Arif Ali |
Bug Description
[ Impact ]
On release upgrade from Xenial to Bionic,
there seems to be an unknown corner case
(difficult to reproduce) that Python 3.5
from Xenial is still in place at the time
sosreport from Bionic is installed, which
breaks postinst/py3compile as the project
has f-strings, which requires Python 3.6.
This causes an error on do-release-upgrade
for affected users, who may have a need to
upgrade in order to get Ubuntu Pro updates.
This is the reason this is being uploaded
to the Ubuntu Archive for Bionic (now ESM),
and not only into the 'Bionic ESM' archive.
[ Test Plan ]
The bug is not easily reproducible, and has been tested by many people within
the team (see comment history).
One way to force the issue (although not on release upgrade)
is add the bionic repo to a xenial machine, and try upgrading
sosreport. In this case, the error happens
This is the only test case we have to _reproduce the issue_.
Therefore, since the change makes sense
and is expected not to cause regressions,
the test is to check for (no) regressions.
1) Run do-release-upgrade from Xenial to Bionic
without -proposed enabled, which is not expected
to hit the issue because things usually work.
2) Run do-release-upgrade from Xenial to Bionic
*with* -proposed enabled, which is not expected
to hit issue either because of the fix in place.
3) Compare terminal output, apt history, `dpkg -l`
between each cases, and check for no differences
in package install order, or unexpected things.
(see comments 19-31).
4) Compare the sosreport package .deb control and
contents before/after, to make sure the only diff
is the expected Python version in `Depends:`.
[ Where problems could occur ]
* The package may not install
* The package may not have the right dependencies
* There could be other factors in play that the above that we may not have seen entirely
[ Other Info ]
The proposed fix adds "X-Python3-Version: >= 3.6" to the control file, and this
is based on the upstream dependency, and that 3.6 and above are supported.
This does not have to be reflected in all packages for consistency, as the only
potentially affected release/upgrade is Xenial-Bionic, as clarified by Steve L.
in uploads for other series with this change (bug 2054395 comment 50):
> + - Add 'X-Python3-Version: >= 3.6' to ensure we use the python
> + revision that is supported. (LP #2038648)
>
> Well this is pointless, since python3 is >= 3.6 in all releases after bionic
[ Original Description ]
This is what I got when I tried do-release-upgrade from 16.04 to 18.04
Setting up sosreport (4.4-1ubuntu0.
File "/usr/lib/
f"Failed to communicate with Metadata Server "
SyntaxError: invalid syntax
dpkg: error processing package sosreport (--configure):
installed sosreport package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
sosreport
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/
Exception during pm.DoInstall(): E:Sub-process /usr/bin/dpkg returned an error code (1)
ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: sosreport 4.4-1ubuntu0.
ProcVersionSign
Uname: Linux 4.15.0-213-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.29
AptOrdering: NULL: ConfigurePending
Architecture: amd64
Date: Fri Oct 6 11:34:34 2023
Ec2AMI: ami-1e749f67
Ec2AMIManifest: (unknown)
Ec2Availability
Ec2InstanceType: m3.xlarge
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ErrorMessage: installed sosreport package post-installation script subprocess returned error exit status 1
Python3Details: /usr/bin/python3.5, Python 3.5.2, python3-minimal, 3.5.1-3
PythonDetails: /usr/bin/python2.7, Python 2.7.17, python-minimal, 2.7.15~rc1-1
RelatedPackageV
dpkg 1.19.0.5ubuntu2.4
apt 1.6.17
SourcePackage: sosreport
Title: package sosreport 4.4-1ubuntu0.
UpgradeStatus: Upgraded to xenial on 2023-10-06 (0 days ago)
Changed in sosreport (Ubuntu Bionic): | |
importance: | Undecided → High |
tags: | added: patch |
tags: | removed: server-triage-discuss |
Changed in sosreport (Ubuntu Bionic): | |
status: | Incomplete → Triaged |
Changed in sosreport (Ubuntu Bionic): | |
status: | Incomplete → In Progress |
description: | updated |
description: | updated |
description: | updated |
Changed in sosreport (Ubuntu Bionic): | |
status: | Incomplete → In Progress |
Thanks for reporting this bug.
This is an interesting one. The user is upgrading from xenial to bionic.
xenial has python 3.5, bionic has python 3.6.
During the postinst (included by dh_python), sosreport runs a python script containing an f-string. However f-strings were only introduced in python 3.6. In this case, the postinst ran with python 3.5, which results in a syntax error when the f-string is parsed.