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:
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?
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.
Are you using LPRng or cups?
Default from Phoebe2 so it must be CUPS. I just setup my HP LJ5M using the printer config tool.
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.
Using the steps you described above prints the CUPS test page correctly. I'll attach /tmp/cupsomatic.log and /tmp/prnjob for your inspection.
Created attachment 89528 [details] /tmp/cupsomatic.log after printing CUPS test page to a PostScript printer
Created attachment 89529 [details] /tmp/prnjob after printing CUPS test page to a PostScript printer
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?
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>
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/*.
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.
Created attachment 89530 [details] /var/log/cups/access_log with LogLevel debug2
Created attachment 89531 [details] /var/log/cups/error_log with LogLevel debug2
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.
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.
Absolutely mystified. :-(
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.
Created attachment 89549 [details] CUPS testprint.ps printed using your jdprint
Created attachment 89550 [details] redhat-config-printer CUPS test page
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?
Packet sniffing when printing prnlog using your socket method gives me exactly the same result as when using jdprint.
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:
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.
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?
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 :-)
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?
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.
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.)
Good work Tim. "Not capable" works fine for me.
Great. Please verify foomatic-2.0.2-13 fixes it, when it appears in rawhide (next few days).
Fix confirmed for foomatic-2.0.2-13. Thanks Tim.