lsb_release crashed with ImportError in <module>()

Bug #383697 reported by Daniel Hahler
This bug affects 320 people
Affects Status Importance Assigned to Milestone
lsb (Ubuntu)
Fix Released
High
Michael Vogt
postfix (Ubuntu)
Fix Released
Medium
LaMont Jones
util-linux (Ubuntu)
Fix Released
Medium
Canonical Foundations Team

Bug Description

lsb_release is sometimes invoked during upgrades, when the lsb-release package is unconfigured. Under these circumstances, lsb_release crashes, generating a crash report.

In particular, it is used by the mount package, which is Essential and does not declare a dependency on lsb-release (which is not Essential).

Related branches

Revision history for this message
Daniel Hahler (blueyed) wrote :
tags: removed: need-duplicate-check
Matt Zimmerman (mdz)
description: updated
Changed in lsb (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in util-linux (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in lsb (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Matt Zimmerman (mdz)
visibility: private → public
Revision history for this message
Colin Watson (cjwatson) wrote :

This is currently painful to fix in lsb-release because python-support does not have the necessary feature ("include-links" in python-central; see https://blueprints.launchpad.net/ubuntu/+spec/foundations-karmic-robust-python-packaging). In the meantime, I recommend that the mount package should do its distribution test at build-time rather than at run-time, constructing the preinst dynamically.

Revision history for this message
Colin Watson (cjwatson) wrote :

I know LaMont prefers to keep the packaging as common between Debian and Ubuntu as possible. LaMont/Scott, how about the attached patch?

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: [Bug 383697] Re: lsb_release crashed with ImportError in <module>()

On Tue, 2009-06-16 at 10:46 +0000, Colin Watson wrote:

> I know LaMont prefers to keep the packaging as common between Debian and
> Ubuntu as possible. LaMont/Scott, how about the attached patch?
>
I think we've tended not to worry with the preinst/postinst etc. because
they're pretty different

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: Bug 383697: lsb_release crashed with ImportError in <module>()

On Mon, 2009-06-29 at 15:43 -0500, Robbie Williamson wrote:
> [from earlier today on ubuntu-devel]:
>
> <robbiew> cjwatson: Keybuk: do you know what the current status of bug 383697
> is? I can't tell from the last few comments.
>
> <cjwatson> robbiew: no progress since I sent that patch, AFAICS ...
>
> <cjwatson> Keybuk: do you want me to rework it as an Ubuntu-specific patch as
> implied by your last comment (it would involve nothing more than removing that
> block) or are you happy to apply my patch as-is?
> ...
>
> Any response to this Scott?
>
Yes ;) Colin should respond on the bug, not on IRC <g>

The way the postinst is mangled is a bit confusing - if I could have the
diff without that, I'll apply it.

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
Colin Watson (cjwatson) wrote :

Oh, well, in that case the updated patch is rather trivial. How about this?

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Won't this be a bug in Debian as well?

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 383697] Re: lsb_release crashed with ImportError in <module>()

On Mon, Jul 06, 2009 at 03:24:23PM -0000, Scott James Remnant wrote:
> Won't this be a bug in Debian as well?

Debian would need to make the code in question unconditional rather than
using lsb_release. I haven't provided a patch for that but it's trivial;
just remove the if/fi and an indentation level.

If Debian wants to keep the run-time check for whether the system in use
is in fact Debian, then they should use my last-but-one patch (and in
that case Ubuntu might as well do so too). Take your pick.

Revision history for this message
cazacugmihai (cazacugmihai) wrote :

I've got this error too.

Revision history for this message
Shadow (nathangrave3000) wrote :

Got the error too.

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

This bug was fixed in the package util-linux - 2.15.1~rc1-1ubuntu3

---------------
util-linux (2.15.1~rc1-1ubuntu3) karmic; urgency=low

  * Remove lsb_release call from mount.preinst and just unconditionally
    remove the guarded code from the Ubuntu package; lsb_release is not
    guaranteed to be usable without a Pre-Depends, which is not really
    desirable here (LP: #383697).

 -- Colin Watson <email address hidden> Fri, 10 Jul 2009 18:06:37 +0100

Changed in util-linux (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote :

It might be nice for lsb_release to be a bit more tolerant of this kind of thing, given its rather central position in the system, but it's always possible to work around it, so I'm downgrading the remaining part of this bug to wishlist.

Changed in lsb (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → nobody
importance: Medium → Wishlist
Changed in util-linux (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

I encountered this problem yesterday when I upgraded a Jaunty machine to Karmic. The version of util-linux I got was 2.15.1~rc1-1ubuntu3.

Revision history for this message
Colin Watson (cjwatson) wrote :

On Mon, Jul 13, 2009 at 12:34:45PM -0000, Jean-Paul Calderone wrote:
> I encountered this problem yesterday when I upgraded a Jaunty machine to
> Karmic. The version of util-linux I got was 2.15.1~rc1-1ubuntu3.

It's probably a different bug caused by some other package. Please
attach /var/log/apt/term.log so that we can tell.

Revision history for this message
Julian Lam (julian-lam) wrote :

Hi all,

Just upgraded to Karmic:
'util-linux:
  Installed: 2.16-1ubuntu1
  Candidate: 2.16-1ubuntu1
  Version table:
 *** 2.16-1ubuntu1 0
        500 http://ubuntu.mirror.rafal.ca karmic/main Packages
        100 /var/lib/dpkg/status

Looks like the problem still occurs, despite upstream comments indicating otherwise...!

Revision history for this message
Colin Watson (cjwatson) wrote :

(This was never an upstream bug in the first place.)

It's probably a different bug caused by some other package. Please attach /var/log/apt/term.log so that we can tell.

Revision history for this message
Colin Watson (cjwatson) wrote :

On my system (this is by no means necessarily complete):

./postfix.config:27:my $distribution = lc(`lsb_release -is 2>/dev/null`);
./samba.postinst:125: && [ "`lsb_release -s -i`" = "Ubuntu" ]

samba depends on lsb-base so it's probably OK. postfix has no way of doing so here - the only way to make this work would be to make lsb_release behave truly as Essential. At least for the moment, I think it would be better for postfix to do this check at build-time.

Changed in postfix (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Packelini (paspaljetu) wrote : Re: [Bug 383697] Re: lsb_release crashed with ImportError in <module>()

Hi Julian.
Can you tell me, how I'm gonna do this upgrade from Jaunty do Karmic.
Thanks.

________________________________
From: Julian Lam <email address hidden>
To: <email address hidden>
Sent: Sunday, July 19, 2009 7:06:38 PM
Subject: [Bug 383697] Re: lsb_release crashed with ImportError in <module>()

Hi all,

Just upgraded to Karmic:
'util-linux:
  Installed: 2.16-1ubuntu1
  Candidate: 2.16-1ubuntu1
  Version table:
*** 2.16-1ubuntu1 0
        500 http://ubuntu.mirror.rafal.ca karmic/main Packages
        100 /var/lib/dpkg/status

Looks like the problem still occurs, despite upstream comments
indicating otherwise...!

--
lsb_release crashed with ImportError in <module>()
https://bugs.launchpad.net/bugs/383697
You received this bug notification because you are a direct subscriber
of a duplicate bug.

Status in “lsb” package in Ubuntu: Triaged
Status in “util-linux” package in Ubuntu: Fix Released

Bug description:
lsb_release is sometimes invoked during upgrades, when the lsb-release package is unconfigured. Under these circumstances, lsb_release crashes, generating a crash report.

In particular, it is used by the mount package, which is Essential and does not declare a dependency on lsb-release (which is not Essential).

Revision history for this message
johnshen (jshen) wrote :

i am not sure whether it is related, but the 2.6.31-4-generic booting crashed with not even alt-ctl-del working. however, if i start with the recovery mode and then continue to boot normally, it was fine. could not find anything in logs and when i got into gnome, there was an exclamation mark telling me to report this bug. please let me know if there is something else i should do to get more details.

Revision history for this message
johnshen (jshen) wrote :

more information about the crash - actually it seems to be either x or gnome. in fact booting into recovery and then resume normal booting also stopped working. however, i was able to complete boot by alt-ctrl-f1 (try to watch where it crashed), and then it did not crash at all and booted into gdm just fine. weird.

Revision history for this message
Colin Watson (cjwatson) wrote :

I figured out what's really going on here - the debconf GNOME frontend calls lsb_release! No wonder we've been getting so many duplicates.

Changed in lsb (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
importance: Wishlist → High
Revision history for this message
Kristian Klette (klette) wrote :

Bug appears on AMD64-version as well, so the i386-tag is not needed I would think :-)

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 383697] Re: lsb_release crashed with ImportError in <module>()

Feel free to edit; I'm not going to waste time fine-tuning tags :-)

tags: added: amd64
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lsb - 4.0-0ubuntu3

---------------
lsb (4.0-0ubuntu3) karmic; urgency=low

  * rebuild using python-central and DH_PYCENTRAL=include-links
    (LP: #383697)
  * debian/control:
    - set XS-Python-Version to "all"
    - depend on python-central
  * debian/lsb-release.dirs, debian/rules:
    - install into usr/share/pyshared/

 -- Michael Vogt <email address hidden> Fri, 21 Aug 2009 16:44:13 +0200

Changed in lsb (Ubuntu):
status: Triaged → Fix Released
Colin Watson (cjwatson)
Changed in lsb (Ubuntu):
assignee: Colin Watson (cjwatson) → Michael Vogt (mvo)
Revision history for this message
LaMont Jones (lamont) wrote :

Given that the bug is fixed in LSB, and unlikely to be hit anywhere (there are other issues with trying to install postfix before lsb-release is configured on an ubuntu system), I'm going to consider the bug fixed, esp since lsb has been fixed to deal with it correctly.

Changed in postfix (Ubuntu):
assignee: nobody → LaMont Jones (lamont)
status: Triaged → Fix Released
To post a comment you must log in.