Thursday 1 January 2009

Fixing Bluetooth and PackageKit problems in Fedora 10

I began to suspect that something was wrong with the D-BUS permissions on my Fedora 10 system when I started getting the following error at the end of a Yum session:
ERROR:dbus.proxies:Introspect error on :1.46:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.DBus.Introspectable" member "Introspect" error name "(unset)" destination ":1.46")

This seemed to have affected the Bluetooth daemon as well. No matter how I tried, I could not get bluetooth-properties to remember my preferences. My computer was not visible to other Bluetooth enabled devices and I could not browse my phone via Bluetooth. (It used to work flawlessly in Fedora 9). I diagnosed that the problem is with D-Bus by running the following command:
sudo bluetoothd -n -d
bluetoothd always terminated with the error:
Unable to get on D-BUS

I tried mucking around with D-Bus policy settings in /etc/dbus-1/system.d/ but had no luck until I came across this helpful post at FedoraForums.

After editing /etc/dbus-1/system.conf as mentioned, I restarted the computer and voila ! Bluetooth started working and yum stopped complaining !!

For completeness, this is the interesting bit from my new /etc/dbus-1/system.conf
<!-- allow sending valid replies -->
<!-- commented out part
<allow send_requested_reply="true" send_type="method_return"/>
<allow send_requested_reply="true" send_type="error"/>
-->
<!-- Newly added line to fix permission problems -->
<allow send_requested_reply="true" />


Kudos to all the helpful people at Fedora Forums !

3 comments:

buho said...

I follow your post and my dbus system.conf have the added line and don't have the ones to be connected, still if I do a bluetoothd -n -d I get the infamous Unable to get on D-Bus and of curse my bluetooth device are not paired, any other idea solution?

I'm using fedora 10...

thanks

Mauricio

JanuZ said...

Did you restart the computer after changing the policy file ?

It could also be due to SELinux. Try again after setting SELinux to the permissive mode.

If it still doesn't solve your problem, then I am afraid a new kernel update must have broken something else. I have no way to test it now because my laptop is at the repair shop.

Good luck !

Alan said...

I think the problem is larger than PackageKit. I am pretty sure it affects any utility which is using pybluez (dbus, bluetooth, and python).

I had to make these same changes to my Debian Lenny 5.0 system in order to get several mobile phone remote control applications working (remuco and lbrc).

Thanks for the tip!

Alan