Bug 220136 - irrelevant and incorrect error when using own PPD file
Summary: irrelevant and incorrect error when using own PPD file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-printer
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL: http://www.symons.net.au/system-confi...
Whiteboard:
Depends On:
Blocks: FC6Update
TreeView+ depends on / blocked
 
Reported: 2006-12-19 03:06 UTC by Anthony Symons
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 0.7.45-1.fc6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-05 23:57:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Anthony Symons 2006-12-19 03:06:15 UTC
Description of problem:

When adding a local printer on lpt port, and opting to provide own ppd file
system-config-printer throws an irrelevant and incorrect error.

Version-Release number of selected component (if applicable):

system-config-printer 0.7.40 (current fc6?)

How reproducible:

Every time

Steps to Reproduce:
1. run system-config-printer via system/administration/printing (enter root passwd)
2. pick new printer
3. pick forward
4. pick lpt port
5. pick provide PPD file and navigate to ppd and select it
6. hit forward
7. hit apply
8. observe strange "database error" error message

Actual results:

database error about generic driver (not relevant to ppd)

Expected results:

accepted ppd and working printer :)

Additional info:

See http://www.symons.net.au/system-config-printer/
for screen shots, as well as this ppd file for brother hl-2040 printer (which is
not otherwise listed, although it seems to work when configured as a brother
2400CeN Foomatic/hl1250)

Comment 1 Tim Waugh 2006-12-21 17:29:59 UTC
Thanks for the detailed bug report.  There are several things going on here:

1. The error message should say 'There is a problem with the PPD file', and show
the output of 'cupstestppd' on the PPD file, because that's what has triggered
this error.

2. The libcups routine for parsing PPD files should perhaps be more lenient in
what it accepts.

3. The PPD file in question has lots of things wrong with it!

Comment 2 Tim Waugh 2006-12-22 09:20:30 UTC
Please try 0.7.43-1.fc6 from updates-testing:

yum --enablerepo=updates-testing update 'system-config-printer*'

You should get a better error message.

Comment 3 Anthony Symons 2006-12-28 03:54:48 UTC
Ok. I tried something slightly different first since its christmas holidays and
Im at home while this printer is on my workstation at work.

This is what I did:

1. run system-config-printer, couldnt do anything. Start cups service and set it
to auto run on reboot, ran system-config-printer again
2. hit "new printer"
3. hit forward
4. pick ipp protocol ip=10.0.3.3 (workstation at work, via vpn sharing this
printer with ipp and samba) printername=printer then forward
5. pick provide ppd, pick this same ppd file
6. "going to create new printer printer at ipp://10.0.3.3/printers/printeer"
click apply
7. nothing happens?
8. error observed in terminal where system-config-printer was run:
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 2490,
in on_btnNPApply_clicked
    ppd = get_PPD_but_handle_errors ()
  File "/usr/share/system-config-printer/system-config-printer.py", line 2460,
in get_PPD_but_handle_errors
    err = _('Failed to read PPD file.  Possible reason '
TypeError: not all arguments converted during string formatting

9. retest configuring on lpt1:, same lack of error in gui, and same trace info
in terminal.




Comment 4 Anthony Symons 2007-01-03 08:39:15 UTC
Back at work, tried this again on FC6 workstaion here. Got this PPD error:

PPD error

Failed to read PPD file.  Possible reason follows:
/home/ant/BH2040.PPD: FAIL
      **FAIL**  Unable to open PPD file - Missing PPD-Adobe-4.x header on line 1.
                REF: Page 42, section 5.2.
        WARN    File contains a mix of CR, LF, and CR LF line endings!
        WARN    Non-Windows PPD files should use lines ending with only LF, not
CR LF!

Looks like a more appropriate error than originally found. 

I added a header to line 1:

*PPD-Adobe: "4.3"

Then removed the lines that had been commented out with % (should it just skip
these?)

Then loaded the PPD. It was accepted and the printer is listed.
Then when I click on the printer name of this printer, system-config-printer
crashes out with a segfault!

[root@ant ~]# system-config-printer 
Segmentation fault
[root@ant ~]# 

Should I file this under a seperate bug?

Comment 5 Anthony Symons 2007-01-03 08:49:07 UTC
The PPD ive patched, which is accepted, but which causes system-config-printer
to segfault can be downloaded here:

http://www.symons.net.au/system-config-printer/patchedppd/BH2040.PPD

Other possibly relevant info that may help with reproducability is that I have
this printer configured twice, both times on the same port. The first works
fine, the second (named printertest) causes the segfault. This configureation
may be relevant more than the ppd itself. If this bug is not reproducable I can
dig more deeply.

Comment 7 Tim Waugh 2007-01-03 12:51:19 UTC
The segfault was in the pycups library provided by system-config-printer.  I've
fixed this in system-config-printer-0.7.45-1.fc6, which will be available
shortly in updates-testing.  Thanks for reporting it!

Comment 8 Tim Waugh 2007-01-04 16:44:01 UTC
0.7.45-1.fc6 should be available now:

yum --enablerepo=updates-testing update 'system-config-printer*'

Comment 9 Anthony Symons 2007-01-05 01:03:48 UTC
yes, this has fixed the crash! 

However now whenever i click off the printer to another printer, I get asked to
apply the changes (without making any changes). I say apply, then click back on
and off the new printer again, and get asked to apply changes every time...

Comment 10 Tim Waugh 2007-01-05 11:16:40 UTC
This is because it's a bad PPD file.  Try playing around with cupstestppd and
you'll find lots and lots of problems with it.  For example, none of the options
use OpenUI/CloseUI, and so none of them are typed properly.  There are at least
ten missing required attributes.  It uses illegal control characters for more or
less every single option choice string.

I would recommend that you use a better PPD file.  Perhaps the one linked from
this page?: http://openprinting.org/show_printer.cgi?recnum=Brother-HL-2040


Comment 11 Fedora Update System 2007-01-05 18:21:13 UTC
Fixed in update: system-config-printer-0.7.45-1.fc6


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