Closed ASong5 closed 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?
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
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:
${XDG_DATA_HOME:-${HOME}/.local/share}/firenvim/firenvim
to add touch /tmp/firenvim_script_has_run
before thhe mkdir -p
lineThis 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.
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?
Great, that's progress! In order to debug this, please try the following:
touch
line you added to the firenvim scriptexec
at the end of the firenvim script with tee /tmp/firenvim_stdin |
tee /tmp/firenvim_stdout
at the end of the same linei.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 :)
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 :)
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 :)
Grepping for "firenvim" outputs some "EACCES (Permission Denied)
errors. Is this relevant? Is it a permissions issue?
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?
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 🫡
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 :)
What I tried to do
$ nvim --headless "+call firenvim#install(0) | q"
echo 'abcde{}' | ${XDG_DATA_HOME:-${HOME}/.local/share}/firenvim/firenvim
ls $HOME/.mozilla/native-messaging-hosts
What happened
when running
nvim --headless "+call firenvim#install(0) | q"
orcall firenvim#install(0)
from within neovim