Bug 214134 - system-config-printer crashes if bad DeviceURI line
system-config-printer crashes if bad DeviceURI line
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: system-config-printer (Show other bugs)
6
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks: FC6Update
  Show dependency treegraph
 
Reported: 2006-11-05 22:55 EST by Alvaro Prieto
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 0.7.35-1.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-09 12:17:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alvaro Prieto 2006-11-05 22:55:00 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.7) Gecko/20061027 Fedora/1.5.0.7-8.fc6 Firefox/1.5.0.7

Description of problem:
By mistake, I tried adding printer in (ppd?) without it actually being installed. The program crashed halfway through and wouldn't start again.
I ran in console and it came out with these errors:

/usr/share/system-config-printer/system-config-printer.py:130: GtkWarning: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1 caractère 34 : L'élément « p » a été fermé, mais l'élément actuellement ouvert est « b »
  self.xml = gtk.glade.XML(glade_file, domain = domain)

(system-config-printer.py:3337): libgnomevfs-WARNING **: Failed to open session DBUS connection: Unable to determine the address of the message bus (try 'man dbus-launch' and 'man dbus-daemon' for help)
Volume monitoring will not work.
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 2459, in ?
    main()
  File "/usr/share/system-config-printer/system-config-printer.py", line 2450, in main
    mainwindow = GUI()
  File "/usr/share/system-config-printer/system-config-printer.py", line 310, in __init__
    self.populateList()
  File "/usr/share/system-config-printer/system-config-printer.py", line 389, in populateList
    self.printers = cupshelpers.getPrinters(self.cups)
  File "/usr/share/system-config-printer/cupshelpers.py", line 213, in getPrinters
    printers_conf = PrintersConf(connection)
  File "/usr/share/system-config-printer/cupshelpers.py", line 293, in __init__
    self.parse(self.fetch('/admin/conf/printers.conf'), 'Printer')
  File "/usr/share/system-config-printer/cupshelpers.py", line 321, in parse
    self.device_uris[current_printer] = words[1]
IndexError: list index out of range

Version-Release number of selected component (if applicable):
system-config-printer 0.7.32

How reproducible:
Always


Steps to Reproduce:
1. Run system-config-network (click on new printer)
2. press forward and select "Other"
3. without entering device URI, press forward
4. Select HP printer from database
5. Select OfficeJet 5600, press Forward
6. Press apply

Actual Results:
(system-config-printer.py:3930): libgnomevfs-WARNING **: Failed to open session DBUS connection: Unable to determine the address of the message bus (try 'man dbus-launch' and 'man dbus-daemon' for help)
Volume monitoring will not work.
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 2459, in ?
    main()
  File "/usr/share/system-config-printer/system-config-printer.py", line 2450, in main
    mainwindow = GUI()
  File "/usr/share/system-config-printer/system-config-printer.py", line 310, in __init__
    self.populateList()
  File "/usr/share/system-config-printer/system-config-printer.py", line 389, in populateList
    self.printers = cupshelpers.getPrinters(self.cups)
  File "/usr/share/system-config-printer/cupshelpers.py", line 213, in getPrinters
    printers_conf = PrintersConf(connection)
  File "/usr/share/system-config-printer/cupshelpers.py", line 293, in __init__
    self.parse(self.fetch('/admin/conf/printers.conf'), 'Printer')
  File "/usr/share/system-config-printer/cupshelpers.py", line 321, in parse
    self.device_uris[current_printer] = words[1]
IndexError: list index out of range


Expected Results:


Additional info:
The main problem is that you can't edit any printers after.
Here's how to fix it:

Go to /etc/cups/ppd/
Delete the printer.ppd file (printer being the name you gave to the printer)

Got to /etc/cups/printers.conf
Delete the <printer> </printer> you added and everything inside. (or just delete the whole file.)
Comment 1 Tim Waugh 2006-11-06 04:56:32 EST
Thanks for the report!

Fixed in CVS.  The actual problem was that you hadn't added a device URI for the
printer -- it was just blank.  I've fixed the printers.conf parser to handle
that gracefully.
Comment 2 Tim Waugh 2006-11-07 09:09:57 EST
Please try this test update when it gets pushed to the mirrors:

https://www.redhat.com/archives/fedora-test-list/2006-November/msg00134.html

You will be able to update to this package using:

  yum --enablerepo=updates-testing update 'system-config-printer*'
Comment 3 Fedora Update System 2006-11-09 12:03:46 EST
Fixed in update: system-config-printer-0.7.35-1.fc6

Note You need to log in before you can comment on or make changes to this bug.