Ubuntu

[Gutsy] : bluetooth printing was working but is not (at the beginning of september).

Reported by Id2ndR on 2007-10-01
10
Affects Status Importance Assigned to Milestone
apparmor (Ubuntu)
High
Martin Pitt
Gutsy
Undecided
Unassigned
cupsys (Ubuntu)
High
Martin Pitt
Gutsy
Undecided
Martin Pitt

Bug Description

I'm using Gutsy, and it's up-to-date.

Once month ago, I was able to print to my bluetooth HP printer, after added very easily this with new system-config-printer.
However, if the printer is OK, and the setup of system-config-printer too, it's not working anymore.

Logs from /var/log/cups/error_log :
E [01/Oct/2007:21:22:26 +0200] [Job 27] Can't open Bluetooth connection
E [01/Oct/2007:21:22:26 +0200] PID 21002 (/usr/lib/cups/backend/bluetooth) stopped with status 1!
E [01/Oct/2007:21:22:34 +0200] PID 21001 (/usr/lib/cups/filter/foomatic-rip) stopped with status 9!

Logs from dmesg :
[ 8360.320000] audit(1191267164.832:22): type=1503 operation="socket_create" family="bluetooth" sock_type="seqpacket" protocol=0 pid=21105 profile="/usr/sbin/cupsd"
[ 8360.596000] audit(1191267165.332:23): type=1503 operation="inode_permission" requested_mask="rw" denied_mask="rw" name="/dev/tty" pid=21111 profile="/usr/sbin/cupsd"
[ 8360.636000] audit(1191267165.332:24): type=1503 operation="inode_permission" requested_mask="rw" denied_mask="rw" name="/dev/tty" pid=21114 profile="/usr/sbin/cupsd"

I can see that my bluetooth stick *doesn't blink* asit usually did while sending a printing request.
But I can use the backend directly and see it blinking :
$ /usr/lib/cups/backend/bluetooth
network bluetooth://0005164004A2 "Unknown" "deskjet 995c S/N MY1581C042AP (Bluetooth)"

I don't know how to print the job directly, using the backend. So I can't tell you more.

TEST CASE:
 - Make sure bluez-cups is installed and enable a Bluetooth adapter.
 - Create a bogus bluetooth printer:
   lpadmin -p test -E -v bluetooth://00408C5E5DA4/spp -m lsb/usr/cups-pdf/PostscriptColor.ppd
 - try to print something:
   echo hello | lp -d test
 - dmesg will show that apparmor denied BT access:
   type=1503 operation="socket_create" family="bluetooth" sock_type="seqpacket" protocol=0 pid=15635 profile="/usr/sbin/cupsd"
 - Delete the test printer again:
   lpadmin -x test

Id2ndR (id2ndr) wrote :
Download full text (4.8 KiB)

Same problem if I use hp:/usb/deskjet_995c?serial=MY1581C042AP URI (detected automatically when I pluged USB cable).

Logs from dmesg (adding printer) :
[ 9016.640000] usb 3-1: new full speed USB device using uhci_hcd and address 5
[ 9016.856000] usb 3-1: configuration #1 chosen from 1 choice
[ 9017.452000] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x03F0 pid 0x5004
[ 9017.452000] usbcore: registered new interface driver usblp
[ 9017.452000] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver

Logs from /var/log/syslog :
Oct 1 21:43:42 Id2ndR-U200 kernel: [ 9017.452000] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Oct 1 21:43:42 Id2ndR-U200 NetworkManager: <debug> [1191267822.604751] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_3f0_5004_MY1581C042AP_usbraw').
Oct 1 21:43:42 Id2ndR-U200 hal_lpadmin: add
Oct 1 21:43:44 Id2ndR-U200 hal_lpadmin: URIs: ['hp:/usb/deskjet_995c?serial=MY1581C042AP', 'usb://HP/DESKJET%20995C?serial=MY1581C042AP', 'hal:///org/freedesktop/Hal/devices/usb_device_3f0_5004_MY1581C042AP_if0_printer_MY1581C042AP']
Oct 1 21:43:45 Id2ndR-U200 python: hp-probe[21214]: warning: No devices found on the 'usb' bus. If this isn't the result you are expecting,
Oct 1 21:43:45 Id2ndR-U200 python: hp-probe[21214]: warning: check to make sure your devices are properly connected and powered on.
Oct 1 21:43:45 Id2ndR-U200 hal_lpadmin: HPLIP Fax URIs: None
Oct 1 21:43:45 Id2ndR-U200 hal_lpadmin: Calling GetReady
Oct 1 21:43:56 Id2ndR-U200 hal_lpadmin: Device ID: MFG:HEWLETT-PACKARD;MDL:DESKJET 995C;DES:hewlett-packard deskjet 995c;CMD:MLC,PCL,PML,DW-PCL; URI:hp:/usb/deskjet_995c?serial=MY1581C042AP
Oct 1 21:43:56 Id2ndR-U200 hal_lpadmin: PPD: foomatic:HP-DeskJet_995C-hpijs.ppd; Status: 0
Oct 1 21:44:06 Id2ndR-U200 hal_lpadmin: Added printer DESKJET_995C
Oct 1 21:44:07 Id2ndR-U200 python: hp-probe[21249]: warning: No devices found on the 'usb' bus. If this isn't the result you are expecting,
Oct 1 21:44:07 Id2ndR-U200 python: hp-probe[21249]: warning: check to make sure your devices are properly connected and powered on.
Oct 1 21:44:07 Id2ndR-U200 NetworkManager: <debug> [1191267847.940116] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_3f0_5004_MY1581C042AP_if0_printer_MY1581C042AP').

New job send. Logs from /var/log/syslog :
Oct 1 21:44:55 Id2ndR-U200 deskjet_995c?serial=MY1581C042AP: io/hpmud/musb.c 549: invalid product id string: Operation not permitted
Oct 1 21:44:55 Id2ndR-U200 deskjet_995c?serial=MY1581C042AP: io/hpmud/musb.c 1003: unable to open hp:/usb/deskjet_995c?serial=MY1581C042AP
Oct 1 21:44:55 Id2ndR-U200 deskjet_995c?serial=MY1581C042AP: INFO: open device failed; will retry in 30 seconds...
Oct 1 21:44:55 Id2ndR-U200 kernel: [ 9090.244000] audit(1191267894.873:28): type=1503 operation="inode_permission" requested_mask="rw" denied_mask="rw" name="/dev/tty" pid=21269 profile="/usr/sbin/cupsd"
Oct 1 21:44:55...

Read more...

Id2ndR (id2ndr) wrote :

The result is bellow. If one part of the bug (hp:/ URI) is a duplicate of an other, I don't think bluetooth part is. So I'll change the status when hp:/ URI will be fixed, but bluetooth:// won't be.

$ hp-probe

HP Linux Imaging and Printing System (ver. 2.7.7)
Printer Discovery Utility ver. 3.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.

  Device URI Model
  ---------------------------------------- ---------------
  hp:/usb/deskjet_995c?serial=MY1581C042AP HP deskjet 995c

Till Kamppeter (till-kamppeter) wrote :

Please apply the fix presented in bug 147369. If this fixes the hp://... and not the Bluetooth problem, remove the duplicate state by clicking "Mark as duplicate" in the menu on the left and deleting the bug number.

Здравствуйте, Till.

Вы писали 3 октября 2007 г., 14:22:21:

Till Kamppeter> *** This bug is a duplicate of bug 147369 ***
Till Kamppeter> https://bugs.launchpad.net/bugs/147369

Till Kamppeter> Please apply the fix presented in bug 147369. If this fixes the hp://...
Till Kamppeter> and not the Bluetooth problem, remove the duplicate state by clicking
Till Kamppeter> "Mark as duplicate" in the menu on the left and deleting the bug number.

ЗАЕБАЛИ!!!!!!!!!!!!!!!!!!!!!!!!!!

--
С уважением,
 Eduard mailto:<email address hidden>

The updates fixes hp:/ URI (this part was a duplicate).

But there still is a problem with bluetooth :
E [04/Oct/2007:12:19:40 +0200] PID 26891 (/usr/lib/cups/backend/bluetooth) stopped with status 1!
E [04/Oct/2007:12:19:40 +0200] [Job 31] Can't open Bluetooth connection
E [04/Oct/2007:12:19:43 +0200] PID 26890 (/usr/lib/cups/filter/foomatic-rip) stopped with status 9!

This probably is an other udev rule to change.

TJ (tj) wrote :

I've got the same problem here. Bluetooth printing to HP Deskjet 995C was working fine earlier in the Gutsy release cycle but tonight I find it can't print and the reason appears to be related to the appamor configuration in /etc/appamor.d/usr.sbin.cupsd since disabling appamor (sudo /etc/init.d/appamor stop) allows the printing to go ahead.

/var/log/syslog
Oct 15 21:12:38 hephaestion kernel: [ 9906.153900] audit(1192479158.736:4): type=1503 operation="socket_create" family="bluetooth" sock_type="seqpacket" protocol=0 pid=8028 profile="/usr/sbin/cupsd"
Oct 15 21:12:39 hephaestion kernel: [ 9906.453894] audit(1192479159.032:5): type=1503 operation="inode_permission" requested_mask="rw" denied_mask="rw" name="/dev/tty" pid=8036 profile="/usr/sbin/cupsd"
Oct 15 21:12:39 hephaestion kernel: [ 9906.474310] audit(1192479159.060:6): type=1503 operation="inode_permission" requested_mask="rw" denied_mask="rw" name="/dev/tty" pid=8039 profile="/usr/sbin/cupsd"

/var/log/cups/error_log
E [15/Oct/2007:21:12:38 +0100] [Job 2] Can't open Bluetooth connection
E [15/Oct/2007:21:12:38 +0100] PID 8028 (/usr/lib/cups/backend/bluetooth) stopped with status 1!
E [15/Oct/2007:21:12:41 +0100] PID 8027 (/usr/lib/cups/filter/foomatic-rip) stopped with status 9!
E [15/Oct/2007:21:13:58 +0100] PID 8077 (/usr/lib/cups/backend/bluetooth) stopped with status 1!

/var/log/cups/access_log
localhost - - [15/Oct/2007:21:12:38 +0100] "POST /printers/Deskjet995C HTTP/1.1" 200 165041 Print-Job successful-ok
localhost - - [15/Oct/2007:21:12:38 +0100] "POST / HTTP/1.1" 200 176 Get-Jobs successful-ok
localhost - - [15/Oct/2007:21:12:38 +0100] "POST / HTTP/1.1" 200 176 Get-Jobs successful-ok

Changed in apparmor:
status: New → Confirmed
Till Kamppeter (till-kamppeter) wrote :

pitti, any chance to fix it in Gutsy? Otherwise we should have fixed it shortly after the Gutsy release (move milestone to "gutsy-updates" then).

Changed in system-config-printer:
assignee: nobody → pitti
importance: Undecided → High
milestone: none → ubuntu-7.10
status: New → Confirmed
Changed in apparmor:
assignee: nobody → pitti
importance: Undecided → High
milestone: none → ubuntu-7.10
TJ (tj) wrote :

I found a comment that seems strongly related to this in bug #139665 by Martin Pitt:

https://bugs.edge.launchpad.net/ubuntu/+source/cupsys/+bug/139665/comments/2

Which seems to suggest the issue isn't strictly appamor but cups trying to access /dev/tty inappropriately.

Steve Langasek (vorlon) wrote :

This bug seems to have landed on the milestone rather late, too late to be included in gutsy final. It looks like a good candidate for a post-release update; in the meantime I've added it to the release notes.

Id2ndR (id2ndr) wrote :

Is there activity about this bug ?

tmkt (daveminogue) wrote :

This also isn't working on my Epson Printer...R380
Here's my error logs when I try to print

E [06/Nov/2007:20:06:27 +0000] PID 30295 (/usr/lib/cups/backend/bluetooth) crashed on signal 6!
/usr/lib/cups/backend$ ./bluetooth
network bluetooth://0013105D4C1D "Unknown" "Stylus Photo R380-1 (Bluetooth)" "MFG:EPSON;CMD:ESCPL2,BDC,D4,D4PX,ESCPR1;MDL:Stylu s Photo R380;CLS:PRINTER;DES:EPSON Stylus Photo R380;

Martin Pitt (pitti) on 2007-11-28
Changed in cupsys:
milestone: gutsy-updates → ubuntu-8.04-beta
milestone: none → gutsy-updates
assignee: nobody → pitti
status: New → Confirmed
Martin Pitt (pitti) on 2007-11-28
description: updated
Martin Pitt (pitti) wrote :

Fixed in bzr head.

Changed in cupsys:
status: Confirmed → Fix Committed
Martin Pitt (pitti) wrote :

cupsys (1.3.4-1ubuntu3) hardy; urgency=low

  * debian/local/apparmor-profile:
    - Allow rw access to /dev/parport* and ro access to
      /proc/sys/dev/parport/**, so that parallel port printer detection works.
    - Allow unconfined execution of the bluetooth backend. AppArmor currently
      forbids creation of bluetooth sockets without providing a profile option
      to allow it (see bug #172534). (LP: #147800)
    - Permit reading /etc/pnm2ppa.conf. (LP: #155530)
    - Disable AA profile for Samsung's MFP driver, since it needs very high
      and unknown privileges and is a third-party driver which we cannot
      control. (LP: #152537)

 -- Martin Pitt <email address hidden> Wed, 28 Nov 2007 12:05:30 +0100

Changed in cupsys:
status: Fix Committed → Fix Released
Martin Pitt (pitti) wrote :

Not an apparmor bug (well, there is, but it's filed separately at bug #172534).

Changed in apparmor:
milestone: gutsy-updates → none
status: Confirmed → Invalid
status: New → Invalid
Martin Pitt (pitti) wrote :

This is the debdiff for hardy which fixes this bug, bug 155530, bug 152537 (all milestoned for gutsy-updates), and unbreaks parallel port printer detection. The changes are confined to loosening some ACLs in the AppArmor profile. Thus the regression potential is zero, the worst thing that can happen is that some bugs are still not fully fixed (but I tested all of them, and the switching to unconfined execution of the mfp and bluetooth backends will make all apparmor bugs for them go away).

Martin Pitt (pitti) on 2007-12-03
description: updated
Martin Pitt (pitti) wrote :

Updated debdiff which reverts the unconfined execution of the bluetooth backend, now that bug #172534 has a proper solution. It just allows creation of bluetooth network sockets now.

Martin Pitt (pitti) wrote :

Accepted into gutsy-proposed, please test:

 cupsys (1.3.2-1ubuntu7.2) gutsy-proposed; urgency=low
 .
   * debian/local/apparmor-profile:
     - Allow rw access to /dev/parport* and ro access to
       /proc/sys/dev/parport/**, so that parallel port printer detection works.
     - Allow bluetooth socket creation to unbreak the bluetooth backend.
       (LP: #147800)
     - Permit reading /etc/pnm2ppa.conf. (LP: #155530)
     - Only restrict backends which are shipped by cupsys itself (or known
       packages like cups-pdf). All other backends remain unrestricted, since we
       cannot predict which privileges they need. (LP: #152537)

Changed in cupsys:
status: Confirmed → Fix Committed
Martin Pitt (pitti) wrote :

A lot of people got this problem apparently. Can anyone please give this some testing and give some feedback here? Without this, it cannot be moved to -updates.

pitti asked me for testing the -proposed package with my Bluetooth printer (HP PhotoSmart A710 with Bluetooth plug in its USB memory/camera port).

As I do not have Gutsy, I have tried with Hardy but with the Gutsy kernel booted (2.6.22), as the Hardy kernel (2.6.24) has no AppArmor support compiled in.

Unfortunately, AppArmor does not work with this configuration. It seems that the AppArmor profile format has changed in an incompatible way. On restart of AppArmor I get something like

Profile /etc/apparmor.d/usr.sbin.ntpd failed to load
/sbin/apparmor_parser: Unable to replace "/usr/sbin/smbd". Profile doesn't conform to protocol

on nearly every profile.

I get

till@till-laptop:~/ubuntu/cupsys/proposed$ sudo aa-status cupsdapparmor module is loaded.
0 profiles are loaded.
0 profiles are in enforce mode.
0 profiles are in complain mode.
0 processes have profiles defined.
0 processes are in enforce mode :
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
till@till-laptop:~/ubuntu/cupsys/proposed$

which shows that the cupsd profile did not get accepted, too.

So in my environment I cannot test, and AppArmor needs to be sorted out that it works on Hardy.

Scott Kitterman (kitterman) wrote :

Using an up to date Gutsy Kubuntu install with bluetooth enabled, I ran the test case with the released packages and replicated the output shown in the test case. After installing the cupsys from gutsy-proposed, I got the following:

Jan 15 20:53:06 KTS-D430 NetworkManager: <debug> [1200448386.006952] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_413c_8140_noserial_if0_bluetooth_hci_bluetooth_hci').
Jan 15 20:53:26 KTS-D430 NetworkManager: <debug> [1200448406.495591] nm_hal_device_removed(): Device removed (hal udi is '/org/freedesktop/

I gather that means it worked.

Martin Pitt (pitti) wrote :

Copied to gutsy-updates.

Changed in cupsys:
status: Fix Committed → Fix Released
DaveFM (dave-minogue) wrote :

I wouldn't say this is fixed.

I still get the same results when trying to print using Bluetooth.

E [19/Jun/2008:09:48:21 -0400] PID 26725 (/usr/lib/cups/backend/bluetooth) crashed on signal 6!

ii cupsys 1.3.7-1ubuntu3 Common UNIX Printing System(tm) - server
ii cupsys-bsd 1.3.7-1ubuntu3 Common UNIX Printing System(tm) - BSD commands
ii cupsys-client 1.3.7-1ubuntu3 Common UNIX Printing System(tm) - client programs (Sys
ii cupsys-common 1.3.7-1ubuntu3 Common UNIX Printing System(tm) - common files
ii bluez-cups 3.26-0ubuntu6

Scott Kitterman (kitterman) wrote :

Different bug. Please file another one.

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

Other bug subscribers