[cups] Debugging "Unable to send data to printer."

Nicolas Schmidt schmidtn at math.hu-berlin.de
Sun Sep 27 11:47:20 PDT 2015


Hi,

I’m struggling with setting up a CUPS server for my USB printer on an OpenBSD server. The first problem was that cupsd didn’t even recognize the printer. Turns out that /dev/usb* and /dev/ulpt* *have* to be group-owned by „_cups“ (or whatever „Group“ in cupsd.conf is set to), i.e. it is not enough that the user _cups belongs to the group owning these files since cupsd does a „setgroups(1,&Group)“ call in scheduler/process.c removing all other complimentary group ids.

After fixing these permissions the printer is now recognized and I can install it, however when I try to print a test page through the web interface it fails with „Unable to send data to printer.“. Enabling „LogLevel Debug2“ it get this

E [27/Sep/2015:20:06:58 +0200] [Job 14] Unable to send data to printer.
D [27/Sep/2015:20:06:58 +0200] cupsdMarkDirty(---J-)
D [27/Sep/2015:20:06:58 +0200] cupsdSetBusyState: newbusy="Active clients, printing jobs, and dirty files", busy="Active clients, printing jobs, and dirty files"
D [27/Sep/2015:20:06:58 +0200] [Job 14] Set job-printer-state-message to "Unable to send data to printer.", current level=ERROR
D [27/Sep/2015:20:06:58 +0200] [Job 14] libusb write operation returned fffffff4.

The last number 0xfffffff4 = -12 is the error code returned by libusb_bulk_transfer() (called in backend/usb-libusb.c) and corresponds to LIBUSB_ERROR_NOT_SUPPORTED. I wrote a small program in c that tries to write some data to the printer and I got the same error. (Also I noticed that the kernel driver was attached to the usb interface (libusb_kernel_driver_active() returns 1) and that I couldn’t detach it (libusb_detach_kernel_driver() also returns LIBUSB_ERROR_NOT_SUPPORTED). However libusb_claim_interface() still works, so this might be a red herring.)

However the printer works, since if I do

echo „Hello World!“ > /dev/ulpt0

I get a printout. That’s how far as I got in debugging this error. Any help would be appreciated.

Kind regards,
Nicolas A. Schmidt


More information about the cups mailing list