-
Notifications
You must be signed in to change notification settings - Fork 80
"Error: Native host has exited" on Chrome and NixOS #175
Comments
First run this and see how many results you have, should be one or two if you installed browserpass only for one browser:
Then look into one of those files that is in the Judging by your error, Chrome tries to execute this app, but fails for some reason. Check permissions on the file, can you execute it as a normal user? Download this file and try this command - this is exactly what browser extension is doing when it wants to search for github.com passwords, see what this returns:
|
The path inside I didn't think to check its permissions, but they're currently set to rwx for myself and r-x for all other users so that doesn't seem to be the problem. However, if I try to direct your request to the browserpass executable, i.e. |
I also just installed it for Firefox and get the analogous "Error: Attempt to postMessage on disconnected port" message so it doesn't seem to be a browser issue 😕 |
This is very strange 🤔 It is definitely the cause of your issue, if you can't execute this app via terminal, browsers cannot execute it too... Not knowing much about NixOS, I'm wondering if the binary formats are compatible with other linuxes? And a stupid question, do you have 64bit OS? |
If you want, you can also compile a binary directly on your hardware to see if it works. If you don't want to spend time on installing Go, dep and the rest of prerequisites, I suggest to use Docker, you only need to run two commands, build an image and compile frontend+backend (instructions here). This will generate |
NixOS doesn't use any weird binary formats. You could run apt on it if you wanted and it would work fine. Sometimes there are path issues when things with dependencies are installed through other means (although I find that's much more common when using Nix on Darwin), which is why that was the first thing I check here. And, yes, x86-64 🙂 I even reset privileges for good measure. I should probably also mention that if I try directing your request to the full path of the executable rather than from inside the directory then I get a "No such file or directory" error from bash. I thought it could be because it's in a dot directory, but I still get the error when changing that. I also tried updating the JSON file native-messaging-hosts accordingly to see if that solved the issue, but nope. Not sure what else to try other than a manual build... |
I'm not sure what the "allowed_origins" field does in the native messaging JSON file. I currently have two:
|
These are correct entries for "allowed_origins". Besides trying a manual build, I have only one idea - I'm attaching a |
That executes fine if I remove the extension and call Just to be clear: it doesn't need to be run with any flags or anything before directing that request? Fwiw, I also tried |
Hmm... No, I can't think of anything extra, it should just work... "Command not found" is very confusing to me, it sounds as if OS cannot find the binary at the provided location. Did you have |
Apologies, but I think this is a red herring: it's not currently in my path and I didn't call it with I just moved the browserpass folder to ~/bin, which is on my path, but I still need need to launch the binary as |
Do you have a password stored for github.com for this When you moved the |
Hey @Sophia-Gold, did you have a chance to investigate this further? I can't think of anything I could do on my side to help you right now, so far it looks like you had some success moving the executable from one folder to another, hopefully it's only a matter of adjusting the json file now. Let me know how it goes. |
I haven't had time yet, although I did modify the path in the json file when moving the browserpass directory. And I do have an entry for github.com, although even if I didn't that wouldn't explain Chrome telling me the native host is crashing. I haven't been able to troubleshoot this further since I've been at work where I use OS X. I did install browserpass there as well, via the same means. While it does recognize when I'm on a site that I have a password stored for, but when still gives me "Error: Native host has exited" when it tries to look them up. |
Okay, thanks. Not having an entry wouldn't explain the Chrome crash indeed, but it could have explained why you see empty result from the host application itself. I still believe this is the key to your issue on NixOS, find out why the host app doesn't work, make it work via terminal and then Chrome will also be able to make use of it. As for issues on Mac, the folks in #13 would be able to give you some hints, I don't have a Mac myself, but I picked up that starting browser from terminal and having GPGtools installed helped many people - I recommend heading to #13 if you want to also investigate issues on OS X. |
@Sophia-Gold you can't run binaries from other systems on NixOS. You need to patch it with https://nixos.org/patchelf.html. |
Wow, thanks, that's interesting to know. Thinking out loud, it would be awesome if someone from the community would create a package for NixOS, just like there is AUR package for ArchLinux - that way no one would need to patch anything. |
Hey, isn't this a browserpass package for NixOS? The version is quite old, but at least it already exists. @Sophia-Gold wanna try it out? The new |
I was about to say...there is a Nix package (I also use Nix on OS X), but when I tried to install it at home Nix couldn't find it on channel NixOS 17.03 😕 |
There's 17.09 now (with browserpass), so why not update your system, especially having atomic updates and rollbacks :) You can't break NixOS. |
@Sophia-Gold if you don't see the package even after upgrade as @kamilchm suggests, could you perhaps follow up on this with folks at NixOS/nixpkgs/? Making this package available would benefit everyone, and you wouldn't need to patch anything. Also, they should update the version to 2.x, there have been soo many improvements since v1 🙂 |
I'll close the ticket since the mystery seems to be solved and there is nothing to do in this repo. Thanks to both of you for reporting, doing experiments and eventually finding the answer! |
Somehow I totally missed @kamilchm's comments earlier in the week. Thanks for explaining the dynamic linking issue. I just had to switch channels to 17.09 and then upgrade to get Browserpass. Although in response to "You can't break NixOS"... I've had to rollback to a 16.03 build from May every time I reboot, likely due to Nvidia issues and the lovely fact that I can't disable graphics (even integrated) in BIOS on this machine. Anyway, the issue with Browserpass remains, but I suspect it's because the rebuild wiped out a ton of stuff...including my chrome config and pass itself... |
Because I just spent a couple hours debugging this: I was getting the error Why? These So, these are the final instructions on how to install browserpass on NixOS:
@maximbaz These instructions would be well suited for a small NixOS section in the readme |
Nice job @infinisil, have a look at #307, is there anything you want me to add? |
Specifically, I'm curious if this only applies to Firefox or also to Chrome? |
Thank you @infinisil. It's now working for me in both Firefox and Chrome. |
NixOS 17.03
Chrome 55.0.2883.87
Browserpass 2.04
Browserpass says "Error: Native host has exited" immediately upon clicking on the icon in Chrome. Trying to look up an entry in my password file has no effect.
I initially tried to install it with Nix, but got an error it couldn't locate the package. I then used the Chrome Web Store and, after the problem first appeared, downloaded it and used your install script to see if that would make a difference (even though the versions are currently the same).
The problem persists even when Chrome is launched from root and the paths seems correct so I'm not sure what could be causing the extension to crash.
The text was updated successfully, but these errors were encountered: