Akira is a GTK design program made for elementary OS. I submitted a snapcraft.yaml and it’s currently published in the edge channel. This thread is sparked by an issue filed upstream.
We have a strictly confined snap which behaves surprisingly differently across a number of computers. When saving work, on my Ubuntu 20.04 system, the file dialog appears. On @Wimpress 20.04 system it does not. Same build of the application, snapd, kernel, apparmor, gnome-platform snap. It also fails on an elementary machine. Here’s the errors you get when trying to save your work
alan@deep-thought:~/Akira$ akira
Gtk-Message: 16:19:52.102: Failed to load module "pantheon-filechooser-module"
(Akira:22783): Gtk-WARNING **: 16:19:59.939: Can't open portal file chooser: 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.396" (uid=1000 pid=22783 comm="/snap/akira/x4/usr/bin/com.github.akiraux.akira " label="snap.akira.akira (enforce)") interface="org.freedesktop.portal.FileChooser" member="SaveFile" error name="(unset)" requested_reply="0" destination="org.freedesktop.portal.Desktop" (bus)
Here’s the apparmor issues:
$ snappy-debug.security scanlog
INFO: Following '/var/log/syslog'. If have dropped messages, use:
INFO: $ sudo journalctl --output=short --follow --all | sudo snappy-debug
sysctl: permission denied on key 'kernel.printk_ratelimit'
= AppArmor =
Time: Apr 15 16:21:13
Log: apparmor="DENIED" operation="open" profile="snap.akira.akira" name="/run/mount/utab" pid=22977 comm="com.github.akir" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /run/mount/utab (read)
Suggestions:
* adjust program to use $SNAP_DATA
* adjust program to use /run/shm/snap.$SNAP_NAME.*
* adjust program to use /run/snap.$SNAP_NAME.*
* adjust snap to use snap layouts (https://forum.snapcraft.io/t/snap-layouts/7207)
= AppArmor =
Time: Apr 15 16:21:13
Log: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/freedesktop/portal/desktop" interface="org.freedesktop.portal.FileChooser" member="SaveFile" mask="send" name="org.freedesktop.portal.Desktop" pid=22977 label="snap.akira.akira"
DBus access
= AppArmor =
Time: Apr 15 16:21:13
Log: apparmor="DENIED" operation="open" profile="snap.akira.akira" name="/run/mount/utab" pid=22977 comm="com.github.akir" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /run/mount/utab (read)
Suggestions:
* adjust program to use $SNAP_DATA
* adjust program to use /run/shm/snap.$SNAP_NAME.*
* adjust program to use /run/snap.$SNAP_NAME.*
* adjust snap to use snap layouts (https://forum.snapcraft.io/t/snap-layouts/7207)
Things we have tried: Adding the home
interface, adding and connecting removable-media
and mount-observe
, rebooting, re-installing, staging libpantheon-filechooser-module.so
from the elementary pantheon-files package:
pantheon-files:
after: [elementary-sdk]
plugin: nil
stage-packages:
- pantheon-files
prime:
- usr/lib/*/gtk-3.0/modules/libpantheon-filechooser-module.so
&
apps:
akira:
environment:
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-3.0/modules/:$LD_LIBRARY_PATH
...
None of this worked.
Why does this behave differently on two seemingly identical installs? Why does it fail at all?
Steps to reproduce:
snap install akira --edge
snap run akira
- Press a, draw a rectangle
- Press CTRL+S to save
Sounds like an apparmor / portal / launcher issue, so tagging @jamesh and @jdstrand speculatively