apport causes uncaught OSError after failed python2.6-minimal install

Bug #357339 reported by Patrick Horn
4
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
Medium
Michael Vogt

Bug Description

I was doing a upgrade using the "sudo update-manager -d" GUI.

Several minutes pass with nothing displayed on the terminal but the GUI is happily upgrading along. A few times I get weird errors about something not configuring correctly (didn't have the presence of mind to write them down). I click OK for all of them. Then, about half a minute after one of these messages the upgrader crashes with this displayed on the console:

Error in sys.excepthook:
Traceback (most recent call last):
  File "/tmp/tmpFzWtiO/DistUpgradeViewGtk.py", line 416, in _handleException
    if not run_apport():
  File "/tmp/tmpFzWtiO/DistUpgradeApport.py", line 61, in run_apport
    ret = subprocess.call(p)
  File "/usr/lib/python2.5/subprocess.py", line 444, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1153, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Original exception was:
Traceback (most recent call last):
  File "/tmp/tmpFzWtiO/jaunty", line 6, in <module>
    main()
  File "/tmp/tmpFzWtiO/DistUpgradeMain.py", line 125, in main
    app.run()
  File "/tmp/tmpFzWtiO/DistUpgradeController.py", line 1568, in run
    self.fullUpgrade()
  File "/tmp/tmpFzWtiO/DistUpgradeController.py", line 1543, in fullUpgrade
    if not self.doDistUpgrade():
  File "/tmp/tmpFzWtiO/DistUpgradeController.py", line 995, in doDistUpgrade
    if not run_apport():
  File "/tmp/tmpFzWtiO/DistUpgradeApport.py", line 61, in run_apport
    ret = subprocess.call(p)
  File "/usr/lib/python2.5/subprocess.py", line 444, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1153, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

If you look at /tmp/tmpFzWtiO/DistUpgradeApport.py, line 61, it is trying to launch "apport-qt". Sure enough, when I try to run this I see:
[14:38:55] ~$ /usr/share/apport/apport-qt
zsh: /usr/share/apport/apport-qt: bad interpreter: /usr/bin/python: no such file or directory

Since the error happened as a result of the exec call it was probably passed up the chain as a OSError (the "no such file or directory") that nobody managed to catch.

well as it turns out, my python must have been in the process of upgrading at the time because when I do "apt-get -f install" I see this:

The following extra packages will be installed:
  gedit lyx-common python2.6-minimal system-config-printer-common
  update-notifier-kde
The following NEW packages will be installed:
  python2.6-minimal
The following packages will be upgraded:
  gedit lyx-common system-config-printer-common update-notifier-kde
4 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
930 not fully installed or removed.
Need to get 0B/7306kB of archives.
After this operation, 4182kB of additional disk space will be used.
Do you want to continue [Y/n]?

These 5 packages are all the packages that had given me errors and I had to click through. After installing the problematic packages (this time it gave no errors) it proceeded to do "Setting up ..." for each other package that had changed in jaunty (a few hundred more), so basically the same thing the GUI was doing but now in the terminal.

Things are now working after doing that "apt-get -f install" so it's hard for me to tell why I was having problems, but it may be worth looking at the error handling code.
I'm attaching code to add exception handlers around the calls to "subprocess.call()"

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

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage . I have classified this bug as a bug in apport.

affects: ubuntu → apport (Ubuntu)
Revision history for this message
Martin Pitt (pitti) wrote :

Thank you! This is a patch against update-manager, reassigning.

affects: apport (Ubuntu) → update-manager (Ubuntu)
Changed in update-manager (Ubuntu):
status: New → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote :

Could we get this incorporated for Karmic?

Changed in update-manager (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
importance: Undecided → Medium
Revision history for this message
Michael Vogt (mvo) wrote :

Commited to my bzr tree, many thanks.

Changed in update-manager (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:0.124.3

---------------
update-manager (1:0.124.3) karmic; urgency=low

  [ Michael Vogt ]
  * UpdateManager/UpdateManager.py:
    - fix description display (LP: #379945), thanks
      to Richard Thomas
    - fix crash in refresh_updates_count()
  * DistUpgrade/DistUpgradeApport.py:
    - deal with errors from apport better (LP: #357339),
      thanks to Patrick Horn)
  * UpdateManager/ChangelogViewer.py:
    - fix problem for http://host/document.html. style
      entries (LP: #396393)

  [ Dustin Kirkland ]
  * debian/update-manager-core.links: install 10_release_upgrade
    into /etc/update-motd.d, rather than the daily; update-motd-3.0
    will now run these scripts on login, rather than at specified
    intervals

 -- Michael Vogt <email address hidden> Thu, 16 Jul 2009 17:49:21 +0200

Changed in update-manager (Ubuntu):
status: Fix Committed → 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.