LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   error in foomatic-rip-hplip (14.2 cups-filters package) (https://www.linuxquestions.org/questions/slackware-14/error-in-foomatic-rip-hplip-14-2-cups-filters-package-4175584890/)

metageek 07-17-2016 12:04 PM

error in foomatic-rip-hplip (14.2 cups-filters package)
 
After upgrading to 14.2 I fail to print. Jobs get queued but always fail with message "Filter failed". After changing cups logging to debug I find that everytime a job is sent to cups the filter /usr/lib64/cups/filter/foomatic-rip-hplip fails with this message:
Code:

Can\'t use \'defined(@array)\' (Maybe you should just omit the defined()?) at /usr/lib64/cups/filter/foomatic-rip-hplip line 1656.
I even reinstalled cups-filters-1.9.0-x86_64-2.txz just in case something had gone wrong in the upgrade, but the problem continues.

Any ideas? (I'm tempted to delve into foomatic-rip-hplip line 1656 to see the code that is failing...)

gmgf 07-17-2016 01:43 PM

have you removed old 'foomatic-filters' package

ap/foomatic-filters-4.0.17-x86_64-1.txz: Removed.
The cups-filters package contains these programs.

metageek 07-17-2016 02:41 PM

I can't find any foomatic-filters package installed and there is an entry for foomatic-filters-4.0.12-x86_64-1 in /var/log/packages-removed. So, yes I have removed ap/foomatic-filters.

gmgf 07-17-2016 08:11 PM

foomatic-rip-hplip is part of 'hplip' package try remove your printer and reconfigure.

the3dfxdude 07-18-2016 10:04 AM

I've been seeing some weird behavior on upgrade, and so I cleared out my cups config completely and re-setup. I am still having a filter failure on my hp printer. I might be able to print locally though, but I might be out of ink at the same time. Anyway I will continue to try to look at this some after I get some ink.

I am not convinced this foomatic script is the culprit, as I never captured this error in the log. But anyway, looked at it and it was as expected. It's a construct that it now errors on strict in the latest Perl. I definitely would never use that idiom on checking for an empty array, so here is my fix:
Code:

--- /usr/lib64/cups/filter/foomatic-rip-hplip.bk        2016-07-18 07:56:11.531681146 -0700
+++ /usr/lib64/cups/filter/foomatic-rip-hplip        2016-07-18 07:43:55.106085240 -0700
@@ -1653,8 +1653,8 @@
 ## if nexessary.
 
 my $dontparse = 0;
-if ((!defined(@{$dat->{'args'}})) ||
-    ($#{$dat->{'args'}} < 0)) {
+if ((!defined($dat->{'args'})) ||
+    (!@{$dat->{'args'}})) {
    # We don't have any options, so we do not need to parse the
    # PostScript data
    $dontparse = 1;

Doesn't help me at all though as expected.

BTW this is my error, and I've found nothing on it so far:

Code:

D [18/Jul/2016:07:44:11 -0700] [Job 11] Sending data to printer.
D [18/Jul/2016:07:44:11 -0700] [Job 11] Set job-printer-state-message to "Sending data to printer.", current level=INFO
D [18/Jul/2016:07:44:11 -0700] [Job 11] prnt/hpcups/HPCupsFilter.cpp 565: cupsRasterOpen failed, fd = 0
D [18/Jul/2016:07:44:11 -0700] [Job 11] Sent 0 bytes...
D [18/Jul/2016:07:44:11 -0700] [Job 11] PID 18099 (/usr/lib64/cups/filter/gziptoany) did not catch or ignore signal 13.
D [18/Jul/2016:07:44:11 -0700] [Job 11] Waiting for read thread to exit...
D [18/Jul/2016:07:44:11 -0700] [Job 11] PID 18100 (/usr/lib64/cups/filter/hpcups) stopped with status 1.


metageek 07-18-2016 07:17 PM

@the3dfxdude your patch fixed the error with the foomatic-rip-hplip filter, but I am still unable to print. (Originally I though this was working as I heard a page printing and prematurely marked this thread as solved, but other problems came up...)

After applying the patch and requeing a previous job I got a page out that said "If you can read this, you are using the wrong driver for your printer." I then decided to remove the printer and add it from scratch (using the USB cable). After adding the printer (setup went apparently without problems) I printed the test page and all I got out was a page with the PDF header:
Code:

%PDF-1.3
%?

Now when I try to print everything looks ok on the computer but nothing comes out of the printer. Cups error log has nothing (and I have it set to "debug"), cups page log has nothing, but cups access log says
Code:

localhost - - [18/Jul/2016:20:37:57 -0400] "POST /printers/Officejet_6500 HTTP/1.1" 200 31819 Print-Job successful-ok

the3dfxdude 07-18-2016 10:11 PM

I got my ink (those things dry up fast), and yes, I am able to print locally. Are you starting your print job locally?

My filter error I mentioned above occurs when sending a print job across the network using ipp. It used to work before with Slackware 14.1. Even with both updated and then setup cleared and re-setup again, I get this issue. I went as far as intercepting the cups raster sent to hpcups, and found the locally submitted print job is correctly formatted cups raster, and the network submitted version is garbage (I figured out the actual cups error by changing C code to report the error instead of a silly thing that is irrelevant). Anyhow, if this is not related, I'll deal with this on my own time.

How did you set up your driver? Something still seems broken in your print filters.

kjhambrick 07-19-2016 05:14 AM

Quote:

Originally Posted by the3dfxdude (Post 5578068)
I got my ink (those things dry up fast), and yes, I am able to print locally. Are you starting your print job locally?

My filter error I mentioned above occurs when sending a print job across the network using ipp. It used to work before with Slackware 14.1. Even with both updated and then setup cleared and re-setup again, I get this issue. I went as far as intercepting the cups raster sent to hpcups, and found the locally submitted print job is correctly formatted cups raster, and the network submitted version is garbage (I figured out the actual cups error by changing C code to report the error instead of a silly thing that is irrelevant). Anyhow, if this is not related, I'll deal with this on my own time.

How did you set up your driver? Something still seems broken in your print filters.


the3dfxdude --

Sounds like two different problems in this thread ...

The solution in this link ( and I believe there have been a couple other 'recent' threads ) may help your network printing via ipp:

http://www.linuxquestions.org/questi...-a-4175582086/

Cups v2.1.4 ( Slackware 14.2 ) clients cannot print to cups <= v1.5 servers via ipp without some additional configs.

-- kjh

the3dfxdude 07-19-2016 09:45 AM

Quote:

Originally Posted by kjhambrick (Post 5578166)

Cups v2.1.4 ( Slackware 14.2 ) clients cannot print to cups <= v1.5 servers via ipp without some additional configs.

-- kjh

That is NOT what I am doing:

Quote:

Even with both updated and then setup cleared and re-setup again, I get this issue.
Both machines are on Slackware 14.2 with cups 2.1.4.

metageek 07-19-2016 08:28 PM

Same thing here, I'm only printing from one machine on Slackware 14.2 with CUPS 2.1.4. My printer is on wifi and was setup new using the USB cable with HPLIP. Now it doesn't print and I get no error message.

metageek 07-19-2016 08:33 PM

Quote:

Originally Posted by the3dfxdude (Post 5578068)
How did you set up your driver? Something still seems broken in your print filters.

As I mentioned earlier, this was setup through HPLIP with the cable, then using as wifi. It is a HP OfficeJet 6500 and is using the URL hp:/net/Officejet_6500_E710n-z?ip=10.10.10.3


All times are GMT -5. The time now is 07:00 AM.