I ran into the same issue when trying to implement the example from https://docs.ubuntu.com/core/en/stacks/location/location-service/docs/obtain-location
I have defined the plugs
plugs: [ location-observe ]
And then try the prime
snap try prime --jailmode
snap connect location-dbus:location-observe locationd:service-observe
The following error:
ERROR:dbus.proxies:Introspect error on :1.184:/com/ubuntu/location/Service: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.238" (uid=0 pid=18915 comm="python3 -m location_dbus.location " label="snap.location-dbus.location (complain)") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.184" (uid=0 pid=23503 comm="/snap/locationd/163/bin/locationd run --bus=system" label="snap.locationd.run (enforce)")
Traceback (most recent call last):
File "/snap/location-dbus/x12/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/snap/location-dbus/x12/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/shaned24/code/location_dbus/location_dbus/location.py", line 17, in <module>
session_path = service.CreateSessionForCriteria(requirements)
File "/snap/location-dbus/x12/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/snap/location-dbus/x12/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/snap/location-dbus/x12/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.InvalidArgs: Type of message, '(a{sb})', does not match expected type '(a{sv})'
Further information:
Unfortunately there is no core interface slot called “location-observe” I can only connect my location-observe plug to locationd:service-observe
Debugging with snappy debug shows:
= AppArmor =
Time: Dec 11 01:58:15
Log: apparmor="DENIED" operation="dbus_method_call" bus="system" path="/com/ubuntu/location/Service" interface="org.freedesktop.DBus.Introspectable" member="Introspect" name=":1.238" mask="receive" pid=23503 label="snap.locationd.run" peer_pid=18915 peer_label="snap.location-dbus.location"
DBus access
Suggestion:
* try adding 'location-observe' to 'plugs'
My interfaces:
snap interfaces | grep location
:network locationd
:network-manager locationd
locationd:service-control location-dbus:location-control,locationd:client-control
locationd:service-observe location-dbus:location-observe,locationd:client-observe
- locationd:ubx
- locationd:wpa