Bug 465307

Summary: Snap AppArmor profile prohibits menu
Product: [Applications] krita Reporter: stephematician <stephematician>
Component: GeneralAssignee: Scarlett Moore <sgmoore>
Status: RESOLVED FIXED    
Severity: normal CC: amy, halla, jr, sgmoore
Priority: NOR    
Version: 5.1.1   
Target Milestone: ---   
Platform: Snap   
OS: Linux   
Latest Commit: Version Fixed In: 5.1.5
Sentry Crash Report:

Description stephematician@gmail.com 2023-02-05 07:40:44 UTC
SUMMARY:

Menubar does not display.


STEPS TO REPRODUCE:

1. Open terminal
2. Install via snap (e.g. `snap install krita`) 
3. Run krita (`krita`)


OBSERVED RESULT:

No menubar, terminal output:

< start of terminal output >
    Qt: Session management error: Could not open network socket
    /usr/share/libdrm/amdgpu.ids: No such file or directory
    Qt: Session management error: Could not open network socket
    /usr/share/libdrm/amdgpu.ids: No such file or directory
    Qt: Session management error: Could not open network socket
    /usr/share/libdrm/amdgpu.ids: No such file or directory
    /usr/share/libdrm/amdgpu.ids: No such file or directory
    Qt: Session management error: Could not open network socket
    propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.486\" (uid=1000 pid=27012 comm=\"/snap/krita/77/usr/bin/krita \" label=\"snap.krita.krita (enforce)\") interface=\"org.freedesktop.DBus.Properties\" member=\"GetAll\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=1096 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
    nmReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.486\" (uid=1000 pid=27012 comm=\"/snap/krita/77/usr/bin/krita \" label=\"snap.krita.krita (enforce)\") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=1096 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
    "Object path cannot be empty"
    QObject::startTimer: Timers cannot have negative intervals
    Failed to register window menu, reason: org.freedesktop.DBus.Error.AccessDenied ("An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.188" (uid=1000 pid=27012 comm="/snap/krita/77/usr/bin/krita " label="snap.krita.krita (enforce)") interface="com.canonical.AppMenu.Registrar" member="RegisterWindow" error name="(unset)" requested_reply="0" destination="com.canonical.AppMenu.Registrar" (uid=1000 pid=19505 comm="/usr/libexec/vala-panel/appmenu-registrar " label="unconfined")")
    Failed to unregister window menu, reason: org.freedesktop.DBus.Error.AccessDenied ("An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.188" (uid=1000 pid=27012 comm="/snap/krita/77/usr/bin/krita " label="snap.krita.krita (enforce)") interface="com.canonical.AppMenu.Registrar" member="UnregisterWindow" error name="(unset)" requested_reply="0" destination="com.canonical.AppMenu.Registrar" (uid=1000 pid=19505 comm="/usr/libexec/vala-panel/appmenu-registrar " label="unconfined")")
    Failed to register window menu, reason: org.freedesktop.DBus.Error.AccessDenied ("An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.188" (uid=1000 pid=27012 comm="/snap/krita/77/usr/bin/krita " label="snap.krita.krita (enforce)") interface="com.canonical.AppMenu.Registrar" member="RegisterWindow" error name="(unset)" requested_reply="0" destination="com.canonical.AppMenu.Registrar" (uid=1000 pid=19505 comm="/usr/libexec/vala-panel/appmenu-registrar " label="unconfined")")
    Failed to unregister window menu, reason: org.freedesktop.DBus.Error.AccessDenied ("An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.188" (uid=1000 pid=27012 comm="/snap/krita/77/usr/bin/krita " label="snap.krita.krita (enforce)") interface="com.canonical.AppMenu.Registrar" member="UnregisterWindow" error name="(unset)" requested_reply="0" destination="com.canonical.AppMenu.Registrar" (uid=1000 pid=19505 comm="/usr/libexec/vala-panel/appmenu-registrar " label="unconfined")")
< end of terminal output >


EXPECTED RESULT

Menubar, no errors in terminal.


SOFTWARE/OS VERSIONS

Linux, ubuntu MATE 22.04, OEM kernel 6.1.0 (uname -r: 6.1.0-1004-oem)
Snap version: 2.58


ADDITIONAL INFORMATION

AppArmor profile is loaded.

    apparmor_status
    apparmor module is loaded.
    55 profiles are loaded.
    47 profiles are in enforce mode.
    ...
       snap-update-ns.krita
    ...
       snap.krita.hook.configure
       snap.krita.krita
    ...
    8 profiles are in complain mode.
    ...
    0 profiles are in kill mode.
    0 profiles are in unconfined mode.
    25 processes have profiles defined.
    25 processes are in enforce mode.
    ...
       /snap/krita/77/usr/bin/krita (28094) snap.krita.krita
    ...
    0 processes are in complain mode.
    0 processes are unconfined but have a profile defined.
    0 processes are in mixed mode.
    0 processes are in kill mode.
Comment 1 Halla Rempt 2023-02-05 11:57:23 UTC
What do you mean with "prohibits menu"?
Comment 2 stephematician@gmail.com 2023-02-05 12:04:47 UTC
The menubar does not appear. E.g "File, Edit, ..." etc at the top of the window.
Comment 3 Bug Janitor Service 2023-02-07 03:55:58 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 4 amyspark 2023-02-07 12:19:10 UTC
The security profile for the Snap doesn't allow to talk to DBus at all, hence why (among other things) there's no menu.

In any case, Halla, do we actually support Snaps? I've not seen official updates to it nor to Flatpak since at least v5.
Comment 5 Halla Rempt 2023-02-09 12:37:23 UTC
We don't maintain flatpaks, and the volunteer who made the snap stopped responding to requests to update, so maybe I had better remove it from source and remove the snap page we (used to) maintain. The only official binaries we support are the appimages.
Comment 6 Jonathan Riddell 2023-04-04 16:18:25 UTC
That's presumably with the external menubar panel and I can recreate that it doesn't work.  other snaps I have work fine with it such as kblocks so I'm not sure what the issue is but it ought to be fixable.
Comment 7 Scarlett Moore 2023-04-06 17:35:10 UTC
I am officially supporting this snap now. I have fixed the dbus issue mentioned in comments and the apparmor issue originally reported fix has been pushed and will be fixed after build.
Will close when confirmed via testing.
Cheers
Scarlett
Comment 8 Scarlett Moore 2023-04-07 13:47:20 UTC
Both issues are now fixed. Please install the latest version in the snap store ( 5.1.5 )
Cheers,
Scarlett