hp-sendfax doesn't add files

Bug #702934 reported by David Levine
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

hplip 3.10.9-9 on Fedora 14
HP Photosmart C7280, prints and scans properly

1) $ hp-sendfax -ldebug
2) hit Next to skip cover page
3) add file
    The added file does not appear in the file list, but it DOES get added to the CUPS print queue.

Here's the relevant debug output:
  hp-sendfax[22720]: debug: Trying to add file: /tmp/o.png
  hp-sendfax[22720]: debug: File type of file /tmp/o.png: image/png
  hp-sendfax[22720]: debug: FileTable_callback(/tmp/o.png)

If a cover page is added, it does appear in the file list. If I then try to send the fax with an added file, only the page count is 1 (just the cover page).

Why would added files not be seen by hp-sendfax?

Revision history for this message
David Levine (levinedl) wrote :
Revision history for this message
David Levine (levinedl) wrote :

Still broken with hplip 3.12 (Fedora 17).

Could this be relevant:
    https://bugs.launchpad.net/hplip/+bug/987837/comments/3

I don't see any .g3 or hp-fax files at all.

Revision history for this message
David Levine (levinedl) wrote :

If I disable SElinux, a /tmp/hpfax-XXXXXX file is created. But it has 0 length. I do see this error message:

ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/hplip/hpssd.py", line 554, in handle_system_signal
    return handle_signal('system', *args, **kwds)
  File "/usr/share/hplip/hpssd.py", line 550, in handle_signal
    return handle_event(event, args[6:])
  File "/usr/share/hplip/hpssd.py", line 467, in handle_event
    handle_fax_event(event, pipe_name)
  File "/usr/share/hplip/hpssd.py", line 253, in handle_fax_event
    pipe = os.open(pipe_name, os.O_RDONLY)
OSError: [Errno 13] Permission denied: '/var/log/hp/hpfax-pipe-24'

With SElinux, I don't get that message and the /tmp/hpfax-XXXXXX is not created.

Is this a clue?

Revision history for this message
Sanjay Kumar (sanjay-kumar14) wrote :

Hi,

Thanks for reporting the issue in HPLIP. To help us understand and analyze the issue please follow following things.

=> Download and install the latest HPLIP release from http://hplipopensource.com/hplip-web/install/install/index.html (automatic) or http://hplipopensource.com/hplip-web/install/manual/index.html (manual if automatic does not work)

=> Reconfigure print queue with the commands in the terminal mentioned below.
       => system-config-printer (remove all print queues)
      => su -c "hp-plugin" (This will download right plugin)
       => hp-setup (It should not be run in a root mode. This command is adding print queue, make sure you select ppd name having "-ps" or "hpcups" substring)

Revision history for this message
David Levine (levinedl) wrote :

I did those, no improvement. Even with SELinux set to permissive, I get notifications such as the one below.
I ran these:

    sudo grep hpfax /var/log/audit/audit.log | sudo audit2allow -M mypol
    sudo semodule -i mypol.pp
    sudo grep grep /var/log/audit/audit.log | sudo audit2allow -M mypol
    sudo semodule -i mypol.pp

and got:

ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/hplip/hpssd.py", line 554, in handle_system_signal
    return handle_signal('system', *args, **kwds)
  File "/usr/share/hplip/hpssd.py", line 550, in handle_signal
    return handle_event(event, args[6:])
  File "/usr/share/hplip/hpssd.py", line 467, in handle_event
    handle_fax_event(event, pipe_name)
  File "/usr/share/hplip/hpssd.py", line 253, in handle_fax_event
    pipe = os.open(pipe_name, os.O_RDONLY)
OSError: [Errno 13] Permission denied: '/var/log/hp/hpfax-pipe-29'

I did this:

  sudo chmod o+rwx /var/log/hp/

and, SUCCESS!!!!

Do you know what packages should be responsible for addressing the two issues (SELinux even when Permissive and permissions on /var/log/hp/) above?

Also, this is still a problem: https://bugs.launchpad.net/bugs/678263

Thanks!

SELinux is preventing /usr/bin/python2.7 from write access on the fifo_file hpfax-pipe-26.

***** Plugin catchall (100. confidence) suggests ***************************

If you believe that python2.7 should be allowed write access on the hpfax-pipe-26 fifo_file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep hpfax /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context system_u:system_r:hplip_t:s0-s0:c0.c1023
Target Context system_u:object_r:var_log_t:s0
Target Objects hpfax-pipe-26 [ fifo_file ]
Source hpfax
Source Path /usr/bin/python2.7
Port <Unknown>
Source RPM Packages python-2.7.3-6.fc17.i686
Target RPM Packages
Policy RPM selinux-policy-3.10.0-121.fc17.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive

Revision history for this message
Shai Berger (shai-platonix) wrote :

I've just encountered this exact issue, which is impressive four years later.

First, details: Debian stretch (currently testing), hplip 3.16.11; the device is HP OfficeJet 6950, handled for faxing as "HP Fax4 hpcups".

It was harder to debug, because the relevant error messages were no longer in the debug output of hp-sendfax; the only place I've seen them was the cups error log, where it said:

D [05/Jan/2017:23:50:52 +0200] [Job 105] Traceback (most recent call last):
D [05/Jan/2017:23:50:52 +0200] [Job 105] File \"/usr/lib/cups/backend/hpfax\", line 263, in <module>
D [05/Jan/2017:23:50:52 +0200] [Job 105] os.mkfifo(pipe_name)
D [05/Jan/2017:23:50:52 +0200] [Job 105] PermissionError: [Errno 13] Permission denied
D [05/Jan/2017:23:50:52 +0200] [Job 105] During handling of the above exception, another exception occurred:
D [05/Jan/2017:23:50:52 +0200] [Job 105] Traceback (most recent call last):
D [05/Jan/2017:23:50:52 +0200] [Job 105] File \"/usr/lib/cups/backend/hpfax\", line 265, in <module>
D [05/Jan/2017:23:50:52 +0200] [Job 105] os.unlink(pipe_name)
D [05/Jan/2017:23:50:52 +0200] [Job 105] FileNotFoundError: [Errno 2] No such file or directory: \'/home/shai/.hplip/hp_fax-pipe-105\'

So, the pipes are now in ~/.hplip/, and the code just assumes that if the folder exists, it can write to it. But it seems like some of the relevant dbus processes run under user "lp", which, by default, has no such permissions.

So, I was able to get hp-sendfax to work by "sudo chgrp lp ~/.hplip; chmod g+w ~/.hplip". I'm not sure if hpfax was the actual process running into the problem -- I attempted to add debug printings into it, and couldn't reproduce the logging. But changing the permissions to what I suspected would be necessary did solve things.

Revision history for this message
srikanth (srikanth-dumathy) wrote :

Hi
Request you to wait for next HPLIP release and share the below details if issue persists.
printer name
linux variant and version details
updated log.

Revision history for this message
Kevin Dalley (nereocystis) wrote :

I finally had success after deleting ~/.hplip, then running hp-sendfax, which creates this directory.

Then I followed above steps,
sudo chgrp lp ~/.hplip; chmod g+w ~/.hplip

deleted my HP printers, and reinstalled them, using hp-toolbox
Advanced options, type: All-in-one, MFP devices only

I'm not sure which steps were necessary, but the fax started working after this

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

Other bug subscribers

Bug attachments