hp-setup started as normal user fails to setup printer queue

Asked by Frederik Himpe

I am a Mandriva packager and I try to fix some problems in Mandriva's 2010.0 (Cooker) hplip package.

When hp-setup is ran as a non-root user, it fails to setup the printer queue. When it's started as root, it works fine.

$ hp-setup -g

HP Linux Imaging and Printing System (ver. 3.9.8)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-9 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.

hp-setup[5471]: debug: param=
hp-setup[5471]: debug: Starting GUI loop...
Searching... (bus=usb, search=(None), desc=0)
hp-setup[5471]: debug: Probing bus: usb
libusb couldn't open USB device /dev/bus/usb/001/001: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/001/003: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/001: Permission denied.
libusb requires write access to USB device nodes.
hp-setup[5471]: debug: hp:/usb/deskjet_6122?serial=MY2881B2HY64
hp-setup[5471]: debug: hp:/usb/deskjet_6122?serial=MY2881B2HY64: back_end:hp is_hp:True bus:usb model:deskjet_6122 serial:MY2881B2HY64 dev_file: host: zc: port:1
hp-setup[5471]: debug: Cache miss: deskjet_6122
hp-setup[5471]: debug: Reading file: /usr/share/hplip/data/models/models.dat
hp-setup[5471]: debug: Searching for section [deskjet_6122] in file /usr/share/hplip/data/models/models.dat
hp-setup[5471]: debug: Found section [deskjet_6122] in file /usr/share/hplip/data/models/models.dat
hp-setup[5471]: debug: hp:/usb/deskjet_6122?serial=MY2881B2HY64: back_end:hp is_hp:True bus:usb model:deskjet_6122 serial:MY2881B2HY64 dev_file: host: zc: port:1
hp-setup[5471]: debug: hp:/usb/deskjet_6122?serial=MY2881B2HY64: back_end:hp is_hp:True bus:usb model:deskjet_6122 serial:MY2881B2HY64 dev_file: host: zc: port:1
hp-setup[5471]: debug: hp:/usb/deskjet_6122?serial=MY2881B2HY64: back_end:hp is_hp:True bus:usb model:deskjet_6122 serial:MY2881B2HY64 dev_file: host: zc: port:1
hp-setup[5471]: debug: Unable to open file installer/distros.dat for reading.
hp-setup[5471]: debug: []
hp-setup[5471]: debug: Device URI ipp://Intelli.local:631/printers/HPPSProB8300 is invalid/unknown
hp-setup[5471]: debug: Exception: 4 (Unknown/invalid device-uri field)
hp-setup[5471]: debug: {}
hp-setup[5471]: debug: hp:/usb/deskjet_6122?serial=MY2881B2HY64: back_end:hp is_hp:True bus:usb model:deskjet_6122 serial:MY2881B2HY64 dev_file: host: zc: port:1
hp-setup[5471]: debug: deskjet_6122
hp-setup[5471]: debug: (CUPS 1.2.x) Getting list of PPDs using CUPS_GET_PPDS...
hp-setup[5471]: debug: CUPS PPD base path = /usr/share/cups/model
hp-setup[5471]: debug: Foomatic PPD base path = /usr/share/ppd
hp-setup[5471]: debug: Matching PPD list to model deskjet_6122...
hp-setup[5471]: debug: Found match: drv:///hp/hpcups.drv/hp-deskjet_6122.ppd
hp-setup[5471]: debug: [('drv:///hp/hpcups.drv/hp-deskjet_6122.ppd', [])]
hp-setup[5471]: debug: One match found.
hp-setup[5471]: debug: addPrinter('deskjet_6122', 'hp:/usb/deskjet_6122?serial=MY2881B2HY64', '', '', 'drv:///hp/hpcups.drv/hp-deskjet_6122.ppd', '')
hp-setup[5471]: debug: addPrinter() returned (0, client-error-forbidden)
hp-setup[5471]: debug: Device URI ipp://Intelli.local:631/printers/HPPSProB8300 is invalid/unknown
hp-setup[5471]: debug: Exception: 4 (Unknown/invalid device-uri field)
hp-setup[5471]: debug: {}
error: Printer queue setup failed. Please restart CUPS and try again.

cups' error_log shows:
E [18/Oct/2009:12:10:20 +0200] Returning HTTP Forbidden for CUPS-Add-Modify-Printer (ipp://localhost/printers/deskjet_6122) from localhost

Now nowhere in the process it asks me to authenticate as root, so it's not really surprising that it fails. Is not hp-setup supposed to use policykit to get root privileges when needed? At least, hp-plugin works fine when ran as root thanks to the policykit. From what I can see, the com.hp.hplip dbus interface has only the installPlugin() and shutdown() methods, so nothing related to hp-setup...

So, is setting up a printer with hp-setup startedas non-root user supposed to work? If so, how?

$ hp-check -t

HP Linux Imaging and Printing System (ver. 3.9.8)
Dependency/Version Check Utility ver. 14.3

Copyright (c) 2001-9 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.

Note: hp-check can be run in three modes:
1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz or .run) to determine if the proper dependencies are installed to
successfully compile HPLIP.
2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc) or an already built HPLIP supplied tarball has the proper
dependencies installed to successfully run.
3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases (both compile- and run-time dependencies).

Saving output in log file: hp-check.log

Initializing. Please wait...

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

Basic system information:
Linux Anastacia 2.6.31.4-desktop-0.rc2.1mnb #1 SMP Sun Oct 11 21:47:18 EDT 2009 x86_64 AMD Athlon(tm) 64 Processor 3500+ GNU/Linux

Distribution:
mandriva 2010.0

Checking Python version...
OK, version 2.6.3 installed

Checking PyQt 4.x version...
OK, version 4.6 installed.

Checking for CUPS...
Status: scheduler is running
error: Version: (Not available. CUPS may not be installed or not running.)

Checking for dbus/python-dbus...
dbus daemon is running.
python-dbus version: 0.83.0

------------------------------------
| COMPILE AND RUNTIME DEPENDENCIES |
------------------------------------

note: To check for compile-time only dependencies, re-run hp-check with the -c parameter (ie, hp-check -c).
note: To check for run-time only dependencies, re-run hp-check with the -r parameter (ie, hp-check -r).

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

Checking for dependency: CUPS DDK - CUPS driver development kit...
warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.

Checking for dependency: CUPS devel- Common Unix Printing System development files...
error: NOT FOUND! This is a REQUIRED/COMPILE TIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.

Checking for dependency: CUPS image - CUPS image development files...
error: NOT FOUND! This is a REQUIRED/COMPILE TIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.

Checking for dependency: DBus - Message bus system...
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...
error: NOT FOUND! This is a REQUIRED dependency. Please make sure that this dependency is installed before installing or running HPLIP.

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...
error: NOT FOUND! This is a REQUIRED dependency. Please make sure that this dependency is installed before installing or running HPLIP.

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: PolicyKit - Administrative policy framework...
OK, found.

Checking for dependency: PyQt 4 DBus - DBus Support for PyQt4...
OK, found.

Checking for dependency: Python DBus - Python bindings for DBus...
OK, found.

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

Checking for dependency: Python libnotify - Python bindings for the libnotify Desktop notifications...
OK, found.

Checking for dependency: Python XML libraries...
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...
error: NOT FOUND! This is a REQUIRED/COMPILE TIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.

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

Checking for dependency: xsane - Graphical scanner frontend for SANE...
warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.

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

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

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

[hplip]
version=3.9.8

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-3.9.8
icon=/usr/share/applications
cupsbackend=/usr/lib/cups/backend
cupsfilter=/usr/lib/cups/filter
drv=/usr/share/cups/drv/hp

# Following values are determined at configure time and cannot be changed.
[configure]
network-build=yes
pp-build=yes
gui-build=yes
scanner-build=yes
fax-build=yes
dbus-build=yes
cups11-build=no
doc-build=yes
shadow-build=no
hpijs-install=yes
foomatic-drv-install=no
foomatic-ppd-install=no
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=no
internal-tag=3.9.8.36
restricted-build=no
ui-toolkit=qt4
qt3=no
qt4=yes
policy-kit=yes
hpijs-only-build=no
lite-build=no
udev-acl-rules=yes

Current contents of '/var/lib/hp/hplip.state' file:
[plugin]
eula = 1
installed = 1

Current contents of '~/.hplip/hplip.conf' file:
[last_used]
printer_name =
printer =
working_dir = /home/frederik/tmp/hplip-3.9.8-plugin.run
device_uri = "hp:/usb/deskjet_6122?serial=MY2881B2HY64"

[commands]
scan =

[installation]
version = 3.9.8.36
date_time = 18-10-09 12:37:09

[settings]
systray_messages = 0
systray_visible = 2

[fax]
email_address =
voice_phone =

[refresh]
rate = 30
enable = false
type = 1

[polling]
enable = false
device_list =
interval = 5

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

libusb couldn't open USB device /dev/bus/usb/001/001: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/001/003: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/001: Permission denied.
libusb requires write access to USB device nodes.
  Device URI Model
  ---------------------------------------- -----------------------------------
  hp:/usb/deskjet_6122?serial=MY2881B2HY64 HP deskjet 6122

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

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

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

Checking output of 'scanimage -L'...
libusb couldn't open USB device /dev/bus/usb/001/001: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/001/003: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/001: Permission denied.
libusb requires write access to USB device nodes.

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

---------------------
| 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 0x3404 at 001:002:
    Device URI: hp:/usb/deskjet_6122?serial=MY2881B2HY64
    Device node: /dev/bus/usb/001/002
    Mode: 0664
getfacl: Removing leading '/' from absolute path names
# file: dev/bus/usb/001/002
# owner: root
# group: lp
user::rw-
user:frederik:rw-
group::rw-
mask::rw-
other::r--

---------------
| USER GROUPS |
---------------

frederik backup

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

error: 8 errors and/or warnings.

Please refer to the installation instructions at:
http://hplip.sourceforge.net/install/index.html

Done.

(by the way, in spite to the above error, cups 1.4.1 is running)

Question information

Language:
English Edit question
Status:
Answered
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mubeen Jukaku (mubeen-jukaku) said :
#1

Can you add the non-root user to lp group, and run hp-setup.

Can you help with this problem?

Provide an answer of your own, or ask Frederik Himpe for more information if necessary.

To post a message you must log in.