Network printing fails after OS update

Post Reply
stefanroellin
Posts: 5
Joined: Sat Dec 12, 2015 8:09 pm

Network printing fails after OS update

Post by stefanroellin » Sat Dec 12, 2015 8:44 pm

I have two printers connected to a Raspberry Pi on which TurboPrint (2.37-1) is running. The Raspberry Pi acts as a print server for a laptop on which TurboPrint with the same version is running.

On the laptop, I have a setup TurboPrint such that a print job is processed locally and then sent to the Raspberry Pi via IPP, and there sent to the attached printers.

Until recently, the setup worked as desired. After the upgrade of the OS on the laptop to Ubuntu 15.10, the printing does not work anymore.

I still can print a PDF on the Raspberry Pi. However, if I print the same document from the laptop, it fails to print. I see that the document is first processed on the laptop and then sent to the Raspberry Pi. I observe that the Raspberry Pi is busy for a short amount of time.

An indeed, there is an error, as seen in /var/log/turboprint/print.log on the Raspberry Pi:

Code: Select all

#######################################################
NEW PRINT JOB Sam Dez 12 21:02:04 CET 2015 (pstoturboprint 2.23-1)
job-id 266
user stefan
title Testseite.pdf
copies 1
options ColorModel=Gray columns=1 cpi=10 document-name-supplied=Testseite.pdf Duplex=None finishings=3 InkType=EconomodeOff_0 InputSlot=Automatic job-uuid=urn:uuid:8b61be91-f543-3ef1-49af-26c2b0d1aa76 lpi=6 media=A4 number-up=1 PageSize=A4 Resolution=600x600dpi sides=one-sided zedoAdjustC=0 zedoAdjustK=0 zedoAdjustM=0 zedoAdjustY=0 zedoBorderlessExpand=2 zedoBrightC=0 zedoBrightM=0 zedoBrightness=0 zedoCMYKspace=0 zedoColorspace=5 zedoContrast=0 zedoDithering=OrderedCoarse zedoDuplexAdjust=0 zedoDuplexadvanced=auto zedoGamut=0 zedoGreyToneA=0 zedoGreyToneB=0 zedoInklimitC=0 zedoInklimitK=0 zedoInklimitM=0 zedoInklimitY=0 zedoIntensity=0 zedoIntent=none_0 zedoMirror=0 zedoPreview=1 zedoRefLight=65 zedoShadows=0 zedoTAC=0 zedoUCR=0 zedoUserColor=0 job-originating-host-name=192.168.74.150 time-at-creation=1449950522 time-at-processing=1449950524
file 
ppdfile /etc/cups/ppd/hp-lj-6mp-tp-printi.ppd
queue hp-lj-6mp-tp-printi
process info: uid=7(lp) gid=7(lp) Gruppen=7(lp)
test directory access:
drwxr-xr-x 2 root root 20480 Sep 27 14:27 /usr/share/turboprint/printers
	/usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f7c000)
	libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6e98000)
	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6e1d000)
	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6ce0000)
	/lib/ld-linux-armhf.so.3 (0xb6f94000)
	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6cb3000)
/usr/bin/tpprint -v2 -l/var/log/turboprint/print.log '--username=stefan' '--ppdfile=/etc/cups/ppd/hp-lj-6mp-tp-printi.ppd' --psfeatures  '---ColorModel=Gray' '---columns=1' '---cpi=10' '---document-name-supplied=Testseite.pdf' '---Duplex=None' '---finishings=3' '---InkType=EconomodeOff_0' '---InputSlot=Automatic' '---job-uuid=urn:uuid:8b61be91-f543-3ef1-49af-26c2b0d1aa76' '---lpi=6' '---media=A4' '---number-up=1' '---PageSize=A4' '---Resolution=600x600dpi' '---sides=one-sided' '---zedoAdjustC=0' '---zedoAdjustK=0' '---zedoAdjustM=0' '---zedoAdjustY=0' '---zedoBorderlessExpand=2' '---zedoBrightC=0' '---zedoBrightM=0' '---zedoBrightness=0' '---zedoCMYKspace=0' '---zedoColorspace=5' '---zedoContrast=0' '---zedoDithering=OrderedCoarse' '---zedoDuplexAdjust=0' '---zedoDuplexadvanced=auto' '---zedoGamut=0' '---zedoGreyToneA=0' '---zedoGreyToneB=0' '---zedoInklimitC=0' '---zedoInklimitK=0' '---zedoInklimitM=0' '---zedoInklimitY=0' '---zedoIntensity=0' '---zedoIntent=none_0' '---zedoMirror=0' '---zedoPreview=1' '---zedoRefLight=65' '---zedoShadows=0' '---zedoTAC=0' '---zedoUCR=0' '---zedoUserColor=0' '---job-originating-host-name=192.168.74.150' '---time-at-creation=1449950522' '---time-at-processing=1449950524' /tmp/pstoturboprint6116.chunk /tmp/pstoturboprint6116.var
Searching PPD file and postscript header for options...
page size A4 overwritten by ---media=A4
duplex overwritten by ---Duplex=None
check_flag_file: opening /var/spool/turboprint/stefan/prv/hp-lj-6mp-tp-printi
check_flag_file: opening /var/spool/turboprint/stefan/sml/hp-lj-6mp-tp-printi
----------- Start of var file -----------
PDFFILE=0
GSPPDFOUND=1
GSCOLORMODE=1
GSCOLORBITS=8
GSXDPI=600
GSYDPI=600
GSWIDTH=4960
GSHEIGHT=7015
TPWIDTH=8268
TPHEIGHT=11693
TPXOFFSET=0
TPYOFFSET=0
DUPLEXMEDIA=A4
DUPLEX=0
PREVIEW=0
NOPRINT=0
BORDERLESS=0
PVXDPI=87
PVYDPI=87
PVWIDTH=719
PVHEIGHT=1017
----------- End of var file -----------
tpstdin --parsedsc result=0
GSRESULT= GSVERSION= GSZEDODEVICE=0
GSCOMMANDLINE=gs -sDEVICE=pgmraw -r600x600 -g4960x7015 -dSAFER -dDisableFAPI=true -dNOPAUSE -dBATCH
TPCOMMANDLINE=/usr/bin/tpprint -a0 -e1 -s8268x11693 -p0x0 -v2 -l/var/log/turboprint/print.log  '---ColorModel=Gray' '---columns=1' '---cpi=10' '---document-name-supplied=Testseite.pdf' '---Duplex=None' '---finishings=3' '---InkType=EconomodeOff_0' '---InputSlot=Automatic' '---job-uuid=urn:uuid:8b61be91-f543-3ef1-49af-26c2b0d1aa76' '---lpi=6' '---media=A4' '---number-up=1' '---PageSize=A4' '---Resolution=600x600dpi' '---sides=one-sided' '---zedoAdjustC=0' '---zedoAdjustK=0' '---zedoAdjustM=0' '---zedoAdjustY=0' '---zedoBorderlessExpand=2' '---zedoBrightC=0' '---zedoBrightM=0' '---zedoBrightness=0' '---zedoCMYKspace=0' '---zedoColorspace=5' '---zedoContrast=0' '---zedoDithering=OrderedCoarse' '---zedoDuplexAdjust=0' '---zedoDuplexadvanced=auto' '---zedoGamut=0' '---zedoGreyToneA=0' '---zedoGreyToneB=0' '---zedoInklimitC=0' '---zedoInklimitK=0' '---zedoInklimitM=0' '---zedoInklimitY=0' '---zedoIntensity=0' '---zedoIntent=none_0' '---zedoMirror=0' '---zedoPreview=1' '---zedoRefLight=65' '---zedoShadows=0' '---zedoTAC=0' '---zedoUCR=0' '---zedoUserColor=0' '---job-originating-host-name=192.168.74.150' '---time-at-creation=1449950522' '---time-at-processing=1449950524' '--ppdfile=/etc/cups/ppd/hp-lj-6mp-tp-printi.ppd' --psheader=/tmp/pstoturboprint6116.chunk --jobid=266 '--username=stefan' '--title=Testseite.pdf' 
COMPLETEPIPE=/usr/lib/turboprint/tpstdin --paste /tmp/pstoturboprint6116.chunk | gs -sDEVICE=pgmraw -r600x600 -g4960x7015 -dSAFER -dDisableFAPI=true -dNOPAUSE -dBATCH  -sOutputFile=/tmp/pstoturboprint6116.fifo - >> /var/log/turboprint/print.log
PREVIEWPIPE=
----------- Start of print job -----------
starting child process
tpprint 2.37-1 x32 (08-OCT-2015) - TurboPrint printer driver
Copyright (C)ZEDOnet GmbH, Irsee, Germany. All rights reserved.
12-Dec-2015 21:02
PPD file: /etc/cups/ppd/hp-lj-6mp-tp-printi.ppd
header file: /tmp/pstoturboprint6116.chunk
Could not get a free pipe
Searching PPD file and postscript header for options...
page size A4 overwritten by ---media=A4
duplex overwritten by ---Duplex=None
interpret_ps: no output file specified
::set_info_paths: setting preview file to /var/spool/turboprint/stefan/zmf/266.zmf
GPL Ghostscript 9.06 (2012-08-08)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in E
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_pop   1893   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
pixmap_class::open: end of file reached
print_page: end of input file
Report at end of pdrivecontrol_class::release_printer
Total memory usage=0
child process terminated
------------ End of print job - result = 246 ------------
job cancelling procedure - TPPID=6140 GSPID=6142 PVPID=
------------ END of tpprint filter ------------
If I use "Show Ink Levels" from the toolbox, everything works as expected. Therefore I assume that my setup is fine.

Any help is appreciated.

zedonet
Site Admin
Posts: 1792
Joined: Fri Oct 06, 2006 8:02 am

Re: Network printing fails after OS update

Post by zedonet » Mon Dec 14, 2015 4:28 pm

It looks as if the print job was processed twice - one on the desktop computer and once on the Raspberry Pi. The CUPS printing system on the Pi doesn't recognize that it is a "raw" print job and tries to process it a second time.

This is an older description to fix the problem - I am not sure if the file names are still correct:
On your server (cups 1.3.9), edit the file

/etc/cups/mime.convs

and remove the comment character "#" at the beginning of the line

#application/octet-stream application/vnd.cups-raw 0

so that it looks like

application/octet-stream application/vnd.cups-raw 0

If the line is missing, please add it befor the lines

#
# End ...
#

Also make sure that the file

/etc/cups/mime.types

contains the line

application/octet-stream

Then reboot your server or enter

sudo /sbin/service cups restart
Please let me know if this helps.

stefanroellin
Posts: 5
Joined: Sat Dec 12, 2015 8:09 pm

Re: Network printing fails after OS update

Post by stefanroellin » Wed Dec 16, 2015 9:49 am

Thanks for your answer.

Unfortunately that did not solve the problem. I already had the files

/etc/cups/raw.convs
/etc/cups/raw.types

with the mentioned lines.

Setting the log level in cups to debug, I get in /var/log/cups/error_log:

Code: Select all

D [16/Dec/2015:10:21:47 +0100] [Job 283] 1 filters for job:
D [16/Dec/2015:10:21:47 +0100] [Job 283] pstoturboprint (application/vnd.cups-pdf to printer/hp-lj-6mp-tp-printi, cost 10)
D [16/Dec/2015:10:21:47 +0100] [Job 283] job-sheets=none,none
D [16/Dec/2015:10:21:47 +0100] [Job 283] argv[0]="hp-lj-6mp-tp-printi"
D [16/Dec/2015:10:21:47 +0100] [Job 283] argv[1]="283"
D [16/Dec/2015:10:21:47 +0100] [Job 283] argv[2]="stefan"
D [16/Dec/2015:10:21:47 +0100] [Job 283] argv[3]="Testseite.pdf"
D [16/Dec/2015:10:21:47 +0100] [Job 283] argv[4]="1"
Somehow the cups printing system does not detect the raw file correctly.

However, if I examine the spooled file, I get:

Code: Select all

mv d00283-001 d00283-001.gz
gunzip  d00283-001.gz
file d00283-001 
   d00283-001: HP PCL printer data
mimetype d00283-001 
   d00283-001: application/octet-stream
Any other ideas are appreciated.

stefanroellin
Posts: 5
Joined: Sat Dec 12, 2015 8:09 pm

Re: Network printing fails after OS update

Post by stefanroellin » Wed Dec 16, 2015 9:14 pm

Some further information:

I thought the problem is that the cups versions on the two computers are different. However, I have tested the same setup as above, but on two computers both running Ubuntu 15.10 and cups 2.1.0. Unfortunately the same error occurs, if I start a print job on the "remote" computer.

This is very unfortunate, since it is not possible to use the TurboPrint plug-in for GIMP on the "remote" computer.

zedonet
Site Admin
Posts: 1792
Joined: Fri Oct 06, 2006 8:02 am

Re: Network printing fails after OS update

Post by zedonet » Fri Dec 18, 2015 11:39 am

Hello,

the Raspberry Pi interprets the print Data as HP PCL - I don't know if this is a problem. Can you post the raw.convs and raw.types and - if existent - the mime.convs and mime.types files?

stefanroellin
Posts: 5
Joined: Sat Dec 12, 2015 8:09 pm

Re: Network printing fails after OS update

Post by stefanroellin » Fri Dec 18, 2015 7:23 pm

Since the connected printer is a HP Laserjet 6, I assume it is correct that the data received by the Raspberry Pi is HP PCL.

Interestingly, if I print the spooled file d00283-001 (taken from /var/spool/cups), i.e.

Code: Select all

lp d00283-001
from either the Raspberry Pi or the other computer, the file is printed fine. Therefore I assume the settings for "raw" files must be correct. It seems that the wrong mime type is used by CUPS, if the "original processed file" is received by the Raspberry Pi.

The files raw.convs and raw.types are:

Code: Select all

/etc/cups$ cat raw.convs
# This file was generated by the cups package.  You may change it, or
# reconfigure this file with dpkg-reconfigure.  If it is removed, it
# will be regenerated by the package scripts.

application/octet-stream	application/vnd.cups-raw	0	-

/etc/cups$ cat raw.types
# This file was generated by the cups package.  You may change it, or
# reconfigure this file with dpkg-reconfigure.  If it is removed, it
# will be regenerated by the package scripts.

application/octet-stream
I have also copied these files to mime.convs and mime.types in the same directory, but nothing changed (even after a restart of CUPS).

stefanroellin
Posts: 5
Joined: Sat Dec 12, 2015 8:09 pm

Re: Network printing fails after OS update

Post by stefanroellin » Sat Dec 19, 2015 2:52 pm

It turned out that this is a CUPS problem. In error_log I see FINAL_CONTENT_TYPE=application/vnd.cups-pdf, but the data sent to the Raspberry Pi is certainly not PDF, but HP PCL.

I have recompiled CUPS (cups-daemon) with the following patch applied and now everything works as before.

Code: Select all

Description: Reverted upstream change to FINAL_CONTENT_TYPE in order to fix printing to remote CUPS servers 
Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1010580
Last-Updated: 2013-11-28
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -599,12 +599,7 @@
 
     if (!job->printer->remote)
     {
-      for (filter = (mime_filter_t *)cupsArrayLast(filters);
-           filter && filter->dst;
-           filter = (mime_filter_t *)cupsArrayPrev(filters))
-        if (strcmp(filter->dst->super, "printer") ||
-            strcmp(filter->dst->type, job->printer->name))
-          break;
+      filter = (mime_filter_t *)cupsArrayLast(filters);
 
       if (filter && filter->dst)
       {
As I understand, my setup is not recommended. I should setup raw queues on the Raspberry Pi. Unfortunately, if I do so then I have the following drawbacks:
  • The printers do not show in TurboPrint Control. So e.g. the Toolbox is not usable (Ink level,...).
  • I can't use the TurboPrint plugin. I get the message: No CUPS printers found. Please configure at least one printer with the TurboPrint setup tool and/or start the CUPS printing system.
Is there a solution to this?

zedonet
Site Admin
Posts: 1792
Joined: Fri Oct 06, 2006 8:02 am

Re: Network printing fails after OS update

Post by zedonet » Tue Dec 22, 2015 3:58 pm

Thank you for the information and it is good to hear that it is working again.

I had no idea that your setup is "not recommended" and I have no solution for raw queues yet :-(

Post Reply