I was snapping my application which is written in qt5 and uses libappindicator to provide system tray icon with some functionalities.

After Creating snap and running my app, it ends up with the following error message in terminal window :

 libappindicator-WARNING **: Unable to connect to the Notification     
 Watcher: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An 
 AppArmor policy prevents this sender from sending this message to  
 this recipient; type="method_call", sender=":1.153" (uid=1000 
 pid=19705 comm="deskie-snap ") 
 interface="org.kde.StatusNotifierWatcher" 
 member="RegisterStatusNotifierItem" error name="(unset)" 
 requested_reply="0" destination=":1.53" (uid=1000 pid=3134 
 comm="/usr/lib/x86_64-linux-gnu/indicator-application/in")

I also used unity7 interface which is think handle the connectivity of libappindicator to system's Bus.

My snapcraft.yaml file look like this:

Pastebin Link

Help please.

share|improve this question
    
Indeed it seems the unity7 interface should cover this. If you install the snappy-debug snap and run sudo snappy-debug.security scanlog and then run your app, does snappy-debug say anything helpful? – Kyle Dec 5 '16 at 19:08
    
nothing showing in scanlog @Kyle – ktechpit.org Dec 5 '16 at 19:33
    
sudo snappy-debug.security scanlog [sudo] password for bull: kernel.printk_ratelimit = 0 = AppArmor = Time: Dec 6 01:14:26 Log: apparmor="DENIED" operation="open" profile="snap.deskie-snap.deskie-snap" name="/usr/share/glib-2.0/schemas/" pid=4471 comm="desktop-launch" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0 File: /usr/share/glib-2.0/schemas/ (read) Suggestion: * adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON i got this after reinstalling and rerunning scanlog – ktechpit.org Dec 5 '16 at 19:45

Please, check this mailing list post.

You need snapd that includes this commit that is included in snapd 2.18, if you're still in snapd 2.17 or lower, you can workaround it with:

wget -qO- https://github.com/jdstrand/snapd/commit/95768199111.patch | \
  sudo patch \
 /var/lib/snapd/apparmor/profiles/snap.<your-snap>.<your-command>

sudo apparmor_parser -r \
 /var/lib/snapd/apparmor/profiles/snap.<your-snap>.<your-command>

You also might need to include indicator-gtk2 (or 3) remote part to take care of the $SNAP prefix, but this might be optional if you build things with snap ind mind.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.