ubuntu-bug on ec2 causes stack trace

Bug #1018552 reported by Scott Moser
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Undecided
Unassigned

Bug Description

running 'ubuntu-bug' on ec2 to report a bug results in:
ERROR: hook /usr/share/apport/general-hooks/ubuntu.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 749, in add_hooks_info
    symb['add_info'](self, ui)
  File "/usr/share/apport/general-hooks/ubuntu.py", line 34, in add_info
    add_cloud_info(report)
  File "/usr/share/apport/general-hooks/ubuntu.py", line 323, in add_cloud_info
    if ami and ami.startswith('ami'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

The fix to this as-yet-python-3-illiterate looks like:

--- data/general-hooks/ubuntu.py 2012-08-28 09:11:22 +0000
+++ data/general-hooks/ubuntu.py 2012-08-30 20:53:30 +0000
@@ -337,7 +337,7 @@
         except:
             ami = None

- if ami and ami.startswith('ami'):
+ if ami and ami.startswith(b'ami'):
             add_tag(report, 'ec2-images')
             fields = {'Ec2AMIManifest': 'ami-manifest-path',
                       'Ec2Kernel': 'kernel-id',

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: apport 2.2.5-0ubuntu1
ProcVersionSignature: User Name 3.5.0-2.2-generic 3.5.0-rc4
Uname: Linux 3.5.0-2-generic x86_64
Architecture: amd64
Date: Wed Jun 27 19:32:56 2012
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

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

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

Changed in apport (Ubuntu):
status: New → Confirmed
Scott Moser (smoser)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.5.1-0ubuntu4

---------------
apport (2.5.1-0ubuntu4) quantal; urgency=low

  * do not stack trace when ec2 metadata is available (LP: #1018552)
 -- Scott Moser <email address hidden> Thu, 30 Aug 2012 17:15:02 -0400

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

Other bug subscribers