# [SOLVED] Cups + LaserJet 1022: foomatic-rip failed

## atoz

Setting up my HP LaserJet 1022 (USB) with Cups seemed pretty straightforward. This is the cups (and related) that I'm using...

```
[ebuild   R   ] net-print/cups-1.2.9  USE="X jpeg pam png ppds ssl tiff -dbus -ldap -nls -php -samba -slp" 0 kB

[ebuild   R   ] net-print/foomatic-filters-3.0.20060720  USE="cups" 0 kB 

[ebuild   R   ] net-print/foomatic-filters-ppds-20060720  0 kB 

[ebuild   R   ] net-print/foomatic-db-ppds-20060720  0 kB 

```

The printer is certainly there...

```
saturn ~ # lsusb

Bus 003 Device 001: ID 0000:0000  

Bus 002 Device 001: ID 0000:0000  

Bus 001 Device 016: ID 03f0:2c17 Hewlett-Packard 

Bus 001 Device 003: ID 0409:0059 NEC Corp. HighSpeed Hub

Bus 001 Device 002: ID 051d:0002 American Power Conversion Back-UPS Pro 500/1000/1500

Bus 001 Device 001: ID 0000:0000  

Bus 001 Device 005: ID 1241:1603 Belkin 

Bus 001 Device 004: ID 046d:c50e Logitech, Inc. MX-1000 Cordless Mouse Receiver

```

Cups let me set it up and suggested using Foomatic/foo2zjs, and everything seemed fine. Printing a test page, however, fails, and the web interface shows the error message

```
LaserJet1022 "/usr/libexec/cups/filter/foomatic-rip failed"
```

The cups error log shows:

```

I [22/Apr/2007:10:47:31 -0400] Adding start banner page "none" to job 5.

I [22/Apr/2007:10:47:31 -0400] Adding end banner page "none" to job 5.

I [22/Apr/2007:10:47:31 -0400] Job 5 queued on "LaserJet1022" by "root".

I [22/Apr/2007:10:47:31 -0400] Started filter /usr/libexec/cups/filter/pstops (PID 30126) for job 5.

I [22/Apr/2007:10:47:31 -0400] Started filter /usr/libexec/cups/filter/foomatic-rip (PID 30127) for job 5.

I [22/Apr/2007:10:47:31 -0400] Started backend /usr/libexec/cups/backend/usb (PID 30128) for job 5.

E [22/Apr/2007:10:47:32 -0400] PID 30127 (/usr/libexec/cups/filter/foomatic-rip) stopped with status 1!

I [22/Apr/2007:10:47:32 -0400] Hint: Try setting the LogLevel to "debug" to find out more.

I [22/Apr/2007:10:47:33 -0400] commptr=""

I [22/Apr/2007:10:47:33 -0400] Started "/usr/libexec/cups/cgi-bin/printers.cgi" (pid=30150)

```

(which isn't really too helpful, to me at least)

Enabling debugging information in cups generates literally thousands of lines of debugging information per job. Here's the section around the error message:

```

...

D [22/Apr/2007:10:50:12 -0400] [Job 6] 

D [22/Apr/2007:10:50:12 -0400] [Job 6] 

D [22/Apr/2007:10:50:12 -0400] [Job 6] Starting renderer

D [22/Apr/2007:10:50:12 -0400] [Job 6] JCL: <job data> 

D [22/Apr/2007:10:50:12 -0400] [Job 6] 

D [22/Apr/2007:10:50:12 -0400] [Job 6] renderer PID kid4=30634

D [22/Apr/2007:10:50:12 -0400] [Job 6] renderer command: foo2zjs-wrapper   -P -z

1 -L0  -r1200x600 -p1 -s7 -m1   -d1 -n1 

D [22/Apr/2007:10:50:12 -0400] [Job 6] renderer return value: 16777215

D [22/Apr/2007:10:50:12 -0400] [Job 6] renderer received signal: 16777215

D [22/Apr/2007:10:50:12 -0400] [Job 6] Process dying with "The renderer command 

line returned an unrecognized error code 16777215.", exit stat: 1

D [22/Apr/2007:10:50:12 -0400] [Job 6] error: No such file or directory (2)

D [22/Apr/2007:10:50:12 -0400] [Job 6] The renderer command line returned an unr

ecognized error code 16777215.

D [22/Apr/2007:10:50:12 -0400] [Job 6] 

D [22/Apr/2007:10:50:12 -0400] [Job 6] Closing renderer

D [22/Apr/2007:10:50:12 -0400] [Job 6] KID3 exited with status 1

D [22/Apr/2007:10:50:12 -0400] [Job 6] Renderer exit stat: 1

D [22/Apr/2007:10:50:12 -0400] [Job 6] Renderer process finished

D [22/Apr/2007:10:50:12 -0400] [Job 6] Killing process 30633 (KID3)

D [22/Apr/2007:10:50:12 -0400] [Job 6] Process dying with "Error closing rendere

r", exit stat: 1

D [22/Apr/2007:10:50:12 -0400] [Job 6] error: Bad file descriptor (9)

D [22/Apr/2007:10:50:12 -0400] [Job 6] Error closing renderer

E [22/Apr/2007:10:50:12 -0400] PID 30628 (/usr/libexec/cups/filter/foomatic-rip)

 stopped with status 1!

D [22/Apr/2007:10:50:12 -0400] [Job 6] tail process done writing data to STDOUT

D [22/Apr/2007:10:50:12 -0400] [Job 6] KID4 finished

D [22/Apr/2007:10:50:12 -0400] PID 30629 (/usr/libexec/cups/backend/usb) exited 

with no errors.

D [22/Apr/2007:10:50:12 -0400] [Job 6] File 0 is complete.

...

```

The same thing happens when trying to print from other programs.

Any good ideas?Last edited by atoz on Sun Apr 22, 2007 5:43 pm; edited 1 time in total

----------

## dspgen

I think you need the following added to your make.conf:

FOO2ZJS_DEVICES="hp1020"

I get the following:

```

emerge -avt cups foo2zjs foomatic-db foomatic-filters foomatic-db-engine

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!

[ebuild   R   ] net-print/foomatic-db-engine-3.0.20060720  0 kB

[ebuild   R   ] net-print/foomatic-filters-3.0.20060720  USE="cups" 0 kB

[ebuild   R   ] net-print/foomatic-db-20060720  0 kB

[ebuild   R   ] net-print/foo2zjs-20070204  USE="cups foomaticdb -usb" FOO2ZJS_DEVICES="hp1020 -hp1000 -hp1005 -hp1018 -hp1600 -hp2600n -km2200 -km2300 -km2430 -kmcpwl" 0 kB

[ebuild   R   ] net-print/cups-1.2.9  USE="X jpeg ldap nls pam png ppds slp ssl tiff -dbus -php -samba" 0 kB

```

My hp1022N (networked) works great.

----------

## wynn

One other possibility is that net-print/cups installs ghostscript-gpl if there is no ghostscript already and CUPS will only work with ghostscript-esp.

If you find you have got ghostscript-gpl then

```
emerge -C ghostscript-gpl

emerge ghostscript-esp
```

----------

## atoz

dspgen:

Ok... now I'm a little embarrassed...   :Embarassed: 

I didn't actually realize that foo2zjs is a separate package, so I hadn't explicitly emerged it. I assumed it was included with the foomatic packages - especially since it was available in the cups admin interface. Oh well.

Now, solving one problem creates two new, right? The foo2zjs package

1) doesn't seem to be marked stable on x86 (but if you say it works will I'll emerge it anyway) and

2) pulls in the entire set of vim packages as a dependency, which seems pretty retarded (and probably adds a few hours of compiling on my machine, though apparently it's a necessary workaround according to this thread).

Anyway, thanks for your help! I'll try this and see what happens.

Btw, in my defense, none of this is mentioned in the Gentoo Printing Guide. Perhaps that guide should be extended somewhat.

----------

## atoz

 *wynn wrote:*   

> One other possibility is that net-print/cups installs ghostscript-gpl if there is no ghostscript already and CUPS will only work with ghostscript-esp.
> 
> 

 

Ah... good catch. I just checked, and you're absolutely right! I'm replacing ghostscript as we speak.  :Smile: 

So, the cups ebuild depends only on virtual/ghostscript:

```
PDEPEND="

        ...

        virtual/ghostscript"

```

If cups doesn't work with all versions of ghostscript, wouldn't it make sense to explicitly require e.g. ghostcript-esp?

----------

## wynn

The trouble is that horses are being changed midstream.

GhostScript 8.54 was reissued by the author under the GPL on June 15, 2006 and (http://www.cups.org/espgs/index.php) "In 2006, Artifex and the ESP Ghostscript developers agreed to merge the changes from ESP Ghostscript into GPL Ghostscript, and to collaborate on a single version of Ghostscript for all platforms. All development on ESP Ghostscript has ended with the 8.15.4 release."

So the next version of GPL GhostScript will contain the ESP patches but until then ... (splashing sounds as another one misses the saddle ...)

----------

## atoz

After switching to gs-esp and emerging foo2zjs with the correct device flags, it now works beautifully. The gs switch alone didn't fix it, but it might have been required as well.

Thanks a lot for your help!

----------

