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

Get remote OS failed: command not found #63

Closed
ichirou2910 opened this issue Nov 1, 2023 · 7 comments · Fixed by #64
Closed

Get remote OS failed: command not found #63

ichirou2910 opened this issue Nov 1, 2023 · 7 comments · Fixed by #64

Comments

@ichirou2910
Copy link

Describe the bug
I installed the plugin and executed RemoteStart with ichirou2910@192.168.1.101 in the ssh prompt

ERROR Wed 01 Nov 2023 10:12:39 PM +07 .local/share/nvim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
zsh:1: command not found: ichirou2910@192.168.1.101

To Reproduce
Steps to reproduce the behavior:

  1. Run 'RemoteStart'
  2. Select 'Connect to host using connection string'
  3. Prompt 'ichirou2910@192.168.1.101'
  4. See log from 'RemoteLog'

Expected behavior
Connect successfully

System Info

  • Your local OS: Arch Linux
  • Local Neovim version: v0.10.0-dev-1031+gc431d820e
  • Remote host OS (if applicable): Arch Linux
  • Remote Neovim version (if applicable): v0.10.0-dev-1031+gc431d820e
@ichirou2910
Copy link
Author

I was also able to reproduce this with minimal config, taken from the comment of other issue

local M = {}

function M.root(root)
	local f = debug.getinfo(1, "S").source:sub(2)
	return vim.fn.fnamemodify(f, ":p:h:h") .. "/" .. (root or "")
end

---@param plugin string
function M.load(plugin)
	local name = plugin:match(".*/(.*)")
	local package_root = M.root(".tests/site/pack/deps/start/")
	local uv = vim.fn.has("0.10") and vim.uv or vim.loop
	if not uv.fs_stat(package_root .. name) then
		print("Installing " .. plugin)
		vim.fn.mkdir(package_root, "p")
		vim.fn.system({
			"git",
			"clone",
			"--depth=1",
			"https://github.com/" .. plugin .. ".git",
			package_root .. "/" .. name,
		})
	end
end

function M.setup()
	vim.cmd([[set runtimepath=$VIMRUNTIME]])
	vim.opt.runtimepath:append(M.root())
	vim.opt.packpath = { M.root(".tests/site") }
	vim.opt.termguicolors = true
	vim.env.XDG_CONFIG_HOME = M.root(".tests/config")
	vim.env.XDG_DATA_HOME = M.root(".tests/data")
	vim.env.XDG_STATE_HOME = M.root(".tests/state")
	vim.env.XDG_CACHE_HOME = M.root(".tests/cache")

	M.load("MunifTanjim/nui.nvim")
	M.load("nvim-lua/plenary.nvim")
	M.load("rcarriga/nvim-notify")
	M.load("nvim-telescope/telescope.nvim")
	M.load("amitds1997/remote-nvim.nvim")

	require("remote-nvim").setup({
		log = {
			level = "debug",
			max_size = 0,
		},
	})
	require("notify").setup({
		background_colour = "#000000",
	})
end

M.setup()

image

@amitds1997
Copy link
Owner

Thanks for reporting this. Let me have a look!

amitds1997 added a commit that referenced this issue Nov 2, 2023
We were not parsing connection options correctly for hostname which needs to be removed from connection string. We have now implemented a more robust mechanism for handling this instead of relying on regular expressions.

Fixes #63.
amitds1997 added a commit that referenced this issue Nov 2, 2023
We were not parsing connection options correctly for hostname which needs to be removed from connection string. We have now implemented a more robust mechanism for handling this instead of relying on regular expressions.

Fixes #63.
@amitds1997
Copy link
Owner

amitds1997 commented Nov 2, 2023

This should be fixed next time you pull for updates from the plugin. Feel free to re-open this if you still face the issue.

@Noodle-Bug
Copy link

Noodle-Bug commented Nov 3, 2023

It looks like I'm still getting that issue on v0.1.3

image

@amitds1997
Copy link
Owner

Could you share the output of :RemoteLog?

@amitds1997 amitds1997 reopened this Nov 3, 2023
@Noodle-Bug
Copy link

Noodle-Bug commented Nov 3, 2023

Here is the contents of the log (I've replaced some identifiable information with |domain| |username| and |hostname|)

Some additional information: I'm on Windows (powershell) using password auth

ERROR 11/1/2023 12:09:06 PM C:/Users/NoodleBug/AppData/Local/nvim-data/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\SYSTEM32\cmd.exe��[?25h
|username|@|hostname| : The term '|username|@|hostname|' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:1
+ |username|@|hostname| uname
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (|username|@|hostname|:String) [], CommandNotFoundExc 
   eption
    + FullyQualifiedErrorId : CommandNotFoundException
ERROR 11/2/2023 11:36:56 AM AppData\Local\nvim-data\lazy\remote-nvim.nvim\lua\remote-nvim\providers\provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe��[?25h
|username|@|hostname| : The term '|username|@|hostname|' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:1
+ |username|@|hostname| uname
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (|username|@|hostname|:String) [], CommandNotFoundExc 
   eption
    + FullyQualifiedErrorId : CommandNotFoundException
ERROR 11/3/2023 11:44:55 AM C:/Users/NoodleBug/AppData/Local/nvim-data/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe��[?25h
uname : The term 'uname' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path 
is correct and try again.
At line:1 char:1
+ uname
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (uname:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
ERROR 11/3/2023 11:45:28 AM C:/Users/NoodleBug/AppData/Local/nvim-data/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|domain|/|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe��[?25h
uname : The term 'uname' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path 
is correct and try again.
At line:1 char:1
+ uname
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (uname:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

@amitds1997
Copy link
Owner

amitds1997 commented Nov 3, 2023

The plugin is not tested on Windows OS currently. I did not have access to a Windows machine so this was not possible but this is something I plan to work on soon. So, it failing is kind of expected, sorry.

Please open a new issue and I would try to look into this on priority.

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.

3 participants