python2 cannot import lsb_release on yakkety and now xenial

Bug #1596638 reported by Curtis Hovey
50
This bug affects 10 people
Affects Status Importance Assigned to Milestone
lsb (Ubuntu)
Fix Released
High
Unassigned
Xenial
Fix Released
Critical
Unassigned

Bug Description

[SRU Justification]
Targeted fix for a regression introduced in the previous SRU; the 'lsb_release' python module is now unavailable in python 2, where it was available before the SRU.

[Test Case]
1. Install lsb-release from xenial-updates.
2. Run "python -c 'import lsb_release'".
3. Verify that the command fails with an error.
4. Install lsb-release from xenial-proposed.
5. Run "python -c 'import lsb_release'".
6. Verify that the command succeeds (silently).

[Regression potential]
Minimal; this restores the python module to the state it was prior to the latest SRU. A debdiff of the binary packages should show no other changes.

python2 cannot import lsb_release on yakkety. `locate` shows "lsb-release" installed several files, but

    /usr/lib/python2.7/dist-packages/lsb_release.py

is missing from disk. This was seen on an aws instance provisioned using the 20160526 daily image.

Curtis Hovey (sinzui)
summary: - python2 cannot import lsb_release on yakkety
+ python2 cannot import lsb_release on yakkety and now xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in lsb (Ubuntu):
status: New → Confirmed
Revision history for this message
Curtis Hovey (sinzui) wrote :

This issue is now seen in xenial. This was not a problem a few hours ago. We can see on xenial now. These versions

9.20160110ubuntu4 and 9.20160110ubuntu0.1 remove the py2 module, but do not provide a py2 package to install.

Revision history for this message
Robie Basak (racb) wrote :

Confirmed. This seems to be a regression in 9.20160110ubuntu0.1. I couldn't reproduce in a container that I'd already tested 9.20160110. Perhaps a compiled module got left behind on update? But it does affect new Xenial containers that have 9.20160110ubuntu0.1 installed fresh (not upgraded). This impacts server use cases where people deploy new cattle instead of upgrading pets.

tags: added: regression-update
Changed in lsb (Ubuntu):
importance: Undecided → Critical
status: Confirmed → Triaged
Changed in lsb (Ubuntu Xenial):
status: New → Triaged
importance: Undecided → Critical
Changed in lsb (Ubuntu):
importance: Critical → High
Revision history for this message
Aaron Bentley (abentley) wrote :

It also affects use cases where people upgrade existing machines. This happened to me sometime around July 1 to July 4 on my local machine.

Revision history for this message
Haw Loeung (hloeung) wrote :

Is there a fix in progress? Going around downgrading to 9.20160110 is a bit of a pain.

Revision history for this message
Paul Gear (paulgear) wrote :

Seen on a xenial daily image in Canonistack today.

Revision history for this message
Haw Loeung (hloeung) wrote :

An update leaves the .pyc around:

$ locate lsb_release
/usr/bin/lsb_release
/usr/lib/python2.7/dist-packages/lsb_release.pyc
/usr/lib/python2.7/dist-packages/landscape/lib/lsb_release.py
/usr/lib/python2.7/dist-packages/landscape/lib/lsb_release.pyc
/usr/lib/python3/dist-packages/lsb_release.py
/usr/lib/python3/dist-packages/__pycache__/lsb_release.cpython-35.pyc
/usr/share/man/man1/lsb_release.1.gz

Revision history for this message
Haw Loeung (hloeung) wrote :

diff -Nru lsb-9.20160110/debian/lsb-release.install lsb-9.20160110ubuntu0.1/debian/lsb-release.install
--- lsb-9.20160110/debian/lsb-release.install 2014-08-28 23:04:48.000000000 +0000
+++ lsb-9.20160110ubuntu0.1/debian/lsb-release.install 2016-06-21 21:26:24.000000000 +0000
@@ -1,2 +1,2 @@
 lsb_release /usr/bin
-lsb_release.py /usr/share/pyshared/
+lsb_release.py /usr/lib/python3/dist-packages/
diff -Nru lsb-9.20160110/debian/lsb-release.links lsb-9.20160110ubuntu0.1/debian/lsb-release.links
--- lsb-9.20160110/debian/lsb-release.links 2015-08-26 09:44:34.000000000 +0000
+++ lsb-9.20160110ubuntu0.1/debian/lsb-release.links 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-usr/share/pyshared/lsb_release.py usr/lib/python2.7/dist-packages/lsb_release.py
-usr/share/pyshared/lsb_release.py usr/lib/python3/dist-packages/lsb_release.py

(also the dependency of python3)

Steve Langasek (vorlon)
description: updated
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Curtis, or anyone else affected,

Accepted lsb into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/lsb/9.20160110ubuntu0.2 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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in lsb (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Haw Loeung (hloeung) wrote :

Fixed in 9.20160110ubuntu0.2.

Before update:

| hloeung@steelix:~$ python2.7
| ...
| >>> import lsb_release
| Traceback (most recent call last):
| File "<stdin>", line 1, in <module>
| ImportError: No module named lsb_release
| >>>

After:

| hloeung@steelix:~$ ls /usr/lib/python*/dist-packages/lsb* -l
| lrwxrwxrwx 1 root root 38 Jul 6 16:29 /usr/lib/python2.7/dist-packages/lsb_release.py -> ../../../share/pyshared/lsb_release.py
| lrwxrwxrwx 1 root root 38 Jul 6 16:29 /usr/lib/python3/dist-packages/lsb_release.py -> ../../../share/pyshared/lsb_release.py

| hloeung@steelix:~$ python2.7
| >>> import lsb_release
| >>>

Thanks guys!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Haw Loeung (hloeung) wrote :

And this if it helps:

| hloeung@steelix:~$ apt-cache policy lsb-release
| lsb-release:
| Installed: 9.20160110ubuntu0.2
| Candidate: 9.20160110ubuntu0.2
| Version table:
| *** 9.20160110ubuntu0.2 500
| 500 http://archive.ubuntu.com//ubuntu xenial-proposed/main amd64 Package
| 100 /var/lib/dpkg/status
| 9.20160110ubuntu0.1 500
| 500 http://archive.ubuntu.com//ubuntu xenial-updates/main amd64 Packages
| 9.20160110 500
| 500 http://archive.ubuntu.com//ubuntu xenial/main amd64 Packages

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

This bug was fixed in the package lsb - 9.20160110ubuntu0.2

---------------
lsb (9.20160110ubuntu0.2) xenial; urgency=medium

  * Revert changes to python2 vs. python3 installation of lsb_release.py,
    inadvertently breaking imports of lsb_release in python2. LP: #1596638.

 -- Steve Langasek <email address hidden> Wed, 06 Jul 2016 08:18:48 -0700

Changed in lsb (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of the Stable Release Update for lsb 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.

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

This bug was fixed in the package lsb - 9.20160110ubuntu5

---------------
lsb (9.20160110ubuntu5) yakkety; urgency=medium

  * Revert changes to python2 vs. python3 installation of lsb_release.py,
    inadvertently breaking imports of lsb_release in python2. LP: #1596638.

 -- Steve Langasek <email address hidden> Wed, 06 Jul 2016 08:20:18 -0700

Changed in lsb (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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