glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.71k stars 146 forks source link

"Neovim died without answering" #1583

Closed ASong5 closed 8 months ago

ASong5 commented 8 months ago

What I tried to do

What happened

glacambre commented 8 months ago

Hi, thanks for the thorough issue! I think the problem might be that you are running a firefox Snap rather than a regular firefox binary. Unfortunately, snaps are sandboxed and prevent neovim from running.

Could you check for this?

ASong5 commented 8 months ago

Hey, thanks for the quick reply. As I mentioned under "Browser Version", I am using the deb version of firefox, not snap nor flatpak. Firefox does not show up under snap list or flatpak list.

Thanks

glacambre commented 8 months ago

As I mentioned under "Browser Version", I am using the deb version of firefox, not snap nor flatpak.

Ah, yes, sorry, did not see the edit through email :).

Would it be possible for you to:

This should tell us if the problem is that firefox cannot run the firenvim script, or if the problem is that the firenvim script cannot run neovim.

ASong5 commented 8 months ago

I followed those instructions and "firenvim_script_has_run" was generated in /tmp. I take this to mean that firenvim isn't able to run neovim for some reason? How do we go about troubleshooting this?

glacambre commented 8 months ago

Great, that's progress! In order to debug this, please try the following:

i.e. the last line of the firenvim script should look like this:

tee /tmp/firenvim_stdin | 'PATH_TO_YOUR_NVIM_BINARY' --headless --cmd [very long list of arguments] | tee /tmp/firenvim_stdout

Then, try to reload your firenvim settings twice, and upload the content of the files named /tmp/firenvim_stdin and /tmp/firenvim_stdout here :)

ASong5 commented 8 months ago

It turns out I may have messed up a bit; it seems like previously when I had added the "touch firenvim_script_has_run", the file was generated only because I had inadvertently run the nvim --headless "+call firenvim#install(0) | q command afterwards. Reloading the settings via the firenvim extension in firefox does not seem to generate the file, nor the ...stdin/...stdout files via the tee commands. So it seems that firefox isn't able to execute the firenvim script.

Apologies for the confusion - would appreciate if you could continue to help me diagnose the problem :)

glacambre commented 8 months ago

Okay, so the problem likely is that firefox cannot run the firenvim script. Could you close all firefox instances and then from your terminal run strace -o /tmp/strace -s 4096 -Tfe trace=clone,execve firefox, and once firefox has started click the "reload settings" button? Once this is done, shut down firefox and upload the file /tmp/strace here :)

ASong5 commented 8 months ago

strace.txt

Grepping for "firenvim" outputs some "EACCES (Permission Denied) errors. Is this relevant? Is it a permissions issue?

glacambre commented 8 months ago

We know that the script is executable because you were able to run it from the command line, so it sounds firefox is being denied the right to run the firenvim script. This sounds a lot like https://github.com/glacambre/firenvim/issues/1363#issuecomment-1136797548 , so it's likely that a firefox downloaded from Mozilla's website would work.

I wonder if this has something to do with Ubuntu's default apparmor profile for Firefox. Could you upload your /var/log/kern.log and /var/log/audit/audit.log here?

ASong5 commented 8 months ago

Yup, that seemed to fix the issue. I think it may have been due to the fact that when I first installed Kubuntu a while back, it automatically had a snap version of firefox installed. I've since deleted that version, but I'm guessing there were some remaining configs leftover that were still being used for some reason...

It does seem like apparmor was denying access to the script:

kern.log I don't seem to have an audit folder.

In any case, seems like everything works now. Thanks for your assistance 🫡

glacambre commented 8 months ago

Great, thanks for providing logs! I've opened https://github.com/glacambre/firenvim/issues/1584 to see if firenvim#install can detect this issue and warn about it :)