Snap: "AppArmor policy prevents" login error

Bug report

Snap is missing a required password-manager-service connection to setup AppArmor profiles.
When logging into the application, this error is reported: An AppArmor policy prevents this sender from sending this message to this recipient

The solution is to add the missing connection [0], this can be updated in the snap.

Info

  • Platform: Ubuntu
  • Platform version: 20.04
  • App Version: 4.6.1 (snap)

Reproduce

sudo snap install inkdrop
# Attempt to login, get apparmor error
sudo snap connect inkdrop:password-manager-service
# Login works

[0] https://github.com/shiftkey/desktop/issues/59#issuecomment-424110415

Hi Daniel,

Thank you for reporting.
It is an intended behavior and it is mentioned in the manual.
The snap already has it in snapcraft.yaml:

But you have to connect manually because password-manager-service is not auto-connect for security reason:

Ah, sorry I didn’t see that the manual already covered this.

You might consider capturing this error message and providing the user with a link to the manual, or a suggestion to run the snap connect command.

Thanks for sorting out the snap build issues and posting updated snaps!

That makes sense! I’ll check if it is possible to catch the AppArmor error. Thanks for the suggestion.