Skip to content

AppArmor policy error accessing password manager #59

Closed

Description

@NatoBoram

This is a duplicate of desktop#5606, as requested here.

Description

Can't login to GitHub using the snap version of GitHub Desktop.

github desktop bug

Version

$ snap info github-desktop 
name:      github-desktop
summary:   Extend your GitHub workflow beyond your browser with GitHub Desktop
publisher: Snapcrafters
contact:   https://github.com/snapcrafters/github-desktop/issues
license:   unset
description: |
  Extend your GitHub workflow beyond your browser with our Desktop,
  completely redesigned with Electron. Get a unified cross-platform
  experience that's completely open source and ready to customize.
commands:
  - github-desktop
snap-id:      vxuDrMy9vuqIU5Abf2MQOowf2e09tcm9
tracking:     edge
refresh-date: today at 15:50 EDT
channels:                     
  stable:    –                
  candidate: –                
  beta:      –                
  edge:      1.3.4 (31) 140MB -
installed:   1.3.4 (31) 140MB -
* Operating system:
$ neofetch --off
nato@HelionUbuntu 
----------------- 
OS: Ubuntu 18.04.1 LTS x86_64 
Kernel: 4.15.0-34-generic 
Uptime: 4 hours, 44 mins 
Packages: 2148 
Shell: bash 4.4.19 
Resolution: 1920x1080 
DE: GNOME 3.28.3 
WM: GNOME Shell 
WM Theme: Adwaita 
Theme: Adwaita-dark [GTK2/3] 
Icons: Ubuntu-mono-dark [GTK2/3] 
Terminal: gnome-terminal 
CPU: Intel i5-3570K (4) @ 4.100GHz 
GPU: NVIDIA GeForce GTX 660 Ti 
Memory: 6003MiB / 7922MiB 

Steps to Reproduce

1. `sudo snap install github-desktop --edge`

2. Open GitHub Desktop. It takes a while the first time.

3. Login

Expected Behavior

The login completes successfully.

Actual Behavior

The login fails with the following message : An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.291" (uid=1000 pid=22162 comm="/snap/github-desktop/31/opt/GitHubDesktop/desktop " label="snap.github-desktop.github-desktop (enforce)") interface="org.freedesktop.Secret.Service" member="OpenSession" error name="(unset)" requested_reply="0" destination=":1.20" (uid=1000 pid=1732 comm="/usr/bin/gnome-keyring-daemon --daemonize --login " label="unconfined").

Additional Information

I believe it's because of an undeclared capability in the app. It should be as simple as modifying the package.json file by adding an interface.

Logs

... and I noticed I reported at the wrong place. There's already snapcrafters/github-desktop#9.

Edit

Solution :

sudo snap connect github-desktop:password-manager-service

Activity

  1. ipkpjersi commented on Sep 17, 2018

    @ipkpjersi

    I have not been able to replicate this issue. The snap is working just fine for me (although - perhaps it is because I already had my credentials saved? Not sure...) with logging into GitHub.

  2. bb441db commented on Sep 24, 2018

    @bb441db

    Can you try running the following command and see if that fixes it? (assuming desktop is the snap's name.)

    sudo snap connect desktop:password-manager-service

    See: https://forum.snapcraft.io/t/nextcloud-client-snap-app-armor-issue/4366/4

    If this fixes it, we should add this to the snap.

    plugs: 
      - 'password-manager-service'
  3. NatoBoram commented on Oct 5, 2018

    @NatoBoram
    Author

    @bb441db It works!

    sudo snap connect github-desktop:password-manager-service

    image

  4. NatoBoram commented on Oct 5, 2018

    @NatoBoram
    Author

    Now that this is done, there's another problem.

    Cloning into '/home/nato/Documents/GitHub/FirstRun'...
    /snap/github-desktop/35/opt/GitHubDesktop/resources/app/git/libexec/git-core/git-remote-https: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
    

    image

    Should I open a separate issue for this?

  5. joaomlneto commented on Oct 5, 2018

    @joaomlneto

    I believe this is being tracked at desktop/dugite-native#109 :-)

    (oops, probably not; don't think it's relevant to the snap build?)

  6. NatoBoram commented on Oct 5, 2018

    @NatoBoram
    Author

    Thanks!

    Wow, issues are being tracked at so many places at once x)

  7. bb441db commented on Oct 5, 2018

    @bb441db

    See #68

    Should be fixed in a newer release, I don't think it's in the snapcraft repos yet.

  8. shiftkey commented on Nov 20, 2018

    @shiftkey
    Owner

    Looks like I regressed this with the newest Snap on the store (1.5.0-linux5)

    An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.145" (uid=1000 pid=4101 comm="/snap/github-desktop/37/app/github-desktop --type=" label="snap.github-desktop.github-desktop (enforce)") interface="org.freedesktop.Secret.Service" member="OpenSession" error name="(unset)" requested_reply="0" destination=":1.14" (uid=1000 pid=2562 comm="/usr/bin/gnome-keyring-daemon --daemonize --login " label="unconfined")
    
  9. ipkpjersi commented on Nov 20, 2018

    @ipkpjersi

    I will admit I am a little sad to hear that this latest snap version on the snapcraft store has one or more regressions after the previous snap had other issues as well for me. If this issue and #91 are fixed, is deploying an updated snap to the snapcraft store possible or does it take a long time to publish updates to there? I am unsure how the snapcraft store works in terms of publishing updates since I believe there was a couple months between this release and the last release, whereas there has been extremely frequent releases on this fork.

  10. shiftkey commented on Nov 20, 2018

    @shiftkey
    Owner

    I will admit I am a little sad to hear that this latest snap version on the snapcraft store has one or more regressions after the previous snap had other issues as well for me.

    The previous Snap version had the "classic" confinement (which meant it wasn't confined at all) so I'm not surprised it was much better. Releasing packages with this setting required approval from Snapcraft to do, and isn't something they encourage. This version now uses the "strict" confinement, which is important for many reasons, but I suspect we'll have some more tweaks to the config to get it working smoothly.

    It's not clear to me how to correlate errors like this to the right interfaces/plugs, so any pointers from those more experienced with Snap packaging would be greatly appreciated. cc @flexiondotorg

    If this issue and #91 are fixed, is deploying an updated snap to the snapcraft store possible or does it take a long time to publish updates to there?

    I can deploy to the Edge channel pretty in about an hour, and that's what I've been working towards over the last few weeks in my spare time. The hold up has been around getting permissions to publish to the existing package in the store (this wasn't started by me) but it was enabled in the last 24 hours.

  11. added
    installers/snap
    on Nov 20, 2018
  12. changed the title [-]Can't login to GitHub using the snap version of GitHub Desktop[/-] [+]AppArmor policy error accessing password manager[/+] on Nov 20, 2018
  13. shiftkey commented on Nov 20, 2018

    @shiftkey
    Owner

    @ipkpjersi I believe this is something that's a security measure we've encountered - this document suggests that the permission we had for password-manager-service is not auto-connect, which means the user likely needs to connect the app to be able to read/write credentials.

    This worked on my machine with the latest build: sudo snap connect github-desktop:password-manager-service - I was able to sign in fine after that.

  14. shiftkey commented on Nov 20, 2018

    @shiftkey
    Owner

    For the moment I'm going to leave this open to address these three things:

  15. zypA13510 commented on Nov 21, 2018

    @zypA13510

    Just updated to snap store version and encountered this error.

    I would suggest including the connect instruction in the error message, people tends to ignore the install guide (I did). And maybe include an opt-out choice (instead of "close") as well.

  16. shiftkey commented on Nov 21, 2018

    @shiftkey
    Owner

    I would suggest including the connect instruction in the error message, people tends to ignore the install guide (I did).

    We already have a similar scenario here about the Keychain access:

    log.error(`Error adding account '${account.login}'`, e)
    if (__DARWIN__ && isKeyChainError(e)) {
    this.emitError(
    new Error(
    `GitHub Desktop was unable to store the account token in the keychain. Please check you have unlocked access to the 'login' keychain.`
    )
    )
    } else {
    this.emitError(e)
    }

    If someone wants to try making a similar isAppArmorError(e) function here to make the error message friendlier I'd be happy to work with them on reviewing and merging the change.

  17. bangke213 commented on Nov 23, 2018

    @bangke213
  18. shiftkey commented on Apr 7, 2019

    @shiftkey
    Owner

    With the help of the Snapcraft team, I've now been able to publicize the app again on the Snapcraft store now the enclosures are migrated. It is recommended to install the beta channel currently if you are working from a fresh install.

    For existing installs the edge channel will remain using the strict enclosure for the moment, and refreshing to the latest version there will ask you to install the beta channel, which is using the classic enclosure and requires a manual upgrade:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wantedinstallers/snap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions