OSError: [Errno 17] File exists: '/var/crash/_usr_lib_germinate_update-metapackage.py.1000.crash'

Bug #323714 reported by Loïc Minier
2
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Low
Martin Pitt
germinate (Ubuntu)
Fix Released
Low
Colin Watson

Bug Description

Hey,

I have a germinate-update-metapackage traceback which triggers apport.

The first time, the traceback appears normally, presumably apport is catching it properly and all.

The second and next times, apport's except_hook fails:
Decompressing http://archive.ubuntu.com/ubuntu/dists/jaunty/restricted/source/Sources.bz2 file ...
Downloading http://archive.ubuntu.com/ubuntu/dists/jaunty/restricted/debian-installer/binary-amd64/Packages.bz2 file ...
Decompressing http://archive.ubuntu.com/ubuntu/dists/jaunty/restricted/debian-installer/binary-amd64/Packages.bz2 file ...
Traceback (most recent call last):
  File "/usr/bin/germinate-update-metapackage", line 269, in <module>
    debootstrap_base = set(debootstrap_packages(architecture))
  File "/usr/bin/germinate-update-metapackage", line 208, in debootstrap_packages
    raise RuntimeError('Unable to retrieve package list from debootstrap: %s' % debootstrap_stdout)
RuntimeError: Unable to retrieve package list from debootstrap:
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 85, in apport_excepthook
    os.O_WRONLY|os.O_CREAT|os.O_EXCL), 'w')
OSError: [Errno 17] File exists: '/var/crash/_usr_lib_germinate_update-metapackage.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/germinate-update-metapackage", line 269, in <module>
    debootstrap_base = set(debootstrap_packages(architecture))
  File "/usr/bin/germinate-update-metapackage", line 208, in debootstrap_packages
    raise RuntimeError('Unable to retrieve package list from debootstrap: %s' % debootstrap_stdout)
RuntimeError: Unable to retrieve package list from debootstrap:

Bye

Revision history for this message
Martin Pitt (pitti) wrote :

That's a crash from germinate. Apport just refuses to overwrite a previously existing crash report.

Revision history for this message
Loïc Minier (lool) wrote :

Well this part is from apport:
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 85, in apport_excepthook
    os.O_WRONLY|os.O_CREAT|os.O_EXCL), 'w')
OSError: [Errno 17] File exists: '/var/crash/_usr_lib_germinate_update-metapackage.py.1000.crash'

I don't think apport should trigger any exception in an excepthook; it could perhaps print a message to stderr, but I would actually simply write nothing, just like when it catches a traceback.

Revision history for this message
Martin Pitt (pitti) wrote :

Unclean apport output here, adding apport task.

Changed in apport:
importance: Undecided → Low
status: New → Triaged
assignee: nobody → pitti
Revision history for this message
Loïc Minier (lool) wrote :

10:40 < pitti> lool: if you want apport to suppress its exception about the
               file already existing, I can do that
10:40 < lool> pitti: I think you should; it shouldn't be an exception in apport
              in any case
10:40 < lool> (I mean it shouldn't reach the console)
10:41 < pitti> lool: okay; what was the bug# again?

10:41 < cjwatson> the exception from germinate is basically "debootstrap
                  failed" and has been dealt with separately (by printing its
                  stderr too)

10:41 < cjwatson> maybe it should print an error and sys.exit(1) rather than
                  raising an exception though

10:42 < lool> cjwatson: ah right, that might be nice too

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

germinate should print a message and exit rather than raising an exception.

Changed in germinate:
assignee: nobody → cjwatson
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package germinate - 1.14

---------------
germinate (1.14) unstable; urgency=low

  * If germinate-update-metapackage fails, just print a message on stderr
    and exit 1, rather than raising RuntimeError (LP: #323714).

 -- Colin Watson <email address hidden> Mon, 09 Mar 2009 21:26:36 +0000

Changed in germinate:
status: In Progress → Fix Released
Martin Pitt (pitti)
Changed in apport:
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 0.145

---------------
apport (0.145) jaunty; urgency=low

  * apport/crashdb_impl/launchpad.py: Fix typo in previous upload.
  * debian/local/apport-collect: Do not crash on
    launchpadlib.errors.HTTPError, but give a proper error message and point
    out that this script needs "change anything" privileges. (LP: #338201)
  * apport_python_hook.py: Fix crash for already existing reports, and make
    behaviour equivalent to bin/apport: Silently exit for existing unseen
    crash report, and overwrite existing seen crash report. Add test cases.
    (LP: #323714)
  * general-hooks/automatix.py: Refuse to send bug reports when ultamatix is
    installed.

 -- Martin Pitt <email address hidden> Tue, 10 Mar 2009 18:45:34 +0100

Changed in apport:
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.