setup.py crashed with KeyError in detectNetworkDevices()

Bug #519430 reported by Evan Leibovitch
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Unassigned
hplip (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: hplip

Using Lucid Alpha 2

running hp-setup as root (after 'sudo bash')

message of setup.py crashing.

Here is what's on the console at the time this happens:

# hp-setup

HP Linux Imaging and Printing System (ver. 3.9.12)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Error: "/var/tmp/kdecache-evan" is owned by uid 1000 instead of uid 0.
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory
QFileSystemWatcher: failed to add paths: /home/evan/.config/ibus/bus
Bus::open: Can not get ibus-daemon's address.
IBusInputContext::createInputContext: no connection to ibus-daemon
Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=mdns)
|Traceback (most recent call last):
  File "/usr/share/hplip/ui4/setupdialog.py", line 1213, in NextButton_clicked
    self.showDevicesPage()
  File "/usr/share/hplip/ui4/setupdialog.py", line 529, in showDevicesPage
    filter_dict, self.search, net_search=net_search_type)
  File "/usr/share/hplip/base/device.py", line 469, in probeDevices
    detected_devices = mdns.detectNetworkDevices(ttl, timeout)
  File "/usr/share/hplip/base/mdns.py", line 311, in detectNetworkDevices
    y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % txt['ty']
KeyError: 'ty'

If "continue" is clicked, setup.py crashes again and the above text (from "Searching..." to "KeyError: 'ty'" repeats on the console.

ProblemType: Crash
Architecture: i386
CupsErrorLog:
 E [09/Feb/2010:12:41:35 -0500] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
 E [09/Feb/2010:12:42:37 -0500] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
 E [09/Feb/2010:13:06:15 -0500] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
 E [09/Feb/2010:13:21:11 -0500] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
Date: Tue Feb 9 13:41:47 2010
DistroRelease: Ubuntu 10.04
ExecutablePath: /usr/share/hplip/setup.py
InstallationMedia: Kubuntu 10.04 "Lucid Lynx" - Alpha i386 (20100112.3)
InterpreterPath: /usr/bin/python2.6
Lpstat: Error: command ['lpstat', '-v'] failed with exit code 1: lpstat: No destinations added.
MachineType: Hewlett-Packard HP Compaq dc7800p Small Form Factor
Package: hplip-data 3.9.12-2ubuntu3
PackageArchitecture: all
Papersize: letter
ProcAttrCurrent: unconfined (enforce)
ProcCmdLine: BOOT_IMAGE=/vmlinuz-2.6.32-12-generic root=UUID=b2f7b796-7136-4476-ad02-ae45e0418943 ro quiet splash
ProcCmdline: python /usr/bin/hp-setup
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=C
 LANGUAGE=
ProcVersionSignature: Ubuntu 2.6.32-12.17-generic
PythonArgs: ['/usr/bin/hp-setup']
SourcePackage: hplip
Title: setup.py crashed with KeyError in detectNetworkDevices()
Uname: Linux 2.6.32-12-generic i686
UserGroups:

dmi.bios.date: 07/18/2007
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: 786F1 v01.04
dmi.board.asset.tag: CAC845009X
dmi.board.name: 0AA8h
dmi.board.vendor: Hewlett-Packard
dmi.chassis.asset.tag: CAC845009X
dmi.chassis.type: 4
dmi.chassis.vendor: Hewlett-Packard
dmi.modalias: dmi:bvnHewlett-Packard:bvr786F1v01.04:bd07/18/2007:svnHewlett-Packard:pnHPCompaqdc7800pSmallFormFactor:pvr:rvnHewlett-Packard:rn0AA8h:rvr:cvnHewlett-Packard:ct4:cvr:
dmi.product.name: HP Compaq dc7800p Small Form Factor
dmi.sys.vendor: Hewlett-Packard

Related branches

Revision history for this message
Evan Leibovitch (evan-telly) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Evan Leibovitch (evan-telly) wrote :

Upgraded today to version 3.9.12-2ubuntu4 of hplip. No change in the problem.

visibility: private → public
Revision history for this message
Doug Holton (edtechdev) wrote :

I see the same error with 3.10.2

Revision history for this message
mario dejung (other-dejung) wrote :

I found a solution for this issue:

Edit File /usr/share/hplip/base/mdns.py around line 311:

#y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % txt['ty']
try:
    y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % txt['ty']
except KeyError:
    log.debug("NO ty Key in txt: %s" % repr(txt))

Revision history for this message
Evan Leibovitch (evan-telly) wrote :

Could you please attach the corrected file? I've tried editing the file a dozen ways to add these lines and get a syntax error each time. I'm not familiar with Python indenting style.

Thanks!

Revision history for this message
Evan Leibovitch (evan-telly) wrote :

Update: after a few more tries, the script now runs and apparently creates the appropriate printer setup. But upon exiting the 'hp-setup' script there is a "Segmentation fault" reported.

Revision history for this message
mario dejung (other-dejung) wrote :

Ok, this is the file...

Revision history for this message
mario dejung (other-dejung) wrote :

Hm, I have no problems with Segmentation fault... Sorry...
You can try my file, but I'm sure, it will not fix the SegFault...

Revision history for this message
Jacques-Olivier Farcy (jakatak) wrote :

Hi,

I had the same problem :

Ubuntu 10.04, hplip + hplip-gui and key error ...

I used the patch mdns.py and everything is working good now.

Thanks

Revision history for this message
Markus Neteler (neteler) wrote :

The problem continues in hplip-3.11.5. Above fix help, diff attached.
Please fix it upstream.

Changed in hplip (Ubuntu):
status: New → In Progress
Changed in hplip (Ubuntu):
status: In Progress → Fix Committed
milestone: none → ubuntu-11.10-beta-2
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package hplip - 3.11.7-0ubuntu5

---------------
hplip (3.11.7-0ubuntu5) oneiric; urgency=low

  * debian/patches/mdns-py-network-printer-search-key-error.dpatch:
    In some cases a search of network printers with the hp-setup utility
    crashed with a key error (LP: #519430).
 -- Till Kamppeter <email address hidden> Thu, 1 Sep 2011 00:42:00 +0200

Changed in hplip (Ubuntu):
status: Fix Committed → Fix Released
Changed in hplip:
status: New → Fix Committed
Revision history for this message
Sarbeswar Meher (sarbeswar-meher) wrote :

Fix released in hplip-3.11.10.

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