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

Failed to install firenvm / Neovim died without answering #1198

Closed
bragmore opened this issue Sep 30, 2021 · 37 comments · Fixed by #1199
Closed

Failed to install firenvm / Neovim died without answering #1198

bragmore opened this issue Sep 30, 2021 · 37 comments · Fixed by #1199

Comments

@bragmore
Copy link

bragmore commented Sep 30, 2021

Hey,

I just installed firenvim using the packer method but when doing :PackerInstall it tells me that the installation of firenvim failed, as well as activating the extension inside google chrome gives me "Neovim died without answering" (probably due to firenvim not getting installed properly).

For some reason I still see firenvim installed when running :PackerStatus

running :lua bit.band(1,1) inside NVIM v0.5.0 does not return any error at all (I'm on ArchWSL).

How do I get this plugin to work? dying to use it at work!

Thanks

@glacambre
Copy link
Owner

Hi. Could you try the steps of the troubleshooting guide? Let me know what the results are :).

@bragmore
Copy link
Author

bragmore commented Sep 30, 2021

Hi. Could you try the steps of the troubleshooting guide? Let me know what the results are :).

Cool, thanks for the quick reply! and I already did.

echo 'abcde{}' | $XDG_DATA_HOME/firenvim/firenvim

just returns "no such file or directory", like stated before the installation when running :PackerInstall tells me that the insallation has failed.

I dont have a firenvim.json file inside $HOME/.config/google-chrome/NativeMessagingHosts/ either.

Tried the cloning step and editing firenvim file aswell without results.

echo $PATH i shell and :!echo $PATH returns the same for me aswell

@glacambre
Copy link
Owner

glacambre commented Sep 30, 2021

it tells me that the installation of firenvim failed

Oh, sorry, I missed that. What's the error message exactly? Does it also happen when running :call firenvim#install(0) manually?

@bragmore
Copy link
Author

bragmore commented Sep 30, 2021

No worries at all! :D

:call firenvim#install(0) returns the following:

No config detected for chromium. Skipping.
No config detected for ungoogled-chromium. Skipping.
No config detected for opera. Skipping.
No config detected for brave. Skipping.
No config detected for vivaldi. Skipping.
No config detected for chrome-dev. Skipping.
No config detected for firefox. Skipping.
No config detected for chrome-canary. Skipping.
No config detected for chrome. Skipping.
No config detected for edge. Skipping.
Installation complete on the wsl side. Performing install on the windows side.

I'm using chrome with the installed extension btw.

@glacambre
Copy link
Owner

Could you run export DRY_RUN=1 and then start neovim and run :call firenvim#install(0) again?

@bragmore
Copy link
Author

Sure, output:

mkdir('/home/bragmore/.local/share/firenvim', 'p', 448)
writefile(['#!/bin/sh', 'mkdir -p /tmp//firenvim', 'chmod 700 /tmp//firenvim', 'cd /tmp//firenvim', 'export PATH="$PATH:
/home/bragmore/.nvm/versions/node/v16.10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/
usr/local/games:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"', 'unset NVIM_LISTEN_ADDRESS', 'if [ -n "$VI
M" ] && [ ! -d "$VIM" ]; then', ' unset VIM', 'fi', 'if [ -n "$VIMRUNTIME" ] && [ ! -d "$VIMRUNTIME" ]; then', ' unset
VIMRUNTIME', 'fi', '', 'exec ''/usr/bin/nvim'' --headless --cmd ''let g:started_by_firenvim = v:true'' -c ''call firenv
im#run()'''], '/home/bragmore/.local/share/firenvim/firenvim')
setfperm('/home/bragmore/.local/share/firenvim/firenvim', 'rwx------')
No config detected for chromium. Skipping.
No config detected for ungoogled-chromium. Skipping.
No config detected for opera. Skipping.
No config detected for brave. Skipping.
No config detected for vivaldi. Skipping.
No config detected for chrome-dev. Skipping.
No config detected for firefox. Skipping.
No config detected for chrome-canary. Skipping.
No config detected for chrome. Skipping.
No config detected for edge. Skipping.

@glacambre
Copy link
Owner

This is super weird. We know that Firenvim is detecting that it is being installed in wsl because it prints the message telling us it installed on wsl. This means that firenvim#install has to be called again. Which means we should at least see No config detected for chromium. Skipping be printed twice.

Are you showing the whole output of the command?

@bragmore
Copy link
Author

bragmore commented Sep 30, 2021

This is super weird. We know that Firenvim is detecting that it is being installed in wsl because it prints the message telling us it installed on wsl. This means that firenvim#install has to be called again. Which means we should at least see No config detected for chromium. Skipping be printed twice.

Are you showing the whole output of the command?

yep agreed.

And that was the whole output of the command , yes.

When running the command again I get the following error instead:

Error detected while processing function firenvim#install[16]..<SNR>72_get_data_dir_path[3]..<SNR>72_get_windows_env_path: line 13: E475: Invalid value for argument cmd: 'cmd.exe' is not executable

@glacambre
Copy link
Owner

Invalid value for argument cmd: 'cmd.exe' is not executable

Nice. Firenvim indeed cannot install itself on windows if it doesn't have access to cmd.exe - the reason for this is that we need cmd.exe to expand windows environment variables.

What happens if you replace cmd.exe here:

let l:cmd_output = system(['cmd.exe', '/c', 'echo', l:env])

with /mnt/c/Windows/System32/cmd.exe?

@bragmore
Copy link
Author

Invalid value for argument cmd: 'cmd.exe' is not executable

Nice. Firenvim indeed cannot install itself on windows if it doesn't have access to cmd.exe - the reason for this is that we need cmd.exe to expand windows environment variables.

What happens if you replace cmd.exe here:

let l:cmd_output = system(['cmd.exe', '/c', 'echo', l:env])

with /mnt/c/Windows/System32/cmd.exe?

sorry but im not able to find that directory at all, where is it supposed to be? since it never installed properly I dont see this

@glacambre
Copy link
Owner

It's wherever packer installs plugins :) find ~ -iname "firenvim.vim" might find it for you.

@bragmore
Copy link
Author

bragmore commented Sep 30, 2021

It's wherever packer installs plugins :) find ~ -iname "firenvim.vim" might find it for you.

cheers.

After changing that output after :call firenvim#install(0)

No config detected for ungoogled-chromium. Skipping.
No config detected for opera. Skipping.
No config detected for brave. Skipping.
No config detected for vivaldi. Skipping.
No config detected for chrome-dev. Skipping.
No config detected for firefox. Skipping.
No config detected for chrome-canary. Skipping.
No config detected for chrome. Skipping.
No config detected for edge. Skipping.
Installation complete on the wsl side. Performing install on the windows side.
No config detected for chromium. Skipping.
No config detected for ungoogled-chromium. Skipping.
No config detected for opera. Skipping.
No config detected for brave. Skipping.
No config detected for vivaldi. Skipping.
No config detected for chrome-dev. Skipping.
No config detected for firefox. Skipping.
No config detected for chrome-canary. Skipping.
Installed native manifest for chrome.
Creating registry key for chrome. This may take a while. Script: /mnt/c/Users/jonta/AppData/Local/firenvim/chrome.ps1
Error detected while processing function firenvim#install[84]..firenvim#install[71]..<SNR>72_maybe_execute:
line    5:
E475: Invalid value for argument cmd: 'powershell.exe' is not executable

@glacambre
Copy link
Owner

Hah, almost there!

Try replacing powershell.exe here:

let o = s:maybe_execute('system', ['powershell.exe', '-Command', '-'], readfile(l:ps1_path))

With /mnt/c/Program Files/PowerShell/6.0.0/pwsh.exe? I'm guessing these paths - I don't have a windows machine to test this on at the moment, so if it doesn't work please try to figure out where the powershell executable is stored on your machine and use that :)

@bragmore
Copy link
Author

bragmore commented Sep 30, 2021

path for powershell seems to be c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe

call firenvim#install(0) gave me:

mkdir('/mnt/c/Users/jonta/AppData/Local/firenvim', 'p', 448)
'], '/mnt/c/Users/jonta/AppData/Local/firenvim/firenvim.bat')renvim = v:true" -c "call firenvim#run()"
setfperm('C:\Users\jonta\AppData\Local\firenvim\firenvim.bat', 'rwx------')
No config detected for chromium. Skipping.
No config detected for ungoogled-chromium. Skipping.
No config detected for opera. Skipping.
No config detected for brave. Skipping.
No config detected for vivaldi. Skipping.
No config detected for chrome-dev. Skipping.
No config detected for firefox. Skipping.
No config detected for chrome-canary. Skipping.
mkdir('/mnt/c/Users/jonta/AppData/Local/firenvim', 'p', 448)
writefile(['{ "name": "firenvim", "description": "Turn your browser into a Neovim GUI.", "path": "C:\\Users\\jonta\\AppD
ata\\Local\\firenvim\\firenvim.bat", "type": "stdio", "allowed_origins": [ "chrome-extension://egpjdkipkomnmjhjmdamanicl
mdlobbo/" ]}'], '/mnt/c/Users/jonta/AppData/Local/firenvim/firenvim-chrome.json')
setfperm('/mnt/c/Users/jonta/AppData/Local/firenvim/firenvim-chrome.json', 'rw-------')
Installed native manifest for chrome.
Creating registry key for chrome. This may take a while. Script: /mnt/c/Users/jonta/AppData/Local/firenvim/chrome.ps1
writefile(['New-Item -Path "HKCU:\Software\Google"', 'New-Item -Path "HKCU:\Software\Google\Chrome"', 'New-Item -Path "H
KCU:\Software\Google\Chrome\NativeMessagingHosts"', 'New-Item -Path "HKCU:\Software\Google\Chrome\NativeMessagingHosts\f
irenvim"', 'Set-Item -Path "HKCU:\Software\Google\Chrome\NativeMessagingHosts\firenvim\" -Value "C:\Users\jonta\AppData\
Local\firenvim\firenvim-chrome.json"'], '/mnt/c/Users/jonta/AppData/Local/firenvim/chrome.ps1')
setfperm('/mnt/c/Users/jonta/AppData/Local/firenvim/chrome.ps1', 'rwx------')
system(['c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe', '-Command', '-'], ['New-Item -Path "HKCU:\Software\G
oogle"', 'New-Item -Path "HKCU:\Software\Google\Chrome"', 'New-Item -Path "HKCU:\Software\Google\Chrome\NativeMessagingH
osts"', 'New-Item -Path "HKCU:\Software\Google\Chrome\NativeMessagingHosts\firenvim"', 'Set-Item -Path "HKCU:\Software\G
oogle\Chrome\NativeMessagingHosts\firenvim\" -Value "C:\Users\jonta\AppData\Local\firenvim\firenvim-chrome.json"'])
Created registry key for chrome.
mkdir('/mnt/c/Users/jonta/AppData/Local/firenvim', 'p', 448)
writefile(['{ "name": "firenvim", "description": "Turn your browser into a Neovim GUI.", "path": "C:\\Users\\jonta\\AppD
ata\\Local\\firenvim\\firenvim.bat", "type": "stdio", "allowed_origins": [ "chrome-extension://egpjdkipkomnmjhjmdamanicl
mdlobbo/" ]}'], '/mnt/c/Users/jonta/AppData/Local/firenvim/firenvim-edge.json')
setfperm('/mnt/c/Users/jonta/AppData/Local/firenvim/firenvim-edge.json', 'rw-------')
Installed native manifest for edge.
Creating registry key for edge. This may take a while. Script: /mnt/c/Users/jonta/AppData/Local/firenvim/edge.ps1
writefile(['New-Item -Path "HKCU:\Software\Microsoft"', 'New-Item -Path "HKCU:\Software\Microsoft\Edge"', 'New-Item -Pat
h "HKCU:\Software\Microsoft\Edge\NativeMessagingHosts"', 'New-Item -Path "HKCU:\Software\Microsoft\Edge\NativeMessagingH
osts\firenvim"', 'Set-Item -Path "HKCU:\Software\Microsoft\Edge\NativeMessagingHosts\firenvim\" -Value "C:\Users\jonta\A
ppData\Local\firenvim\firenvim-edge.json"'], '/mnt/c/Users/jonta/AppData/Local/firenvim/edge.ps1')
setfperm('/mnt/c/Users/jonta/AppData/Local/firenvim/edge.ps1', 'rwx------')
Error detected while processing function firenvim#install:
line   71:
E484: Can't open file /mnt/c/Users/jonta/AppData/Local/firenvim/edge.ps1
system(['c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe', '-Command', '-'], [])

@glacambre
Copy link
Owner

I don't get it, the previous logs show that the file had been successfully written (otherwise we wouldn't have reached the line trying to execute powershell).

Do you have .ps1 files in C:\Users\jonta\AppData\Local\firenvim? If yes, could you try to execute each of them and see if this makes Firenvim work?

@bragmore
Copy link
Author

I don't get it, the previous logs show that the file had been successfully written (otherwise we wouldn't have reached the line trying to execute powershell).

Do you have .ps1 files in C:\Users\jonta\AppData\Local\firenvim? If yes, could you try to execute each of them and see if this makes Firenvim work?

Yeah there's a chrome.ps1 file inside this folder for me.

@glacambre
Copy link
Owner

Nice, please execute it (you might be able to do that by right-clicking it, or perhaps runnning it from a powershell terminal) and try to use Firenvim in chrome (perhaps restart chrome, just to be sure ;) ).

@bragmore
Copy link
Author

Nice, please execute it (you might be able to do that by right-clicking it, or perhaps runnning it from a powershell terminal) and try to use Firenvim in chrome (perhaps restart chrome, just to be sure ;) ).

how would u execute a ps1 script inside wsl (archWSL) to begin with?

Then ill try to execute it in powershell itself

@glacambre
Copy link
Owner

how would u execute a ps1 script inside wsl (archWSL) to begin with?

I meant execute it on windows, from your regular file browser :)

@bragmore
Copy link
Author

how would u execute a ps1 script inside wsl (archWSL) to begin with?

I meant execute it on windows, from your regular file browser :)

so when doing so it executes the script but gives me a quick error and then quickly closes the window, it all happens in a matter of milliseconds.. I managed to capture it via a snipping tool however.

image

@glacambre
Copy link
Owner

Great, the key already existing means that Firenvim should finally be properly installed. Could you try to use it in chrome? Make sure you've restarted your browser and try on a simple website like Github or txti.es :)

@bragmore
Copy link
Author

Great, the key already existing means that Firenvim should finally be properly installed. Could you try to use it in chrome? Make sure you've restarted your browser and try on a simple website like Github or txti.es :)

I tried in txti.es but still gives me the same result... "neovim died without answering", not sure whats going on here

@glacambre
Copy link
Owner

Do you have a registry key named HKCU:\Software\Google\Chrome\NativeMessagingHosts\firenvim\? Does it point to C:\Users\jonta\AppData\Local\firenvim\firenvim-chrome.json? Does C:\Users\jonta\AppData\Local\firenvim\firenvim-chrome.json exist? What's its content?

@bragmore
Copy link
Author

I do have a registry key named HKCU:\Software\Google\Chrome\NativeMessagingHosts\firenvim\ pointing to C:\Users\jonta\AppData\Local\firenvim\firenvim-chrome.json

C:\Users\jonta\AppData\Local\firenvim\firenvim-chrome.json exists and it's content is:

{ "name": "firenvim", "description": "Turn your browser into a Neovim GUI.", "path": "C:\\Users\\jonta\\AppData\\Local\\firenvim\\firenvim.bat", "type": "stdio", "allowed_origins": [ "chrome-extension://egpjdkipkomnmjhjmdamaniclmdlobbo/" ]}

@glacambre
Copy link
Owner

Great, things seem to be set up correctly so far. What's the contnent of C:\Users\jonta\AppData\Local\firenvim\firenvim.bat?

@bragmore
Copy link
Author

bragmore commented Sep 30, 2021

C:\Users\jonta\AppData\Local\firenvim\firenvim.bat content is:

@echo off
mkdir "C:\Users\jonta\AppData\Local\Temp\firenvim" 2>nul
cd "C:\Users\jonta\AppData\Local\Temp\firenvim"

wsl "/usr/bin/nvim" --headless --cmd "let g:started_by_firenvim = v:true" -c "call firenvim#run()"

@glacambre
Copy link
Owner

Does running wsl "/usr/bin/nvim" in cmd.exe work?

@bragmore
Copy link
Author

Nope it gives me the following error:

packer.nvim: Error running config for rest.nvim: [string "..."]:0: module 'config.rest' not found:
^Ino field package.preload['config.rest']
^Ino file './config/rest.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/config/rest.lua'
^Ino file '/usr/local/share/lua/5.1/config/rest.lua'
^Ino file '/usr/local/share/lua/5.1/config/rest/init.lua'
^Ino file '/usr/share/lua/5.1/config/rest.lua'
^Ino file '/usr/share/lua/5.1/config/rest/init.lua'
^Ino file '/home/jontah/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/config/rest.lua'
^Ino file '/home/jontah/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/config/rest/init.lua'
^Ino file '/home/jontah/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/config/rest.lua'
^Ino file '/home/jontah/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/config/rest/init.lua'
^Ino file './config/rest.so'
^Ino file '/usr/local/lib/lua/5.1/config/rest.so'
^Ino file '/usr/lib/x86_64-linux-gnu/lua/5.1/config/rest.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file '/home/jontah/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/config/rest.so'
^Ino file './config.so'
^Ino file '/usr/local/lib/lua/5.1/config.so'
^Ino file '/usr/lib/x86_64-linux-gnu/lua/5.1/config.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

@glacambre
Copy link
Owner

This is why Firenvim doesn't work for you. You'll have to figure out how to fix it on your own though (or perhaps with packer.nvim's maintainer's help?) - I'm not a packer.nvim user and I don't know how it works.

@bragmore
Copy link
Author

This is odd. it's complaining about a nvim plugin that I no longer have installed, really weird

glacambre added a commit that referenced this issue Oct 1, 2021
#1198 reports that cmd.exe
and powershell.exe might not be available in the WSL path. Try to use
absolute paths if relative ones do not work and provide better error
messages when this doesn't work.
glacambre added a commit that referenced this issue Oct 1, 2021
#1198 reports that cmd.exe
and powershell.exe might not be available in the WSL path. Try to use
absolute paths if relative ones do not work and provide better error
messages when this doesn't work.
glacambre added a commit that referenced this issue Oct 1, 2021
#1198 reports that cmd.exe
and powershell.exe might not be available in the WSL path. Try to use
absolute paths if relative ones do not work and provide better error
messages when this doesn't work.
glacambre added a commit that referenced this issue Oct 1, 2021
#1198 reports that cmd.exe
and powershell.exe might not be available in the WSL path. Try to use
absolute paths if relative ones do not work and provide better error
messages when this doesn't work.
glacambre added a commit that referenced this issue Oct 1, 2021
#1198 reports that cmd.exe
and powershell.exe might not be available in the WSL path. Try to use
absolute paths if relative ones do not work and provide better error
messages when this doesn't work.
glacambre added a commit that referenced this issue Oct 1, 2021
#1198 reports that cmd.exe
and powershell.exe might not be available in the WSL path. Try to use
absolute paths if relative ones do not work and provide better error
messages when this doesn't work.
glacambre added a commit that referenced this issue Oct 1, 2021
#1198 reports that cmd.exe
and powershell.exe might not be available in the WSL path. Try to use
absolute paths if relative ones do not work and provide better error
messages when this doesn't work.
@glacambre
Copy link
Owner

I've improved the error handling in ways that would certainly have helped with debugging this issue, so I'll close it. If you're still experiencing problems even after managing to run neovim through WSL, don't hesitate to report them here or in a new issue, I'll be happy to finish helping you to get Firenvim working :)

@bragmore
Copy link
Author

bragmore commented Oct 1, 2021

@glacambre oh sorry I think you misunderstood me, neovim is running just fine and all plugins aswell. Im not sure why wsl "/usr/bin/nvim" is returning error codes from a long time ago. I dont get a single error inside neovim and all plugins are working flawlessly. Its only firenvim that does not work for me.

@bragmore
Copy link
Author

bragmore commented Oct 1, 2021

@glacambre I'm assuming this is related to one of the previous errors:

"Error detected while processing function firenvim#install[16]..<SNR>72_get_data_dir_path[3]..<SNR>72_get_windows_env_path: line 13: E475: Invalid value for argument cmd: 'cmd.exe' is not executable"

Maybe making an alias for using "cmd.exe" could be a solution for this? alternative would be alias open=explorer.exe and use that in the firenvim.vim script? in other words change cmd.exe to something else

let l:cmd_output = system(['cmd.exe', '/c', 'echo', l:env]) ?

@glacambre
Copy link
Owner

neovim is running just fine and all plugins aswell.

No it is not. You told me that running wsl "/usr/bin/nvim" in cmd.exe caused neovim to print error messages. This is proof that there is an issue with your setup.

Im not sure why wsl "/usr/bin/nvim" is returning error codes from a long time ago.

Probably because your config is dirty. Try running sudo mv "$HOME" "$HOME/$(basename $HOME)2" && sudo mkdir "$HOME" in wsl - this will rename your home directory and create a new one, essentially allowing you to start from scratch. Then, run wsl "/usr/bin/nvim" from cmd.exe - you very likely won't see any error messages.

I'm assuming this is related to one of the previous errors:

No. The problem is that your neovim is spewing errors. Fix this and Firenvim will work.

@bragmore
Copy link
Author

bragmore commented Oct 1, 2021

neovim is running just fine and all plugins aswell.

No it is not. You told me that running wsl "/usr/bin/nvim" in cmd.exe caused neovim to print error messages. This is proof that there is an issue with your setup.

Im not sure why wsl "/usr/bin/nvim" is returning error codes from a long time ago.

Probably because your config is dirty. Try running sudo mv "$HOME" "$HOME/$(basename $HOME)2" && sudo mkdir "$HOME" in wsl - this will rename your home directory and create a new one, essentially allowing you to start from scratch. Then, run wsl "/usr/bin/nvim" from cmd.exe - you very likely won't see any error messages.

I'm assuming this is related to one of the previous errors:

No. The problem is that your neovim is spewing errors. Fix this and Firenvim will work.

@glacambre

This problem comes from my other installed WSL distro (Ubuntu) which I'm not using anymore.

I'm on ArchWSL and it is set as the default distro now, I removed the plugin "rest.nvim" on my ubuntu distro aswell so now no errors occur when doing wsl "/usr/bin/nvim" in cmd.exe in either ubuntuWSL or archWSL

I also successfully installed firenvim now in nvim without any errors after editing my $PATH variable inside archWSL (this was an issue since the $PATH was different on ArchWSL compared to UbuntuWSL and hence was not allowing me to make use of cmd.exe).

Firenvim created the manifest and config file without errors when installing it.

However... firenvim is not working for me nontheless, the extension is giving me another error now: "Neovim is not responding".

@bragmore
Copy link
Author

bragmore commented Oct 1, 2021

@glacambre OK so I managed to get this working somehow. It seems after fixing my $PATH variable, closing the browser and then reinstalling the chrome extension as well as binding "Activate this extension" inside chrome to a keybind, I FINALLY got firenvim to work! thanks alot for the help on this matter. Appreciate it.

@glacambre
Copy link
Owner

@bragmore Great to hear that things are working for you now, thanks a lot for taking the time to figure things out on your own :)

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

Successfully merging a pull request may close this issue.

2 participants