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

Fresh install with firefox: An unexpected error occured #241

Open
pgaxatte opened this issue Sep 18, 2023 · 6 comments
Open

Fresh install with firefox: An unexpected error occured #241

pgaxatte opened this issue Sep 18, 2023 · 6 comments

Comments

@pgaxatte
Copy link

Hello,

Did a fresh install recently and gopassbridge says "An unexpected error occured" and points to the documentation to setup gopass-jsonapi.

Versions:

  • gopass: gopass 1.15.8-git+HEAD go1.21.1 linux amd64
  • gopass-jsonapi: gopass-jsonapi version 1.15.5
  • gopassbridge: 0.9.0

More info:

  • gopass works without issues
  • fresh profile on firefox
  • ran gopass-jsonapi configure, resulting manifest and wrapper:
$ cat .mozilla/native-messaging-hosts/com.justwatch.gopass.json
{
    "name": "com.justwatch.gopass",
    "description": "Gopass wrapper to search and return passwords",
    "path": "/home/pgaxatte/.config/gopass/gopass_wrapper.sh",
    "type": "stdio",
    "allowed_extensions": [
        "{eec37db0-22ad-4bf1-9068-5ae08df8c7e9}"
    ]
}

$ cat "/home/pgaxatte/.config/gopass/gopass_wrapper.sh"
#!/bin/sh

export PATH="$PATH:$HOME/.nix-profile/bin" # required for Nix
export PATH="$PATH:/usr/local/bin" # required on MacOS/brew
export PATH="$PATH:/usr/local/MacGPG2/bin" # required on MacOS/GPGTools GPGSuite
export GPG_TTY="$(tty)"

# Uncomment to debug gopass-jsonapi
# export GOPASS_DEBUG_LOG=/tmp/gopass-jsonapi.log

if [ -f ~/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
        source ~/.gpg-agent-info
        export GPG_AGENT_INFO
else
        eval $(gpg-agent --daemon)
fi

export PATH="$PATH:/usr/local/bin"

/home/pgaxatte/go/bin/gopass-jsonapi listen

exit $?

How can I collect more info / find out where the issue is?

@pgaxatte
Copy link
Author

Forgot some additional info that might be interesting:

  • OS is Ubuntu 22.04, 64bits
  • Firefox version 117.0.1

@gforsyth
Copy link

I just spent 2 days banging my head against this.

It's because of the Firefox AppArmor profile in Ubuntu 22.04 -- this can be the case for both the snap version of Firefox and also for the mozilla PPA version of Firefox.

To confirm, first stop apparmor, then restart Firefox to see if gopassbridge is working:

sudo systemctl stop apparmor.service

If that fixes things AND you want AppArmor running:

Disable the Firefox AppArmor profile:
(note this assumes you are using the PPA firefox, not the snap Firefox. if it's the Snap firefox the path to the apparmor profile will be different)

sudo ln -s /etc/apparmor.d/usr.bin.firefox /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.bin.firefox

Restart AppArmor

sudo systemctl start apparmor.service

Then restart Firefox and things should be working.

@pgaxatte
Copy link
Author

I stopped apparmor and restarted firefox but I still get the unexpected error.
How can I dig this any further?

@cfenell
Copy link

cfenell commented Oct 9, 2023

Same issue here, Ubuntu 22.04, Firefox 117 from snap.
The browser console logs:
NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)
NativeMessaging.sys.mjs:361
[nsINativeMessagingPortal.closeSession]
Hope this is of some help.

@cfenell
Copy link

cfenell commented Oct 10, 2023

Update: I changed from snap to PPA package and see a different error message:
normalizeError resource://gre/modules/ExtensionCommon.sys.mjs:817

@cfenell
Copy link

cfenell commented Oct 10, 2023

It turned out that
sudo systemctl stop apparmor.service
did not work for me, but what does work is:
sudo apt install apparmor-utils
sudo aa-complain usr.bin.firefox

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

No branches or pull requests

3 participants