Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 207981

Summary: net-print/hplip-2.7.12-r1: io/hpmud/musb.c 135: unable get_string_descriptor -1: Operation not permitted
Product: Gentoo Linux Reporter: John Masinter <john>
Component: [OLD] PrintingAssignee: Printing Team <printing>
Status: RESOLVED UPSTREAM    
Severity: normal CC: smorg
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: new /etc/udev/rules.d/70-hpmud.rules file

Description John Masinter 2008-01-29 01:00:16 UTC
I first tried to resolve this through HPLIP support at launchpad.net:
https://answers.launchpad.net/hplip/+question/22114

I've read about every post on HPLIP I could find:
1. My USB permissions are wide open, 777
2. hp-setup adds printer no problem
3. hp-check runs clean, 0 errors, 0 warnings

Note: 
1. scanning works fine (using scanimage)
2. cups recognizes printer fine, and hp-toolbox shows ink levels.
3. all worked well with hplip 1.7

Printing just queues up, and the above mentioned error logs every 30 sec.
Its not giving me any hint as to whats wrong. Any help appreciated.

Here is a lot of information:

~$ lsusb
Bus 001 Device 001: ID 0000:0000  
Bus 002 Device 008: ID 03f0:4c11 Hewlett-Packard 
Bus 002 Device 001: ID 0000:0000  
Bus 003 Device 001: ID 0000:0000  

~$ ls -al /dev/bus/usb/002
total 0
drwxrwxrwx 2 root john       80 Jan 28 19:22 .
drwxr-xr-x 5 root root      100 Jan 11 15:18 ..
crwxrwxrwx 1 root usb  189, 128 Jan 11 15:18 001
crwxrwxrwx 1 root lp   189, 135 Jan 28 19:36 008

~$ hp-check

HP Linux Imaging and Printing System (ver. 2.7.12)
Dependency/Version Check Utility ver. 12.2

Copyright (c) 2001-7 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Saving output in log file: hp-check.log

Initializing. Please wait...

---------------
| SYSTEM INFO |
---------------

Basic system information:
Linux lisa 2.6.23.12 #1 PREEMPT Thu Dec 20 19:59:45 EST 2007 i686 AMD Sempron(tm) Processor 3400+ AuthenticAMD GNU/Linux

Distribution:
gentoo 0.0

HPOJ running?
No, HPOJ is not running (OK).

Checking Python version...
OK, version 2.4.4 installed

Checking PyQt version...
OK, version 3.17 installed.

Checking SIP version...
OK, Version 4.5.2 installed

Checking for CUPS...
Status: scheduler is running
Version: 1.2.12

Checking for Reportlab...
OK, version >= 2.0

----------------
| DEPENDENCIES |
----------------


Checking for dependency: cups - Common Unix Printing System...
OK, found.

Checking for dependency: cups-devel- Common Unix Printing System development files...
OK, found.

Checking for dependency: gcc - GNU Project C and C++ Compiler...
OK, found.

Checking for dependency: GhostScript - PostScript and PDF language interpreter and previewer...
OK, found.

Checking for dependency: libcrypto - OpenSSL cryptographic library...
OK, found.

Checking for dependency: libjpeg - JPEG library...
OK, found.

Checking for dependency: libnetsnmp-devel - SNMP networking library development files...
OK, found.

Checking for dependency: libpthread - POSIX threads library...
OK, found.

Checking for dependency: libtool - Library building support services...
OK, found.

Checking for dependency: libusb - USB library...
OK, found.

Checking for dependency: make - GNU make utility to maintain groups of programs...
OK, found.

Checking for dependency: PIL - Python Imaging Library (required for commandline scanning with hp-scan)...
OK, found.

Checking for dependency: ppdev - Parallel port support kernel module....
OK, found.

Checking for dependency: PyQt - Qt interface for Python...
OK, found.

Checking for dependency: python-devel - Python development files...
OK, found.

Checking for dependency: Python 2.3 or greater - Required for fax functionality...
OK, found.

Checking for dependency: Python 2.2 or greater - Python programming language...
OK, found.

Checking for dependency: Reportlab - PDF library for Python...
OK, found.

Checking for dependency: SANE - Scanning library...
OK, found.

Checking for dependency: SANE - Scanning library development files...
OK, found.

Checking for dependency: scanimage - Shell scanning program...
OK, found.

Checking for dependency: xsane - Graphical scanner frontend for SANE...
OK, found.


----------------------
| HPLIP INSTALLATION |
----------------------


Currently installed HPLIP version...
HPLIP 2.7.12 currently installed in '/usr/share/hplip'.

Current contents of '/etc/hp/hplip.conf' file:
# hplip.conf.  Generated from hplip.conf.in by configure.

[hpssd]
# Note: hpssd does not support dynamic ports
# Port 2207 is the IANA assigned port for hpssd
port=2207

[hplip]
version=2.7.12

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-2.7.12
icon=/usr/share/applications
cupsbackend=/usr/libexec/cups/backend
foomatic=/usr/share/foomatic

# Following values are determined at configure time and cannot be changed.
[configure]
network-build=no
pp-build=yes
gui-build=yes
scanner-build=yes
fax-build=yes
cups11-build=no
doc-build=no
shadow-build=no
foomatic-xml-install=no
foomatic-ppd-install=yes
internal-tag=2.7.12.10


-------------------------------
| DISCOVERED PARALLEL DEVICES |
-------------------------------

No devices found.

--------------------------
| DISCOVERED USB DEVICES |
--------------------------

  Device URI                                    Model                 
  --------------------------------------------  ----------------------
  hp:/usb/PSC_1500_series?serial=MY647C30Y104G  HP PSC 1500 series    
  G                                                                   

---------------------------------
| INSTALLED CUPS PRINTER QUEUES |
---------------------------------


PSC_1500
--------
Type: Printer
Installed in HPLIP?: Yes, using the hp: CUPS backend.
Device URI: hp:/usb/PSC_1500_series?serial=MY647C30Y104GG
PPD: /etc/cups/ppd/PSC_1500.ppd
PPD Description: HP PSC 1500 Foomatic/hpijs (recommended)
Printer status: printer PSC_1500 now printing PSC_1500-254.  enabled since Mon Jan 28 19:24:22 2008
Communication status: Good


----------------------
| SANE CONFIGURATION |
----------------------

'hpaio' in '/etc/sane.d/dll.conf'...
OK, found. SANE backend 'hpaio' is properly set up.

Checking output of 'scanimage -L'...
device `hpaio:/usb/PSC_1500_series?serial=MY647C30Y104GG' is a Hewlett-Packard PSC_1500_series all-in-one


---------------------
| PYTHON EXTENSIONS |
---------------------

Checking 'cupsext' CUPS extension...
OK, found.

Checking 'pcardext' Photocard extension...
OK, found.

Checking 'hpmudext' I/O extension...
OK, found.

Checking 'scanext' SANE scanning extension...
OK, found.


-----------------
| USB I/O SETUP |
-----------------


Checking for permissions of USB attached printers...

HP Device 0x4c11 at 002:008: 
    Device URI: hp:/usb/PSC_1500_series?serial=MY647C30Y104GG
    Device node: /dev/bus/usb/002/008
    Mode: 0777

-----------
| SUMMARY |
-----------

No errors or warnings.


~$ ps axf | grep .....
  PID  PPID USER     COMMAND
 3558     1 root       python /usr/share/hplip/hpssd.py
 4202     1 root       /usr/sbin/cupsd
21170  4202 lp           /usr/bin/perl /usr/libexec/cups/filter/foomatic-rip 259 guest Test Page 1 job-uuid=urn
21176 21170 lp             /usr/bin/perl /usr/libexec/cups/filter/foomatic-rip 259 guest Test Page 1 job-uuid=u
21177 21176 lp               /usr/bin/perl /usr/libexec/cups/filter/foomatic-rip 259 guest Test Page 1 job-uuid
21178 21176 lp               sh -c gs '-dBATCH' '-dPARANOIDSAFER' '-dQUIET' '-dNOPAUSE' '-sDEVICE=ijs' '-sIjsSe
21179 21178 lp                 gs -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs -sDe
21180 21179 lp                   hpijs
21171  4202 lp           hp:/usb/PSC_1500_series?serial=MY647C30Y104GG 259 guest Test Page 1 job-uuid=urn:uuid:



Reproducible: Always

Steps to Reproduce:
1. Install HPLIP
2. Restart CUPS
3. Add printer
4. print test page from CUPS or any applications.

Actual Results:  
Jan 28 19:36:54 lisa PSC_1500_series?serial=MY647C30Y104GG: io/hpmud/musb.c 135: unable get_string_descriptor -1: Operation not permitted
Jan 28 19:36:54 lisa PSC_1500_series?serial=MY647C30Y104GG: io/hpmud/musb.c 603: invalid product id string ret=-1
Jan 28 19:36:54 lisa PSC_1500_series?serial=MY647C30Y104GG: io/hpmud/musb.c 1057: unable to open hp:/usb/PSC_1500_series?serial=MY647C30Y104GG
Jan 28 19:36:54 lisa PSC_1500_series?serial=MY647C30Y104GG: prnt/backend/hp.c 625: INFO: open device failed; will retry in 30 seconds...
Jan 28 19:36:55 lisa hpijs: io/hpmud/musb.c 135: unable get_string_descriptor -1: Operation not permitted
Jan 28 19:36:55 lisa hpijs: io/hpmud/musb.c 603: invalid product id string ret=-1
Jan 28 19:36:55 lisa hpijs: io/hpmud/musb.c 1057: unable to open hp:/usb/PSC_1500_series?serial=MY647C30Y104GG




Expected Results:  
Print successfully
Comment 1 Ed Wiget 2008-01-29 08:50:59 UTC
Created attachment 142085 [details]
new /etc/udev/rules.d/70-hpmud.rules file

I have been all day with same problem --different printer, same error messages -- but finally found a resolution.  The attachment I am adding fixes this problem and goes in the /etc/udev/rules.d directory.  I commented out the original lines and replaced it with the ones from http://launchpadlibrarian.net/9682810/C%3A%5Cdes%5Ctmp%5C55-hpmud.rules reference this bug - https://bugs.launchpad.net/ubuntu/+source/system-config-printer/+bug/147369  There were changes to the way hplip assigns permissions and ids devices - also ref this http://hplip.sourceforge.net/tech_docs/tarball_install.html
Comment 2 Ed Wiget 2008-01-29 08:52:19 UTC
I forgot, I am using net-print/hplip-2.7.12-r1
Comment 3 John Masinter 2008-01-30 03:03:32 UTC
Thank you very much Ed for your comments and udev attachment. When I first researched this issue, I found many people had a problem with the usb device permissions, as setup by udev when the device is discovered. This was one of the first things I tried. New udev rules, and also, just "chmod 666" on the device. In my case, this did not change the behavior. To quadruple check, I tried your new udev rules just now, restarted udev, and it did set the usb device to:
   crw-rw-rw- 1 lp   lp  189, 136 Jan 29 21:11 009
And my cupsd.conf specifies:
   Group lp
So I think this is all good. But still I get the same error.

I put cupsd in debug mode, and the log  result of a print attempt can be viewed here: http://pastebin.org/17321

But I think the crux of the matter is this line from the log:
D [29/Jan/2008:21:26:52 -0500] [Job 262] prnt/backend/hp.c 625: INFO: open device failed; will retry in 30 seconds...

But it does not list the device name. The USB device is wide open:
john@lisa~/tmp$ lsusb
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 009: ID 03f0:4c11 Hewlett-Packard
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
john@lisa~/tmp$ ls -al /dev/bus/usb/002
total 0
drwxrwxrwx 2 root john 80 Jan 29 21:11 .
drwxr-xr-x 5 root root 100 Jan 11 15:18 ..
crwxrwxrwx 1 root usb 189, 128 Jan 11 15:18 001
crwxrwxrwx 1 root lp 189, 136 Jan 29 21:11 009

udev brought it up as "rw-rw---" but the cupsd conf sets group to 'lp' just like the device, so that should have worked "as is". From cupsd.conf:
  # execute external programs with this group
  Group lp
But when that did not, I chmod'ed the device to 777, and restarted cups, and there was no change in the behavior.

The code that the log message references from hp.c is this:
   /* Open hp device. */
   while ((stat = hpmud_open_device(argv[0], ma.prt_mode, &hd)) != HPMUD_R_OK)
   {
       /* Display user error. */
       device_event(argv[0], argv[1], 5000+stat, "error", RETRY_TIMEOUT);
       BUG("INFO: open device failed; will retry in %d seconds...\n", RETRY_TIMEOUT);
       sleep(RETRY_TIMEOUT);
       retry = 1;
   }

But the log just does not display the device name. Perhaps it is the hplip device of "PSC_1500_series?serial=MY647C30Y104GG" rather than the literal usb device. I dont' know.

Any tips appreciated.
Comment 4 John Masinter 2008-01-31 00:52:54 UTC
It works as USB backend! In other words, this works (setup with cups):

HP_PSC_1500_series_USB_1
Description: HP PSC 1500 series
Location: Local Printer
Make and Model: HP PSC 1510 Foomatic/hpijs (recommended)
Printer State: idle, accepting jobs, published.
Device URI: usb://HP/PSC%201500%20series?serial=MY647C30Y104GG

And this does NOT work (setup either with cups or hp-toolbox):

PSC_1500
Description: HP Ink Jet
Location: John's Desk
Make and Model: HP PSC 1500 Foomatic/hpijs (recommended)
Printer State: idle, accepting jobs, published.
Device URI: hp:/usb/PSC_1500_series?serial=MY647C30Y104GG

I had read that many users used this solution, and I had previously tried this by changing the device in cupsd.conf (and restarting cups of course). But at that time it did not fix it. I don't understand. This time I added the usb backend via cups, as you suggested, and it works.

Now, more interesting...

I left the previous hp:/ printer in tact, so I have two printers defined for same device, one using hp:/ (hplip) backend, and one using cups usb backend (non-hplip). Now, hp-toolbox reads ink levels from the hp:/ printer, but can not print to it. Also, once anything accesses the hp:/ printer, such as hp-toolbox or a print attempt to the hp:/ printer, then the previously working usb backend printer no longer works, with cups saying "device not connected."

To fix this state I did this:

-I deleted both printers.
-killed /usr/share/hplip/hpssd.py (which was started by hp-toolbox, in trying to access the hp:/ device)
-stopped cups
-turned off the printer
-start cups
-start the printer
-wait a minute for the usb device to be recognized
-in cups, click "Administration", you will see two "news printers found", one as hplip backend, one as usb backend.
-Added the usb backend printer again

It works now! So in other words, I can print with usb backend, but this by-passes hplip and therefore does not allow use of hp-toolbox to check ink levels nor any other fancy stuff. 

Any ideas what's up with this? I think this is an hplip (or cups) bug.
Comment 5 Denis Dupeyron (RETIRED) gentoo-dev 2008-02-05 08:45:41 UTC
John,

I'm going to propose we close this as UPSTREAM because that's really what it looks like to me and you've already filed a bug there. Apart from using safer udev rules there's not much we do to this package.

Feel free to reopen when you have more info to help us make progress.

Denis.
Comment 6 Skander Morgenthaler 2008-10-11 20:14:05 UTC
I recently had the same problems with printing and in my case also the attached 70-hpmud.rules did not help. But instead of making the device open to anyone, I can successfully use hp printers by just changing the device owner (and group) to "lp" - thus leaving out the MODE="0666" stuff. Don't know why making the device less open works, though. So my working solution includes the following /etc/udev/rules.d/70-hpmud.rules. I should propably add that in the process of getting the hp printers to work on my system I upgraded to net-print/hplip-2.8.7

# Udev rules file for HP printer products.

ACTION!="add", GOTO="hpmud_rules_end"

SUBSYSTEM!="usb|usb_device", GOTO="hpmud_rules_end"
SUBSYSTEM=="usb", ENV{DEVTYPE}!="usb_device" ,GOTO="hpmud_rules_end"

# Check for AiO products (0x03f0xx11).
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??11", OWNER="lp",  GROUP="lp"
# Check for Photosmart products (0x03f0xx02).
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??02", OWNER="lp",  GROUP="lp"
# Check for Business Inkjet products (0x03f0xx12).
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??12", OWNER="lp",  GROUP="lp"
# Check for Deskjet products (0x03f0xx04).
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??04", OWNER="lp",  GROUP="lp"
# Check for LaserJet products (0x03f0xx17).
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??17", OWNER="lp",  GROUP="lp"

LABEL="hpmud_rules_end"