TypeError: expected string or buffer

Bug #824799 reported by Fabio Marconi
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Hello
After running ubuntu-bug in terminal i've seen this:

ubuntu@ubuntu:~$ ubuntu-bug ubiquity
ERROR: hook /usr/share/apport/package-hooks//source_ubiquity.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 659, in add_hooks_info
    symb['add_info'](self, ui)
  File "/usr/share/apport/package-hooks//source_ubiquity.py", line 31, in add_info
    match = re.search('ubiquity.*Ubiquity (.*)\n', report['UbiquitySyslog'])
  File "/usr/lib/python2.7/re.py", line 142, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or buffer
ubuntu@ubuntu:~$ Created new window in existing browser session.
Then launching ubuntu-bug apport for this:

ubuntu@ubuntu:~$ ubuntu-bug apport
ubuntu@ubuntu:~$ [20195:20215:2449641831:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449642389:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449642433:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20215:2449643900:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449644568:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449644617:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449646794:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449646836:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449648875:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449648910:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449653836:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449653885:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449656300:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[20195:20221:2449656337:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.

But everythings seems working.
Thanks
Fabio

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: apport 1.21.2-0ubuntu10
ProcVersionSignature: Ubuntu 3.0.0-7.9-generic 3.0.0
Uname: Linux 3.0.0-7-generic x86_64
Architecture: amd64
CasperVersion: 1.277
Date: Thu Aug 11 22:38:23 2011
LiveMediaBuild: Lubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110807)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

Is there actually a file /var/log/installer/syslog on the system you were running ubuntu-bug ubiquity on? Thanks in advance.

Changed in apport (Ubuntu):
status: New → Incomplete
importance: Undecided → High
Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Hello Brian
No, I'm sorry but that I've reused that disk for another installation test
Thanks
Fabio

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

I was able to recreate this by removing my syslog file in /var/log/installer so it seems the ubiquity source package hook should ensure the file exists before try to search it.

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

The problematic part looks to be the following (particularly the if statement):

    if os.access(f, os.R_OK):
        report[ident] = (f,)
    else:
        apport.hookutils.attach_root_command_outputs(report,
            {ident: "cat '%s'" % f})

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

Right, "(f,)" just attaches a file reference, so you can't directly grep it in the same hook. So your solution with reading the file contents looks fine, thanks!

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

This bug was fixed in the package apport - 1.21.3-0ubuntu2

---------------
apport (1.21.3-0ubuntu2) oneiric; urgency=low

  * data/package-hooks/source_ubiquity.py:
    - attach the contents of syslog in the case where it is readable by the
      user (LP: #824799)
    - prevent reporting of bugs due to I/O error with installation media
 -- Brian Murray <email address hidden> Wed, 17 Aug 2011 14:43:21 +0200

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