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

I can successfully connect to a remote server using oil-ssh but ... #521

Open
3 tasks done
EmmaLa opened this issue Nov 25, 2024 · 5 comments
Open
3 tasks done

I can successfully connect to a remote server using oil-ssh but ... #521

EmmaLa opened this issue Nov 25, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@EmmaLa
Copy link

EmmaLa commented Nov 25, 2024

Did you check the docs and existing issues?

  • I have read the docs
  • I have searched the existing issues

Neovim version (nvim -v)

NVIM v0.10.1

Operating system/version

Ubuntu 16.04

Describe the bug

I can without any problem connect to a remote server using oil-ssh, but when i try to open and edit a file, i'm getting this error displayed on the buffer :

ssh: Could not resolve hostname scp: Name or service not known

To connect to the remove server at the beginning i was using a password, but after that i used my ssh key to connect to the remote server without having to type my password everytime, but the problem is the same in both cases.

When trying to connect and using a regular vim it works.

When i tried to reproduce the issue with the lua provided on the bug report form, looks like that the oil-ssh command was not available.

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. Run : nvim oil-ssh://Username@IP/
  2. Select a file and type enter to edit it
  3. See the error message : "ssh: Could not resolve hostname scp: Name or service not known"

Expected Behavior

I was expecting to have the selected file to be opened and displayed on the buffer

Directory structure

No response

Repro

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
        "stevearc/oil.nvim",
        config = function()
            require("oil").setup({
              -- add any needed settings here
            })
        end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Did you check the bug with a clean config?

  • I have confirmed that the bug reproduces with nvim -u repro.lua using the repro.lua file above.
@EmmaLa EmmaLa added the bug Something isn't working label Nov 25, 2024
@stevearc
Copy link
Owner

It sounds like scp is having some trouble with the command used to download the remote file. Hard to say what that could be without seeing it. Could you update oil.nvim and try again? I just pushed a change that will include the raw scp command in the error output so we will have more to work with.

@stevearc stevearc added the question Further information is requested label Nov 25, 2024
@EmmaLa
Copy link
Author

EmmaLa commented Nov 26, 2024

It sounds like scp is having some trouble with the command used to download the remote file. Hard to say what that could be without seeing it. Could you update oil.nvim and try again? I just pushed a change that will include the raw scp command in the error output so we will have more to work with.

Hello here is the error that i'm getting :

Error running command 'scp -C scp://[email protected]/%2Fhome%2Fxxxxxx%2Fmain.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY'

I just hide the my user name with xxxxxx and the IP address is a fake one even if it's a local one, all the rest is from the original error displayed.

So i guess is enough information to confirm the issue ?

@github-actions github-actions bot removed the question Further information is requested label Nov 26, 2024
@stevearc
Copy link
Owner

Oh wow I just noticed that you're on a super old version of Ubuntu. That's probably going to have something to do with it, but we can probably get it working. The issue right now is that the scp command is throwing an error. It works with my version of scp, so I can't directly debug. Can you:

  • try running that scp command directly in your shell to see if it produces the same error?
  • if so, can you try to use the man pages for your version to come up with an invocation that does work? I suspect that the issue might be that your version doesn't support the -C argument.

@stevearc stevearc added the question Further information is requested label Nov 27, 2024
@EmmaLa
Copy link
Author

EmmaLa commented Nov 27, 2024

Oh wow I just noticed that you're on a super old version of Ubuntu. That's probably going to have something to do with it, but we can probably get it working. The issue right now is that the scp command is throwing an error. It works with my version of scp, so I can't directly debug. Can you:

  • try running that scp command directly in your shell to see if it produces the same error?
  • if so, can you try to use the man pages for your version to come up with an invocation that does work? I suspect that the issue might be that your version doesn't support the -C argument.

So this is not working :

  • scp -C scp://[email protected]/%2Fhome%2Fxxxxxx%2Fmain.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY
  • scp -C scp://[email protected]:/%2Fhome%2Fxxxxxx%2Fmain.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY
  • scp -C [email protected]/%2Fhome%2Fxxxxxx%2Fmain.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY
  • scp -C [email protected]//home/xxxxxx/main.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY
  • scp -C [email protected]/home/xxxxxx/main.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY

To make it work i had to make it like that (and this is how i usually use scp, but i might probably be use to it like that because of this old system):
scp -C [email protected]:/home/xxxxxx/main.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY

So looks like it doesn't like the "%2F" and the "scp://" prefix in front of the username, and i need to add this ":" character just after the IP address.

So on your end you run scp with something like that and it works ?
scp -C scp://[email protected]//home/xxxxxx/main.yml /tmp/.repro//cache/nvim/oil/ssh_ZjKoqY

@github-actions github-actions bot removed the question Further information is requested label Nov 27, 2024
@stevearc
Copy link
Owner

Yes, it looks like the URI format for scp targets was added in OpenSSH 7.7, which was released on April 1 2018. Is there...any way you can upgrade to a newer version of OpenSSH?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants