Samba apport hook - AttributeError: 'NoneType' object has no attribute 'information'

Bug #2016776 reported by Bryce Harrington
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Forwarding for Johan van Dijk, that hit this when reporting LP: #2015666

"""
when I run "ubuntu-bug /var/crash/_usr_sbin_smbd.0.crash" I get an error:
........................................................................................ERROR: hook /usr/share/apport/package-hooks/source_samba.py crashed:
...........Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 228, in _run_hook
    symb['add_info'](report, ui)
...... File "/usr/share/apport/package-hooks/source_samba.py", line 93, in add_info
    ui.information("As a part of the bug reporting process, you'll be asked as series of questions to help provide a more descriptive bug report. Please answer the following questions to the best of your abilities. Afterwards, a browser will be opened to finish filing this as a bug in the Launchpad bug tracking system.")
.AttributeError: 'NoneType' object has no attribute 'information'
"""

I was not able to reproduce this filing from my own computer using his _usr_sbin_smdb.0.crash file, however in looking at the source code, it looks like add_info(report, ui) uses the ui parameter without first checking if its defined. So the fix would be to add a check and take appropriate action, for example:

    if not ui:
        raise StopIteration # no GUI available for interacting with user

However, possibly this use case includes reporting bugs from headless servers, which might be why ui is undefined. That's probably a usecase we want to support. So in this case, instead of refusing to file a bug report, it may be better to make some informed assumptions regarding the files and logs to collect, and JFDI.

Tags: bitesize
Changed in samba (Ubuntu):
status: New → Triaged
tags: added: bitesize
tags: added: server-triage-discuss
tags: removed: server-triage-discuss
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.