applet.py crashed with KeyError in refresh()

Bug #768237 reported by Steffen Röcker
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: system-config-printer

This happened after cups has been restarted after a crash.

ProblemType: Crash
DistroRelease: Ubuntu 10.04
Package: system-config-printer-gnome 1.2.0+20100408-0ubuntu5.2
ProcVersionSignature: Ubuntu 2.6.32-30.59-generic 2.6.32.29+drm33.13
Uname: Linux 2.6.32-30-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
CupsErrorLog: E [21/Apr/2011:12:29:16 +0200] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
Date: Thu Apr 21 12:29:20 2011
ExecutablePath: /usr/share/system-config-printer/applet.py
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
InterpreterPath: /usr/bin/python2.6
Lpstat:
 device for ekpccprinterAtFZK_HPColorLJCP2025dn: ipp://129.13.102.248:631/printers/ekpccprinterAtFZK_HPColorLJCP2025dn
 device for lp0: ipp://129.13.102.248:631/printers/lp0
 device for lp1: ipp://129.13.102.248:631/printers/lp1
 device for lp2: ipp://129.13.102.248:631/printers/lp2
 device for lptrans: ipp://129.13.102.248:631/printers/lptrans
MachineType: Hewlett-Packard HP Compaq dc5850 Microtower
PackageArchitecture: all
Papersize: a4
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-30-generic root=UUID=ebb5e293-5dad-4d5a-9415-a2fc432bcc88 ro quiet splash
ProcCmdline: python /usr/share/system-config-printer/applet.py
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/share/system-config-printer/applet.py']
SourcePackage: system-config-printer
Title: applet.py crashed with KeyError in refresh()
UserGroups: audio audioalt dialout plugdev video
dmi.bios.date: 04/09/2008
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: 786F6 v01.09
dmi.board.name: 3029h
dmi.board.vendor: Hewlett-Packard
dmi.chassis.asset.tag: CZC8335ZZ6
dmi.chassis.type: 6
dmi.chassis.vendor: Hewlett-Packard
dmi.modalias: dmi:bvnHewlett-Packard:bvr786F6v01.09:bd04/09/2008:svnHewlett-Packard:pnHPCompaqdc5850Microtower:pvr:rvnHewlett-Packard:rn3029h:rvr:cvnHewlett-Packard:ct6:cvr:
dmi.product.name: HP Compaq dc5850 Microtower
dmi.sys.vendor: Hewlett-Packard

Revision history for this message
Steffen Röcker (sroecker) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Changed in system-config-printer (Ubuntu):
status: New → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Tim, can you have a look into this problem?

Changed in system-config-printer (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Drew Scott Daniels (drewdaniels) wrote :

Hi,

Seems straight forward in where the problem is (though maybe not the root cause):
...
File "/usr/share/system-config-printer/monitor.py", line 553, in refresh
    if job['job-state'] < cups.IPP_JOB_CANCELED:
KeyError: 'job-state'
...
Relevant code:
    545 debugprint ("Created subscription %d" % self.sub_id)
    546
    547 if self.monitor_jobs:
    548 jobs = self.jobs.copy ()
    549 if self.which_jobs not in ['all', 'completed']:
    550 # Filter out completed jobs.
    551 filtered = {}
    552 for jobid, job in jobs.iteritems ():
    553 if job['job-state'] < cups.IPP_JOB_CANCELED:
    554 filtered[jobid] = job
    555 jobs = filtered

So job exists but doesn't have a state. I guess a check for job having that key could be done, but I don't know whether filtered is needed.

If you need debugging turned on, I may be able to help. I'd prefer instructions as I don't want to look it up. As it's python I could even add some code, but again I don't want to spend much time looking things up right now so some direction would speed things up for us.

Thanks,

     Drew Daniels
Blog: http://www.boxheap.net/ddaniels/blog

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.