Wrong permissions on /var/spool/cups

Bug #1490321 reported by Nathan Adams
42
This bug affects 10 people
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

The permission on /var/spool/cups are wrong leading to errors such as this (from syslog):

/hpps: [5186]: error: Failed to create /var/spool/cups/tmp/.hplip

$ ls -alh /var/spool/ | grep cups
drwx--x--- 3 root lp 4.0K Aug 29 16:43 cups

The permissions remain incorrect after running hp-doctor/hp-check several times.

$ hp-check
Saving output in log file: /home/nate/hp-check.log

HP Linux Imaging and Printing System (ver. 3.15.2)
Dependency/Version Check Utility ver. 15.1

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

Check types:
a. EXTERNALDEP - External Dependencies
b. GENERALDEP - General Dependencies (required both at compile and run time)
c. COMPILEDEP - Compile time Dependencies
d. [All are run-time checks]
PYEXT SCANCONF QUEUES PERMISSION

Status Types:
    OK
    MISSING - Missing Dependency or Permission or Plug-in
    INCOMPAT - Incompatible dependency-version or Plugin-version

warning: ubuntu-15.04 version is not supported. Using ubuntu-14.10 versions dependencies to verify and install...

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

 Kernel: 3.19.0-26-generic #28-Ubuntu SMP Tue Aug 11 14:16:32 UTC 2015 GNU/Linux
 Host: neredium
 Proc: 3.19.0-26-generic #28-Ubuntu SMP Tue Aug 11 14:16:32 UTC 2015 GNU/Linux
 Distribution: ubuntu 15.04
 Bitness: 64 bit

-----------------------
| HPLIP CONFIGURATION |
-----------------------

HPLIP-Version: HPLIP 3.15.2
HPLIP-Home: /usr/share/hplip
warning: HPLIP-Installation: Auto installation is not supported for ubuntu distro 15.04 version

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

[hplip]
version=3.15.2

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/hplip/HP
ppdbase=/usr/share/ppd/hplip
doc=/usr/share/doc/hplip-doc/HTML
html=/usr/share/doc/hplip-3.15.2
icon=no
cupsbackend=/usr/lib/cups/backend
cupsfilter=/usr/lib/cups/filter
drv=/usr/share/cups/drv
bin=/usr/bin

# Following values are determined at configure time and cannot be changed.
[configure]
network-build=yes
libusb01-build=no
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=yes
foomatic-ppd-install=yes
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=no
internal-tag=3.15.2
restricted-build=no
ui-toolkit=qt4
qt3=no
qt4=yes
policy-kit=yes
lite-build=no
udev_sysfs_rules=no
hpcups-only-build=no
hpijs-only-build=no

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

Current contents of '~/.hplip/hplip.conf' file:
[settings]
systray_visible = 1
systray_messages = 0

[last_used]
device_uri =
printer_name =
working_dir = /home/downloads/software/drivers/hp/hplip-3.15.2-plugin.run

[commands]
scan = /usr/bin/simple-scan %SANE_URI%

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

[polling]
enable = false
interval = 5
device_list =

[fax]
voice_phone =
email_address =

[upgrade]
notify_upgrade = false
last_upgraded_time = 1440591398
pending_upgrade_time = 0

[installation]
date_time = 08/30/15 15:16:06
version = 3.15.2

 <Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>

--------------------------
| External Dependencies |
--------------------------

 scanimage scanimage - Shell scanning program OPTIONAL 1.0 1.0.24 OK -
 policykit PolicyKit - Administrative policy framework OPTIONAL - 0.105 OK -
 xsane xsane - Graphical scanner frontend for SANE OPTIONAL 0.9 0.998 OK -
 avahi-utils avahi-utils OPTIONAL - 0.6.31 OK -
 gs GhostScript - PostScript and PDF language interpreter and previewer REQUIRED 7.05 9.15 OK -
 cups CUPS - Common Unix Printing System REQUIRED 1.1 2.0.2 OK 'CUPS Scheduler is running'
 dbus DBus - Message bus system REQUIRED - 1.8.12 OK -
 network network -wget OPTIONAL - 1.16.1 OK -

-------------------------
| General Dependencies |
-------------------------

 python3-pil PIL - Python Imaging Library (required for commandline scanning with hp-scan) OPTIONAL - 1.1.7 OK -
 python3X Python 2.2 or greater - Python programming language REQUIRED 2.2 2.7.9 OK -
 libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED 5.0.9 5.7.2 OK -
 error: python3-reportlab Reportlab - PDF library for Python OPTIONAL 2.0 3.1.44 MISSING 'python3-reportlab needs to be installed'
 libjpeg libjpeg - JPEG library REQUIRED - - OK -
 sane-devel SANE - Scanning library development files REQUIRED - 1.0.24 OK -
 libcrypto libcrypto - OpenSSL cryptographic library REQUIRED - 1.0.1 OK -
 python3-dbus Python DBus - Python bindings for DBus REQUIRED 0.80.0 1.2.0 OK -
 python3-notify2 Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - OK -
 libusb libusb - USB library REQUIRED - 1.0 OK -
 sane SANE - Scanning library REQUIRED - 1.0.24 OK -
 libpthread libpthread - POSIX threads library REQUIRED - b'2.21' OK -
 cups-image CUPS image - CUPS image development files REQUIRED - 2.0.2 OK -
 cups-devel CUPS devel- Common Unix Printing System development files REQUIRED - 2.0.2 OK -
 python3-devel Python devel - Python development files REQUIRED 2.2 2.7.9 OK -
 python3-xml Python XML libraries REQUIRED - 2.1.0 OK -
 python3-pyqt4-dbus PyQt 4 DBus - DBus Support for PyQt4 OPTIONAL 4.0 4.11.3 OK -
 python3-pyqt4 PyQt 4- Qt interface for Python (for Qt version 4.x) REQUIRED 4.0 4.11.3 OK -

---------------
| COMPILEDEP |
---------------

 error: libtool libtool - Library building support services REQUIRED - - MISSING 'libtool needs to be installed'
 gcc gcc - GNU Project C and C++ Compiler REQUIRED - 4.9.2 OK -
 make make - GNU make utility to maintain groups of programs REQUIRED 3.0 4.0 OK -

----------------------
| Python Extentions |
----------------------

 cupsext CUPS-Extension REQUIRED - 3.15.2 OK -
 hpmudext IO-Extension REQUIRED - 3.15.2 OK -

-----------------------
| Scan Configuration |
-----------------------

 scanext Scan-SANE-Extension REQUIRED - 3.15.2 OK -
'/etc/sane.d/dll.d/hpaio' not found.
 hpaio HPLIP-SANE-Backend REQUIRED - 3.15.2 OK 'hpaio found in /etc/sane.d/dll.conf'

-----------------------
| Other Dependencies |
-----------------------

------------------------------
| DISCOVERED SCANNER DEVICES |
------------------------------

device `hpaio:/net/HP_LaserJet_CM1415fnw?ip=192.168.1.6' is a Hewlett-Packard HP_LaserJet_CM1415fnw all-in-one

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

No devices found.

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

HP_LaserJet_CM1415fnw
---------------------
Type: Printer
Device URI: hp:/net/HP_LaserJet_CM1415fnw?ip=192.168.1.6
PPD: /etc/cups/ppd/HP_LaserJet_CM1415fnw.ppd
warning: Failed to read /etc/cups/ppd/HP_LaserJet_CM1415fnw.ppd ppd file
PPD Description:
Printer status: printer HP_LaserJet_CM1415fnw is idle. enabled since Wed 26 Aug 2015 08:17:32 AM EDT
Required plug-in status: Installed
Communication status: Good

--------------
| PERMISSION |
--------------

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

Missing Required Dependencies
-----------------------------
error: 'libtool' package is missing/incompatible

Missing Optional Dependencies
-----------------------------
None

Total Errors: 2
Total Warnings: 0

Run 'hp-doctor' command to prompt and fix the issues.

Done.

Revision history for this message
goutam (goutamkk) wrote :

Hi Nathan,

Can you install the latest hplip-3.15.7 package ?
You can download hplip-3.15.7.run file from http://hplipopensource.com/hplip-web/gethplip.html and install the package by running command 'sh hplip-3.15.7.run' in terminal.

Delete the existing print queue for this printer using command 'hp-setup -r' and re-configure the new queue using command 'hp-setup'.

Let us know if the issue is still same..

Thanks,
Goutam

Revision history for this message
marco (nazgul17) wrote :

Hi,

I run into the same problem. I am using a fresh install of Kubuntu 15.10. I installed the latest version of the software (3.15.9) but permissions did not change. Once I run a chmod 777 command, I was able to set printers.

Marco

Revision history for this message
Scott Howard (showard314) wrote :

I saw this too.

I just did
sudo apt-get install hplip --reinstall

and it added /var/spool/cups/tmp/.hplip
with the correct permissions

$ sudo ls -alh /var/spool/cups/tmp
total 36K
drwxrwx--T 3 root lp 4.0K Nov 19 09:56 .
drwx--x--- 3 root lp 24K Nov 15 19:54 ..
-rw------- 1 lp lp 0 Nov 19 08:34 cups-dbus-notifier-lockfile
drwxr-xr-x 2 lp lp 4.0K Nov 19 09:56 .hplip

might be a work around, don't know why it didn't do this before (or why it got deleted)

Revision history for this message
Török Edwin (edwintorok) wrote :

I encountered this too on Debian 8.2 Jessie, with HPLIP 3.15.11 from HP site and Device URI: hp:/net/HP_LaserJet_Pro_M201n?ip=192.168.1.129

Ocasionally printed pages will be incomplete, for example a spreadsheet has the whole grid, but some values are not printed.
The spool file (a PDF file in /var/spool/cups/d00553-001 for example) looks good, but the printed page doesn't. The HP tray icon says the printing was successful and doesn't display any errors.

Syslog has this entry though:

Dec 26 23:37:34 mama-tata-laptop hpps: [8238]: error: Failed to create /var/spool/cups/tmp/.hplip
Dec 26 23:37:34 mama-tata-laptop dbus[527]: [system] Activating service name='org.opensuse.CupsPkHelper.Mechanism' (using servicehelper)
Dec 26 23:37:34 mama-tata-laptop dbus[527]: [system] Successfully activated service 'org.opensuse.CupsPkHelper.Mechanism'
Dec 26 23:40:26 mama-tata-laptop python: io/hpmud/hpmud.c 246: invalid channel_open state, current io_mode=raw/uni service=HP-MESSAGE hp:/net/HP_LaserJet_Pro_M201n?ip=192.168.1.129
Dec 26 23:40:26 mama-tata-laptop python: io/hpmud/hpmud.c 702: invalid channel_close state

If I retry printing (either from the application or just doing a 'Reprint job' from CUPS) will print the full, correct page, and then
/var/spool/cups/tmp/.hplip will exist with correct permissions.

Note that Debian uses systemd by default now, is this related to perhaps some race condition with its PrivateTmp feature https://bugzilla.redhat.com/show_bug.cgi?id=830630?
I've switched to SysVinit now, and will try to reproduce the problem.

FWIW I had a Samsung ML2010P and it never had problems like this: on rare ocassions when there was an error it'd print a postscript error mesage and CUPS would say printing failed, it didn't print half the content and claim it successfully printed the page.

Revision history for this message
Török Edwin (edwintorok) wrote :
Download full text (11.1 KiB)

The problem still happens with SysVinit and hplip 3.16.2, just got an incomplete print and this syslog message:
Feb 22 17:02:16 mama-tata-laptop hpps: [11414]: error: Failed to create /var/spool/cups/tmp/.hplip

If I look at the filesystem now the dir did get created:
# ls -al /var/spool/cups/tmp
összesen 20
drwxrwx--T 3 root lp 4096 febr 22 18:14 .
drwx--x--- 3 root lp 12288 febr 22 18:14 ..
drwxr-xr-x 2 lp lp 4096 febr 22 17:02 .hplip

$ hp-check
Saving output in log file: /home/tata/hp-check.log

HP Linux Imaging and Printing System (ver. 3.16.2)
Dependency/Version Check Utility ver. 15.1

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

Check types:
a. EXTERNALDEP - External Dependencies
b. GENERALDEP - General Dependencies (required both at compile and run time)
c. COMPILEDEP - Compile time Dependencies
d. [All are run-time checks]
PYEXT SCANCONF QUEUES PERMISSION

Status Types:
    OK
    MISSING - Missing Dependency or Permission or Plug-in
    INCOMPAT - Incompatible dependency-version or Plugin-version

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

 Kernel: 4.3.0-0.bpo.1-686-pae #1 SMP Debian 4.3.3-7~bpo8+1 (2016-01-19) GNU/Linux
 Host: mama-tata-laptop
 Proc: 4.3.0-0.bpo.1-686-pae #1 SMP Debian 4.3.3-7~bpo8+1 (2016-01-19) GNU/Linux
 Distribution: debian 8.3
 Bitn...

Revision history for this message
guttermonk (guttermonk) wrote :

I'm able to add HP printers and print, but I still get this error from journalctl -b

/hpfax[8399]: [8399]: error: Failed to create /var/spool/cups/tmp/.hplip

I ran hp-check and didn't get any errors or missing dependencies. I've tried renaming the .hplip folder, but when I reboot, the renamed folder is deleted and a new .hplip folder has been created. I've tried reinstalling hplip numerous times, along with removing and reinstalling my printers using hp-setup.

I've also checked the privileges, which look the same as what others have posted above:
$ sudo namei -l /var/spool/cups/tmp/.hplip
f: /var/spool/cups/tmp/.hplip
drwxr-xr-x root root /
drwxr-xr-x root root var
drwxr-xr-x root root spool
drwx--x--- root lp cups
drwxrwx--T root lp tmp
drwxr-xr-x lp lp .hplip

Please let me know if there's anything I haven't tried, or if there is a solution.

hplip 3.17.10
cups 2.2.7
ubuntu 18.04 LTS
kernel 4.15.0-99-generic(x86_64)

Revision history for this message
Raphaël Droz (raphael-droz) wrote :

I don't know if this is advised to do, but:
`sudo chmod g+w /var/spool/cups/tmp/.hplip`
could let users belonging to the `lp` group creating/changing files under this directory.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.