Bug 82385 - Setting up a postscript printer produces broken postscript print jobs
Summary: Setting up a postscript printer produces broken postscript print jobs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: foomatic
Version: phoebe
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 79579
TreeView+ depends on / blocked
 
Reported: 2003-01-21 20:12 UTC by Bernd Bartmann
Modified: 2007-04-18 16:50 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-29 09:13:40 UTC
Embargoed:


Attachments (Terms of Use)
/tmp/cupsomatic.log after printing CUPS test page to a PostScript printer (2.13 KB, text/plain)
2003-01-22 17:48 UTC, Bernd Bartmann
no flags Details
/tmp/prnjob after printing CUPS test page to a PostScript printer (17.24 KB, text/plain)
2003-01-22 17:49 UTC, Bernd Bartmann
no flags Details
/var/log/cups/access_log with LogLevel debug2 (2.90 KB, text/plain)
2003-01-22 18:32 UTC, Bernd Bartmann
no flags Details
/var/log/cups/error_log with LogLevel debug2 (144.02 KB, text/plain)
2003-01-22 18:32 UTC, Bernd Bartmann
no flags Details
CUPS testprint.ps printed using your jdprint (14.21 KB, text/plain)
2003-01-23 17:37 UTC, Bernd Bartmann
no flags Details
redhat-config-printer CUPS test page (17.31 KB, text/plain)
2003-01-23 17:38 UTC, Bernd Bartmann
no flags Details

Description Bernd Bartmann 2003-01-21 20:12:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
I've setup a postscript printer under Phoebe2. The printer is a HP LaserJet 5M
with a JetDirect network card. Whenever a test page is send to printer the
printer gets some data (as indicated by the LCD display) but prints nothing. So
I suspect that the postscript print job is somehow broken.
Setting up the printer as a LaserJet 5 using the Omni driver works without a
problem.

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


How reproducible:
Always

Steps to Reproduce:
1. Try to setup a real Postscript printer
2. print one of the test pages
3. 
    

Additional info:

Comment 1 Tim Waugh 2003-01-22 11:59:15 UTC
Please try creating a file called 'jdprint' like this:

#!/bin/bash
(cat >&3; cat <&3) 3<>/dev/tcp/printer_ip/9100

(with your printer's IP address in place of 'printer_ip').

Then do:

chmod a+x jdprint
./jdprint </usr/share/cups/data/testprint.ps

Does it show the errors from the printer?

Comment 2 Bernd Bartmann 2003-01-22 16:42:03 UTC
Using your script the page is printed correctly. This is the output:

[root@deanna root]# ./jdprint < /usr/share/cups/data/testprint.ps
%%[ Error: timeout; OffendingCommand: timeout ]%%

The error message appears after the page was printed, but the script never seems
to end.

Comment 3 Tim Waugh 2003-01-22 17:05:18 UTC
Are you using LPRng or cups?

Comment 4 Bernd Bartmann 2003-01-22 17:12:49 UTC
Default from Phoebe2 so it must be CUPS. I just setup my HP LJ5M using the
printer config tool.

Comment 5 Tim Waugh 2003-01-22 17:29:12 UTC
Okay, perhaps it's some modification to the PS by the cupsomatic filter that's
upsetting it.  Please edit /usr/lib/cups/filter/cupsomatic and change the line:

my $debug = 0;

to:

my $debug = 1;

Then try printing a test page from the printer config tool, and when the printer
stops flashing its light take a look for /tmp/prnjob.  Try running that through
the jdprint script from earlier, and see if that works.

Comment 6 Bernd Bartmann 2003-01-22 17:47:51 UTC
Using the steps you described above prints the CUPS test page correctly. I'll
attach /tmp/cupsomatic.log and /tmp/prnjob for your inspection.

Comment 7 Bernd Bartmann 2003-01-22 17:48:51 UTC
Created attachment 89528 [details]
/tmp/cupsomatic.log after printing CUPS test page to a PostScript printer

Comment 8 Bernd Bartmann 2003-01-22 17:49:30 UTC
Created attachment 89529 [details]
/tmp/prnjob after printing CUPS test page to a PostScript printer

Comment 9 Tim Waugh 2003-01-22 17:58:35 UTC
So it printed from the jdprint script, but not normally?  How odd.

What does the DeviceURI line in /etc/cups/printers.conf look like for that printer?

Comment 10 Bernd Bartmann 2003-01-22 18:08:26 UTC
Yes it printed from jdprint but not from redhat-config-printer. In
/etc/cups/printers.conf I find:

<DefaultPrinter lp>
Info Created by redhat-config-printer 0.6.x
DeviceURI socket://192.168.25.251:9100
Location
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>


Comment 11 Tim Waugh 2003-01-22 18:19:05 UTC
Stranger and stranger.

So I guess it's the CUPS socket backend that's having trouble.  Please edit
/etc/cups/cupsd.conf and change the LogLevel line to:

LogLevel debug2

Then do 'service cups restart', and try to print the test page again (just from
redhat-config-printer this time, not jdprint).

Hopefully there'll be some revealing messages in /var/log/cups/*.

Comment 12 Bernd Bartmann 2003-01-22 18:31:20 UTC
All steps done. Besides this I removed all old files from /var/log/cups before
"service cups start". I'll attach access_log and error_log.

Comment 13 Bernd Bartmann 2003-01-22 18:32:09 UTC
Created attachment 89530 [details]
/var/log/cups/access_log with LogLevel debug2

Comment 14 Bernd Bartmann 2003-01-22 18:32:48 UTC
Created attachment 89531 [details]
/var/log/cups/error_log with LogLevel debug2

Comment 15 Tim Waugh 2003-01-23 10:41:46 UTC
Everything seems normal.  Let's see if we can actually isolate the problem to
the socket backend.  Do this:

cd /tmp
mkdir socket:
ln -s /usr/lib/cups/backend/socket socket://192.168.25.251:9100
socket://192.168.25.251:9100 1 user title 1 '' /usr/share/cups/data/testprint.ps

Does that print?  Also try the /tmp/prnlog you had from before instead of
testprint.ps.

Comment 16 Bernd Bartmann 2003-01-23 17:01:33 UTC
In both variants the page comes out correctly.

[root@deanna tmp]# socket://192.168.25.251:9100 1 user title 1 ''
/usr/share/cups/data/testprint.ps
INFO: Attempting to connect to host 192.168.25.251 on port 9100
PAGE: 1 1
INFO: Connected to host, sending print job...
INFO: Sending print file, 8192 bytes...
INFO: Sending print file, 14547 bytes...
INFO: Print file sent, waiting for printer to finish...
INFO: Ready to print.


[root@deanna tmp]# socket://192.168.25.251:9100 1 user title 1 '' /root/dummy/prnjob
INFO: Attempting to connect to host 192.168.25.251 on port 9100
PAGE: 1 1
INFO: Connected to host, sending print job...
INFO: Sending print file, 8192 bytes...
INFO: Sending print file, 16384 bytes...
INFO: Sending print file, 17655 bytes...
INFO: Print file sent, waiting for printer to finish...
INFO: Ready to print.


Comment 17 Tim Waugh 2003-01-23 17:19:52 UTC
Absolutely mystified. :-(

Comment 18 Bernd Bartmann 2003-01-23 17:36:45 UTC
Ok, then now on to some lower level tools. I just sniffed the packets send to
the JetDirect card using ethereal and used "Follow TCP stream" to extract the
relevant content. Please have a look at the new attachments to this bug.

Comment 19 Bernd Bartmann 2003-01-23 17:37:49 UTC
Created attachment 89549 [details]
CUPS testprint.ps printed using your jdprint

Comment 20 Bernd Bartmann 2003-01-23 17:38:24 UTC
Created attachment 89550 [details]
redhat-config-printer CUPS test page

Comment 21 Tim Waugh 2003-01-23 17:41:31 UTC
I suspect that if you try printing prnlog using one of the methods we've found
to work, you'll see exactly the same as when you use redhat-config-printer (and
it doesn't work).  Could you verify that?

Comment 22 Bernd Bartmann 2003-01-23 18:19:44 UTC
Packet sniffing when printing prnlog using your socket method gives me exactly
the same result as when using jdprint.

Comment 23 Bernd Bartmann 2003-01-23 18:26:23 UTC
When activating PS-ERROR-PRINT in my printers menu panel I get this output when
printing the test page from redhat-config-printer:

ERROR: configurationerror
OFFENDING COMMAND: setpagedevice

STACK:


Comment 24 Tim Waugh 2003-01-23 18:27:06 UTC
Not jdprint, redhat-config-printer.  What I'm getting at is: try a method that
works compared to a method that doesn't.

It's the method, not the PostScript, I'm pretty sure.  Please confirm.

Comment 25 Tim Waugh 2003-01-23 18:31:35 UTC
Oh, hold on, it looks like prnjob *isn't* what's getting sent to the printer at
all.  Stupid cupsomatic.  Okay, now there's something to go on.  Presumably it's
one of these lines:

<</HWResolution[600 600]>>setpagedevice
<</Duplex false>>setpagedevice

Can you try taking those out from 'redhat-config-printer CUPS test page'
(attachment) one by one and printing with jdprint?  Is it both of them, or one
particular one, that is the problem?

Comment 26 Bernd Bartmann 2003-01-23 18:41:33 UTC
Taking out the first line still gives no printout, but instead:

[root@deanna dummy]# ./jdprint < test.ps
%%[ Error: configurationerror; OffendingCommand: setpagedevice; ErrorInfo:
Duplex false ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%


!!! Taking out out the second line gives me no error and a correct test page !!!
Removing both lines works also :-)

Comment 27 Tim Waugh 2003-01-23 18:43:45 UTC
So taking out the duplex line, but leaving in the resolution line, works?

Is the 5M duplex-capable?  What are the duplex options for this printer?

Do you happen to have the manufacturer's PPD file for it?

Comment 28 Bernd Bartmann 2003-01-23 18:59:14 UTC
Yes, onyl removing the duplex line works. The 5M is not duplex capable in its
normal form, but there is an additional duplex kit available. I just downloaded
the PPD file from http://www.linuxprinting.org/show_driver.cgi?driver=Postscript
HP recommends the generic postscript driver for it:
http://www.linuxprinting.org/show_printer.cgi?recnum=91232

In redhat-config-printer I've tried to setup a generic postscript printer and a
HP LJ 5M using postscript. Both gave me the broken result.

Comment 29 Tim Waugh 2003-01-23 22:06:53 UTC
Yes, both options go through the foomatic 'Postscript' driver.

Please try upgrading foomatic to the package here:

ftp://people.redhat.com/twaugh/tmp/foomatic-2.0.2-12.1.i386.rpm

Re-create the queue in redhat-config-printer, and see if it's any better.  I've
added a new option to 'Duplex printing', which is 'Not capable'.  The idea is to
just not even put that line in by default. (You can of course change it on the
'driver options' screen.)

Comment 30 Bernd Bartmann 2003-01-23 22:25:59 UTC
Good work Tim. "Not capable" works fine for me.

Comment 31 Tim Waugh 2003-01-23 22:43:54 UTC
Great.  Please verify foomatic-2.0.2-13 fixes it, when it appears in rawhide
(next few days).

Comment 32 Bernd Bartmann 2003-01-28 22:43:22 UTC
Fix confirmed for foomatic-2.0.2-13. Thanks Tim.


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