anujdatar/onenote-desktop

Stop Attempting to Access Documents Folder On Startup

Closed this issue · 11 comments

I use the snap version on Kubuntu and I have symlinks in place of my home directories for cloud sync.

This doesn't really affect anything except snap applications, because of AppArmor.

Does this app need to store some data in the Documents folder? Its the only deny that I get from AppArmor. I thought it just displayed info via browser session?

If file access is needed for some sort of small config data, can we not store that in a hidden file under ~/.config?

I am able to use the Firefox snap (default) without issue, but because this snap needs documents access at startup, it fails.

For now I am just running the app in devmode, which doesn't enforce the rules. I think we can find a way to make this work, since realistically this app shouldn't need access to the documents folder.

Edit: Also, have you considered making a flatpak version of this? I would be very interested to see that!

This app does not need to access your Documents folder, nor does it ask for it. As you said, it just serves the OneNote website in a desktop app wrapper.

The only drive access it uses is: it creates a ~/.config/OneNote folder where it stores application configurations such as window size, placement, last open notebook, and whatever cache electron stores.

And if you are using the snap, then it doesn't even use that. It creates a ~/snap/onenote-desktop/.config/OneNote folder which is inside the Snap sandbox. So it doesn't even need write access to your home folder.

Not sure why it's doing that on your pc. Did you install it from the Snap Store or from the .snap file on GitHub as a classic or unsafe snap? You shouldn't be able to use --classic from Snap Store because that's not something I've registered for.

If you can send me the crash logs I'll take a look.

I am getting a different error than the other day, now it's this (turned off developer mode):

Oct 13 19:18:42 <machine_id> audit[122493]: AVC apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/20290/usr/lib/snapd/snap-confine" pid=122493 comm="snap-confine" capability=12 capname="net_admin" Oct 13 19:18:42 <machine_id> audit[122493]: AVC apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/20290/usr/lib/snapd/snap-confine" pid=122493 comm="snap-confine" capability=38 capname="perfmon" Oct 13 19:18:42 <machine_id> kernel: audit: type=1400 audit(1697249922.164:4821): apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/20290/usr/lib/snapd/snap-confine" pid=122493 comm="snap-confine" capability=12 capname="net_admin" Oct 13 19:18:42 <machine_id> kernel: audit: type=1400 audit(1697249922.164:4822): apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/20290/usr/lib/snapd/snap-confine" pid=122493 comm="snap-confine" capability=38 capname="perfmon"

I don't think this is an issue with this app. Might be a system configuration issue. What version of Kubuntu are you running? Did you recently upgrade your Kubuntu version? Check if you have apparmor-profiles and apparmor-utils.

Also check this thread https://forum.snapcraft.io/t/unable-to-run-snaps-apparmor-denials/33138/4

This happens even on the first install, I am running 23.04. I'll have to reinstall again, so I can get the original error.

BTW, have you considered packaging this with flatpak as well? I never have any issue with flatpak installs, only snaps.

That link you gave me, makes me want to stay even farther away from snaps...If the software itself doesn't update it own profiles (sometimes).

I never have any issue with flatpak installs, only snaps.

Does this mean you have issues with other snaps too?

I have been planning to add flatpaks, but i haven't gotten around to it. maybe with the next update.

Also, you could try to use the AppImage in the mean time. That should work just fine.

I never have any issue with flatpak installs, only snaps.

Does this mean you have issues with other snaps too?

I have been planning to add flatpaks, but i haven't gotten around to it. maybe with the next update.

Correct, but many work just fine. For me it's about 50/50 for snaps, but flatpak has been damn near perfect.

hmm. Seems like its a problem with your system's snapd configuration. Closing this issue because it's not caused by this app, but I'll try to release a flatpak version soon.

That doesn't make sense, since other snaps work and I have not modified my snap config in any way.

If other apps work just fine, it sounds like there might be some sort of default config that you are not accounting for.

I will re-create my setup tonight and get you the original error messages.

Correct, but many work just fine. For me it's about 50/50 for snaps, but flatpak has been damn near perfect.

I thought you said Snaps are 50/50, I understood that as some snaps work while others don't. Is that an accurate assumption?

I will re-create my setup tonight and get you the original error messages.

That would be helpful. I'll gladly open the issue again if there is something I can do to fix it at my end.

Also, you might want to try the AppImage version. AppImages also are kind of sandboxed. The only resource it accesses is creating a config folder ~/.config/OneNote to store app states and cache.

Like I said it only uses this to store window sizes and location, which is only used to restore your app window and state when you close and relaunch the app. Also, whatever cache the OneNote web app needs to store, since it is technically a webpage (but this is completely controlled by Microsoft).

Closing stale issue because of insufficient information