Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policies missing on AppArmor profile for Ubuntu (snap install) #3760

Open
darcosion opened this issue Dec 15, 2024 · 7 comments
Open

Policies missing on AppArmor profile for Ubuntu (snap install) #3760

darcosion opened this issue Dec 15, 2024 · 7 comments

Comments

@darcosion
Copy link

Your Environment

  • Version used: 10.2.3
  • Operating System and version: Ubuntu 24.04
  • Desktop Environment: Cinnamon

Expected Behavior

The sync folder should work properly

Current Behavior

Sync mecanism crash because of AppArmor policy

Steps to Reproduce (for bugs)

This error happen when I try to install superproductivity on my Ubuntu, so for reproducing, I think you should just install it on a fresh Ubuntu 24.04 env :)

Error Log (Desktop only)

Therefore, here is the log when I do superproductivity -v on a shell :

[77568:1215/160800.018674:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.login1.Manager.Inhibit: object_path= /org/freedesktop/login1: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.466" (uid=1000 pid=77568 comm="/snap/superproductivity/2165/superproductivity --n" label="snap.superproductivity.superproductivity (enforce)") interface="org.freedesktop.login1.Manager" member="Inhibit" error name="(unset)" requested_reply="0" destination="org.freedesktop.login1" (uid=0 pid=1325 comm="/usr/lib/systemd/systemd-logind" label="unconfined")
[77568:1215/160810.270629:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.FileManager1.ShowItems: object_path= /org/freedesktop/FileManager1: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.307" (uid=1000 pid=77568 comm="/snap/superproductivity/2165/superproductivity --n" label="snap.superproductivity.superproductivity (enforce)") interface="org.freedesktop.FileManager1" member="ShowItems" error name="(unset)" requested_reply="0" destination="org.freedesktop.FileManager1" (uid=1000 pid=5019 comm="/usr/bin/Thunar --daemon" label="unconfined")
[77568:1215/160810.270640:ERROR:platform_util_linux.cc(242)] Error calling ShowItems

Good news, I've made a quick fix on my AppArmor profile for ubuntu snap. feel free to add it on the snap if you want :

dbus (send)
    bus=session
    path=/org/freedesktop/FileManager1
    interface=org.freedesktop.FileManager1
    member=ShowItems,

dbus (send)
    bus=system
    path=/org/freedesktop/login1
    interface=org.freedesktop.login1.Manager
    member="Inhibit",
@darcosion darcosion added the bug label Dec 15, 2024
Copy link

Thank you very much for opening up this issue! I am currently a bit overwhelmed by the many requests that arrive each week, so please forgive me, if I fail to respond personally. I am still very likely to at least skim read your request and I'll probably try to fix all (real) bugs if possible and I will likely review every single PR being made (please, give me a heads up if you intent to do so) and I will try to work on popular requests (please upvote via thumbs up on the original issue) whenever possible, but trying to respond to every single issue over the last years has been kind of draining and I need to adjust my approach for this project to remain fun for me and to make any progress with actually coding new stuff. Thanks for your understanding!

Copy link

Hello there darcosion! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀

For more open ended discussions and/or specific questions, please visit the discussions page. 💖

@johannesjo
Copy link
Owner

Thanks for opening this up and sharing your fix! I am unable to reproduce this with a fresh ubuntu 24.04 installation. How exactly did you configure the sync. When and how does the crash occur (if any)? Can you reproduce this reliably?

@darcosion
Copy link
Author

Hi,

By the "sync", I mean the synchronisation to local file feature provided by superproductivity. Sorry for my lack of precision.
I've set a local directory on my /home nothing fancy.

Therefore, I think what made my config specific is the fact that I tried switching to different environments in the past (xfce/cinnamon/gnome), so maybe my FileManager by default is not the good one because they use different file manager on Ubuntu 24.04.

I could try to reinstall a fresh Ubuntu for that, but it will take time...

@johannesjo
Copy link
Owner

Still not able to reproduce this. Paths inside my home directory seem to work fine for me. Do you get an "EACCESS" error or something else?

@darcosion
Copy link
Author

Hi,

I digged a bit and finally was able to reproduce :

On my cinnamon with nautilus environment, I've installed xfce with Thunar File Manager as a second graphical environment.
When I switched back to Cinnamon, Thunar was my default file manager and it seem to do some call that are different than Nautilus.

On my configuration, it seem to generate same logs than what I showed first. Are you able to reproduce with xfce + Thunar ? :)

It is not the standard Ubuntu configuration so, I'm not sure it need a fix.

@johannesjo
Copy link
Owner

Not sure, if Super Productivity just shows the error message about not being allowed to access this folder and you can continue to use the app normally after that than it is behaving as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants