Bug 505647 - HP USB printers not working after reboot
Summary: HP USB printers not working after reboot
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 11
Hardware: x86_64
OS: Linux
low
high
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 446678 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-12 18:21 UTC by Bryan Christ
Modified: 2009-11-26 22:00 UTC (History)
5 users (show)

Fixed In Version: 1.4-0.rc1.15.fc11
Clone Of:
Environment:
Last Closed: 2009-08-15 08:27:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
a picture to illustrate the problem (521.70 KB, image/png)
2009-06-12 18:24 UTC, Bryan Christ
no flags Details
Troubleshoot output (79.75 KB, text/plain)
2009-06-25 17:45 UTC, Bryan Christ
no flags Details
screenshot of results from second test attempt (572.91 KB, image/png)
2009-06-25 17:46 UTC, Bryan Christ
no flags Details

Description Bryan Christ 2009-06-12 18:21:57 UTC
Description of problem:

After plugging in a USB printer and then rebooting, the printer will not work.  Although it shows up the Document Print Status and the Printer Configuration wizard, attempting to print will cause an error message "Not connected?".  The only way to remedy the problem is to unplug the USB cable and then plug it back in.

This is a new problem for Fedora 11.  It did not happen in Fedora 10.

I have confirmed this with two HP PSC printers on two different desktop systems.  Both systems have the latest F11 updates fetched via yum.  One system is x86-64 and the other is i386.

Version-Release number of selected component (if applicable):

hal-cups-utils-0.6.19-2.fc11.x86_64
cups-libs-1.4-0.b2.18.fc11.x86_64
cups-1.4-0.b2.18.fc11.x86_64
libgnomecups-0.2.3-5.fc11.x86_64
hpijs-3.9.2-4.fc11.x86_64

How reproducible:  100%


Steps to Reproduce:
1.  Plug in a USB printer and see that it works.
2.  Reboot.
3.  Notice that the device is allegedly still installed.
4.  Try to print.
  
Actual results:  Error message

Comment 1 Bryan Christ 2009-06-12 18:24:10 UTC
Created attachment 347642 [details]
a picture to illustrate the problem

Comment 2 Tim Waugh 2009-06-24 10:07:35 UTC
Please update to the most recent system-config-printer test update:

yum --enablerepo=updates-testing update 'system-config-printer*'

Then, please follow the 'steps to reproduce', but before step 4 run the printing troubleshooter: System->Administration->Printing, then Help->Troubleshoot.  Follow the on-screen instructions and when it asks you to print a test page, print as normal.

Please attach the resulting troubleshoot.txt file to this bug report. (Please confirm that you got the 'Not connected?' pop-up for that print run.)

Comment 3 Bryan Christ 2009-06-25 17:45:26 UTC
Apparently I must have the latest system-config-printer because there wasn't a new package in either updates or updates-testing.

Here is the information I requested.  I did get the Not Connected pop-up again.  Attaching another picture.

Comment 4 Bryan Christ 2009-06-25 17:45:51 UTC
Created attachment 349434 [details]
Troubleshoot output

Comment 5 Bryan Christ 2009-06-25 17:46:30 UTC
Created attachment 349435 [details]
screenshot of results from second test attempt

Comment 6 Tim Waugh 2009-06-26 08:26:19 UTC
Thanks, that troubleshoot.txt file contains useful information.

Next, I'd like you to unplug the USB lead connecting the printer to the computer, then reconnect it.  After than, please run this command and show me the output:

getfacl /dev/bus/usb/007/002

(check that lsusb has this line:

Bus 007 Device 002: ID 03f0:2f11 Hewlett-Packard PSC 1200

and adjust the '007/002' accordingly if it is a different bus/device number).

Thanks.

Comment 7 Bryan Christ 2009-06-26 16:28:44 UTC
Tim,

I just retested this issue with the latest cups from updates-testing that was apparently released in the last 24 hours and the issue appears to be resolved.

cups-1.4-0.rc1.4.fc11.x86_64
cups-libs-1.4-0.rc1.4.fc11.x86_64

Bryan

Comment 8 Tim Waugh 2009-06-26 16:39:41 UTC
Really?  I'd be quite surprised by that.  As far as I can tell, the cause of the problem is that the 'lp' group is not granted access to the USB device node (i.e. /dev/bus/usb/.../...) at boot.  CUPS doesn't have any input in that: it's all down the hal, udev, and hal-cups-utils.

Comment 9 Bryan Christ 2009-06-26 16:51:30 UTC
Looks like I called it too early.  I rebooted a second time and it did not work.  Strange that it worked that one time because I never did the unplug/plug thing.  I will test as requested in comment #6.

Comment 10 Bryan Christ 2009-06-26 16:53:44 UTC
getfacl: Removing leading '/' from absolute path names
# file: dev/bus/usb/007/003
# owner: root
# group: root
user::rw-
user:bchrist:rw-
group::rw-
group:lp:rw-
mask::rw-
other::r--

Comment 11 Tim Waugh 2009-06-29 12:26:15 UTC
Thanks.  For some reason the 'lp' group ACL is not getting added to the device at boot time.  Will investigate.

Comment 12 Bryan Christ 2009-07-01 19:47:00 UTC
Tim,

I see that there are new hpijs and system-config-printer packages in "updates-testing".  Would this be a fix?

Comment 13 Tim Waugh 2009-07-01 21:23:48 UTC
No.  I haven't gotten to hal-cups-utils yet.  Please be patient and I will get to it as soon as I can.

Comment 14 Richard Shaw 2009-07-03 21:23:44 UTC
Just wanted to add a "me too" with a HP Photosmart C5580. Already tried installing system-config-printer anf hplip from updates-testing.

Comment 15 Bryan Christ 2009-07-31 17:32:17 UTC
Tim,

Any update?  Is this still on your radar?

Comment 16 Tim Waugh 2009-07-31 20:22:58 UTC
I am dealing with a great many bug reports; please be patient.  Since my last comment I have been making sure that this problem will not affect Fedora 12 by re-implementing the system cleanly on top of udev.

Please do not assume that I have forgotten about this bug.

Comment 17 Tim Waugh 2009-08-04 16:55:30 UTC
So far I've discovered that the problem did not occur with the as-shipped kernel but does with the update.

GOOD: kernel-2.6.29.4-167.fc11
BAD:  kernel-2.6.29.6-213.fc11

Next I'll have to try to figure out which one broke it and what the change was.  Any help appreciated...

Comment 18 Richard Shaw 2009-08-04 17:11:18 UTC
I don't know if this helps or not, but it looks like a USB problem to me because of a tangentially related problem I have with my USB mouse. With the "as shipped" kernel I didn't have any issues, but after the first kernel update my USB mouse is not detected on boot and I have to unplug and replug it in. 

Looking at lsusb from the console in the case of my mouse it is completely not detected before I 'replug' but the printer is so my mouse problem may have nothing to do with this bug but figured it is worth mentioning.

Comment 19 Bryan Christ 2009-08-04 17:18:24 UTC
It certainly sounds similar.

Comment 20 Tim Waugh 2009-08-05 10:05:48 UTC
Grr, I can't get it to go wrong with 2.6.29.6-213.fc11 any more. :-(

Comment 21 Tim Waugh 2009-08-05 11:52:12 UTC
F-11 all updates applied, and I can't get it to go wrong again.  Not sure where to go from here other than trying to back-port the newer udev-based solution to Fedora 11.

Comment 22 Richard Shaw 2009-08-05 13:10:13 UTC
I need to double check since the last kernel update but if I'm still having the problem (I know I'm still having the mouse usb problem) I'll do what I can to provide any info you want. Just let me know what logs/info you need.

Comment 23 Tim Waugh 2009-08-05 13:20:19 UTC
I can only think that it's some other udev or hal rule that is causing problems.

So what does this say?:

ls -1 /etc/udev/rules.d /usr/share/hal/fdi/policy/10osvendor

Comment 24 Richard Shaw 2009-08-05 13:32:29 UTC
/etc/udev/rules.d:
10-vboxdrv.rules
40-multipath.rules
60-libmtp.rules
60-pcmcia.rules
60-wacom.rules
70-persistent-cd.rules
70-persistent-net.rules
85-pcscd_ccid.rules
85-pcscd_egate.rules
90-alsa.rules
90-hal.rules
91-drm-modeset.rules
97-bluetooth-serial.rules
98-devkit.rules
99-fuse.rules

/usr/share/hal/fdi/policy/10osvendor:
05-olpc-detect.fdi
10-cpufreq.fdi
10-dockstation.fdi
10-hal_lpadmin.fdi
10-hplip.fdi
10-ibm-buttons.fdi
10-imac-backlight.fdi
10-input-policy.fdi
10-keymap.fdi
10-laptop-panel-mgmt-policy.fdi
10-leds.fdi
10-macbook-backlight.fdi
10-macbookpro-utils.fdi
10-power-mgmt-policy.fdi
10-rfkill-switch.fdi
10-tabletPCs.fdi
10-usbcsr-mice.fdi
10-x11-input.fdi
10-x11-keymap.fdi
15-storage-luks.fdi
20-acl-management.fdi
20-ntfs-config-write-policy.fdi
20-storage-methods.fdi
30-wol.fdi

Comment 25 Tim Waugh 2009-08-06 14:41:50 UTC
Had a brainwave about this issue.

There are currently test updates for cups and for hplip.  I just built new packages for both of them, and they have not yet been re-pushed.  Here are the links to them:

https://admin.fedoraproject.org/updates/F11/FEDORA-2009-8133
https://admin.fedoraproject.org/updates/F11/FEDORA-2009-6959

The packages are cups-1.4-0.rc1.14.fc11 and hplip-3.9.8-2.fc11.

Can anyone confirm whether installing both of these updates together fixes the problem?

Comment 26 Richard Shaw 2009-08-06 15:41:04 UTC
I got them (and their dependencies) installed remotely but will have to wait till I get home from work to reboot and see if it fixes it.

Comment 27 Tim Waugh 2009-08-06 15:48:39 UTC
*** Bug 446678 has been marked as a duplicate of this bug. ***

Comment 28 Alexey Kuznetsov 2009-08-06 16:28:42 UTC
confirm its fixed reboot problem

Comment 29 Bryan Christ 2009-08-06 16:35:45 UTC
seems to work for me too.

Comment 30 Richard Shaw 2009-08-07 11:51:28 UTC
Yes, the printer did work after a reboot but I got an AVC Denial, details below:


Summary:

SELinux is preventing python (hplip_t) "read" var_lib_t.

Detailed Description:

SELinux denied access requested by python. It is not expected that this access
is required by python and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                system_u:system_r:hplip_t:s0
Target Context                system_u:object_r:var_lib_t:s0
Target Objects                /var/lib/hp/hplip.state [ file ]
Source                        python
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          hobbes.localdomain
Source RPM Packages           python-2.6-9.fc11
Target RPM Packages           hplip-3.9.8-2.fc11
Policy RPM                    selinux-policy-3.6.12-69.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     hobbes.localdomain
Platform                      Linux hobbes.localdomain
                              2.6.29.6-217.2.3.fc11.x86_64 #1 SMP Wed Jul 29
                              16:02:42 EDT 2009 x86_64 x86_64
Alert Count                   7
First Seen                    Fri 07 Aug 2009 06:45:33 AM CDT
Last Seen                     Fri 07 Aug 2009 06:49:01 AM CDT
Local ID                      6778f7ac-5d16-4caa-94b4-a84372f2f2f9
Line Numbers                  

Raw Audit Messages            

node=hobbes.localdomain type=AVC msg=audit(1249645741.51:36): avc:  denied  { read } for  pid=2864 comm="python" name="hplip.state" dev=dm-0 ino=55892 scontext=system_u:system_r:hplip_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file

node=hobbes.localdomain type=SYSCALL msg=audit(1249645741.51:36): arch=c000003e syscall=2 success=no exit=-13 a0=1bc5700 a1=0 a2=1b6 a3=238 items=0 ppid=2851 pid=2864 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="python" exe="/usr/bin/python" subj=system_u:system_r:hplip_t:s0 key=(null)

Comment 31 Tim Waugh 2009-08-07 12:46:44 UTC
Yes, that's being tracked in bug #516078.

Comment 32 Tim Waugh 2009-08-10 12:11:33 UTC
So, the problem was:

hplip's fdi policy was trying to do too much, both set the console user's ACL *and* the lp group ACL on the device node.  This doesn't seem to be the way hal-acl-tool is expected to be used.  I've removed the 'grant_group' line from the policy.

To grant the lp group the rw ACL we now do this via a udev rule shipped as part of CUPS.  This is done for all printer devices, as it would be required if we enabled libusb support in the CUPS usb backend anyway.

Comment 33 Fedora Update System 2009-08-11 22:40:21 UTC
cups-1.4-0.rc1.15.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8133

Comment 34 Fedora Update System 2009-08-15 08:26:14 UTC
cups-1.4-0.rc1.15.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 35 Richard Shaw 2009-08-21 03:57:32 UTC
The only problem I've run into is a regression where even though I've setup a separate queue to use my dvd/cd printing tray it now has reverted to the default tray. I tried to find the bug in my gmail but didn't have any luck. I remember in that situation I had to update to a package out of updates-testing or koji to get it fixed. Not sure why whatever was fixed in that package no longer works. 

Not sure if it helps but my yum log shows the following:

$ sudo grep cups /var/log/yum.log 
Jun 11 20:30:27 Installed: 1:cups-libs-1.4-0.b2.18.fc11.i586
Jun 11 20:58:06 Updated: bluez-cups-4.37-2.fc11.x86_64
Jul 02 07:06:09 Updated: libgnomecups-0.2.3-6.fc11.x86_64
Jul 23 21:54:49 Updated: 1:cups-libs-1.4-0.rc1.10.fc11.x86_64
Jul 23 21:57:19 Updated: 1:cups-libs-1.4-0.rc1.10.fc11.i586
Jul 23 22:01:20 Updated: 1:cups-1.4-0.rc1.10.fc11.x86_64
Jul 29 21:45:19 Updated: bluez-cups-4.42-1.fc11.x86_64
Aug 06 10:38:25 Updated: 1:cups-libs-1.4-0.rc1.14.fc11.x86_64
Aug 06 10:38:31 Updated: 1:cups-1.4-0.rc1.14.fc11.x86_64
Aug 06 10:38:34 Updated: 1:cups-libs-1.4-0.rc1.14.fc11.i586
Aug 11 20:36:30 Updated: bluez-cups-4.42-3.fc11.x86_64
Aug 16 06:48:21 Updated: 1:cups-libs-1.4-0.rc1.15.fc11.x86_64
Aug 16 06:48:36 Updated: 1:cups-libs-1.4-0.rc1.15.fc11.i586
Aug 16 06:48:46 Updated: 1:cups-1.4-0.rc1.15.fc11.x86_64

Comment 36 Tim Waugh 2009-08-21 08:23:28 UTC
Richard: sounds like you are talking about bug #495672.

Comment 37 Richard Shaw 2009-08-21 13:10:48 UTC
Yup, but why would an update to CUPS revert a bug that was fixed in hplip/hpijs?


Note You need to log in before you can comment on or make changes to this bug.