Bug 82385 - Setting up a postscript printer produces broken postscript print jobs
Setting up a postscript printer produces broken postscript print jobs
Status: CLOSED RAWHIDE
Product: Red Hat Public Beta
Classification: Retired
Component: foomatic (Show other bugs)
phoebe
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
David Lawrence
:
Depends On:
Blocks: 79579
  Show dependency treegraph
 
Reported: 2003-01-21 15:12 EST by Bernd Bartmann
Modified: 2007-04-18 12:50 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-29 04:13:40 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)
/tmp/cupsomatic.log after printing CUPS test page to a PostScript printer (2.13 KB, text/plain)
2003-01-22 12:48 EST, Bernd Bartmann
no flags Details
/tmp/prnjob after printing CUPS test page to a PostScript printer (17.24 KB, text/plain)
2003-01-22 12:49 EST, Bernd Bartmann
no flags Details
/var/log/cups/access_log with LogLevel debug2 (2.90 KB, text/plain)
2003-01-22 13:32 EST, Bernd Bartmann
no flags Details
/var/log/cups/error_log with LogLevel debug2 (144.02 KB, text/plain)
2003-01-22 13:32 EST, Bernd Bartmann
no flags Details
CUPS testprint.ps printed using your jdprint (14.21 KB, text/plain)
2003-01-23 12:37 EST, Bernd Bartmann
no flags Details
redhat-config-printer CUPS test page (17.31 KB, text/plain)
2003-01-23 12:38 EST, Bernd Bartmann
no flags Details

  None (edit)
Description Bernd Bartmann 2003-01-21 15:12:54 EST
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 06:59:15 EST
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 11:42:03 EST
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 12:05:18 EST
Are you using LPRng or cups?
Comment 4 Bernd Bartmann 2003-01-22 12:12:49 EST
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 12:29:12 EST
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 12:47:51 EST
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 12:48:51 EST
Created attachment 89528 [details]
/tmp/cupsomatic.log after printing CUPS test page to a PostScript printer
Comment 8 Bernd Bartmann 2003-01-22 12:49:30 EST
Created attachment 89529 [details]
/tmp/prnjob after printing CUPS test page to a PostScript printer
Comment 9 Tim Waugh 2003-01-22 12:58:35 EST
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 13:08:26 EST
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 13:19:05 EST
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 13:31:20 EST
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 13:32:09 EST
Created attachment 89530 [details]
/var/log/cups/access_log with LogLevel debug2
Comment 14 Bernd Bartmann 2003-01-22 13:32:48 EST
Created attachment 89531 [details]
/var/log/cups/error_log with LogLevel debug2
Comment 15 Tim Waugh 2003-01-23 05:41:46 EST
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 12:01:33 EST
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 12:19:52 EST
Absolutely mystified. :-(
Comment 18 Bernd Bartmann 2003-01-23 12:36:45 EST
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 12:37:49 EST
Created attachment 89549 [details]
CUPS testprint.ps printed using your jdprint
Comment 20 Bernd Bartmann 2003-01-23 12:38:24 EST
Created attachment 89550 [details]
redhat-config-printer CUPS test page
Comment 21 Tim Waugh 2003-01-23 12:41:31 EST
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 13:19:44 EST
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 13:26:23 EST
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 13:27:06 EST
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 13:31:35 EST
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 13:41:33 EST
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 13:43:45 EST
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 13:59:14 EST
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 17:06:53 EST
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 17:25:59 EST
Good work Tim. "Not capable" works fine for me.
Comment 31 Tim Waugh 2003-01-23 17:43:54 EST
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 17:43:22 EST
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.