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 resolve host for Conjure connection (IPV6?) #612

Open
ar1a opened this issue Oct 11, 2024 · 4 comments
Open

Failed to resolve host for Conjure connection (IPV6?) #612

ar1a opened this issue Oct 11, 2024 · 4 comments

Comments

@ar1a
Copy link

ar1a commented Oct 11, 2024

On windows, opening a .clj file errors out with this:

Error executing vim.schedule lua callback: ...AppData/Local/nvim-data/lazy/conjure/lua/conjure/net.lua:55: Failed to resolve host for Conjure connection
stack traceback:
	[C]: in function 'error'
	...AppData/Local/nvim-data/lazy/conjure/lua/conjure/net.lua:55: in function 'connect'
	...ocal/nvim-data/lazy/conjure/lua/conjure/remote/nrepl.lua:131: in function 'connect'
	...lazy/conjure/lua/conjure/client/clojure/nrepl/server.lua:353: in function <...lazy/conjure/lua/conjure/client/clojure/nrepl/server.lua:299>

I believe this is caused by this check:

return ("inet" == a.get(_241, "family"))

because when I run lua vim.print(vim.loop.getaddrinfo("localhost"))

it returns

9:26:52 PM msg_show   vim.print(vim.loop.getaddrinfo("localhost")) { {
9:26:52 PM msg_show   vim.print(vim.loop.getaddrinfo("localhost"))     addr = "::1",
9:26:52 PM msg_show   vim.print(vim.loop.getaddrinfo("localhost"))     family = "inet6",
9:26:52 PM msg_show   vim.print(vim.loop.getaddrinfo("localhost"))     protocol = "ip"
9:26:52 PM msg_show   vim.print(vim.loop.getaddrinfo("localhost"))   } }

where the only family returned is inet6

@Olical
Copy link
Owner

Olical commented Oct 11, 2024

Well that's odd, you can override the host with this config

*g:conjure#client#clojure#nrepl#connection#default_host*
`g:conjure#client#clojure#nrepl#connection#default_host`
When connecting to port files or via `:ConjureConnect` this is the
default host to use.
Default: `"localhost"`

So maybe setting that to a specific IP for now might help? Need to have a think about how to solve this and reproduce it without Windows though 🤔

I think there are other Windows users that I assume haven't run into this, so it could also be a specific version or configuration of Windows too I guess.

Thanks for the useful context and output of getaddrinfo! That sort of information massively helps me understand things without being able to re-produce it myself.

@ar1a
Copy link
Author

ar1a commented Oct 11, 2024

Changing that to use 127.0.0.1 gets it to connect at least! Evaluating things seem to work fine:
image
but the auto-completion provided by cmp-conjure is not present - maybe I need to set the variable before opening the buffer and not just changing it and running :ConjureConnect. I'll look at that later

will update you if I make any progress in the mean time

@ar1a
Copy link
Author

ar1a commented Oct 11, 2024

Hmm, hitting K on something like prn also produces something along the lines of

Error  12:02:42 AM msg_show.lua_error Error executing Lua callback: ...gram Files/Neovim/share/nvim/runtime/lua/vim/_system.lua:244: ENOENT: no such file or directory
stack traceback:
	[C]: in function 'error'
	...gram Files/Neovim/share/nvim/runtime/lua/vim/_system.lua:244: in function 'spawn'
	...gram Files/Neovim/share/nvim/runtime/lua/vim/_system.lua:335: in function 'system'
	C:/Program Files/Neovim/share/nvim/runtime/lua/man.lua:22: in function 'system'
	C:/Program Files/Neovim/share/nvim/runtime/lua/man.lua:263: in function 'get_path'
	C:/Program Files/Neovim/share/nvim/runtime/lua/man.lua:812: in function 'init'
	C:/Program Files/Neovim/share/nvim/runtime/lua/man.lua:824: in main chunk
	[C]: in function 'require'
	C:/Program Files/Neovim/share/nvim/runtime/plugin/man.lua:7: in function <C:/Program Files/Neovim/share/nvim/runtime/plugin/man.lua:6>
Error  12:02:52 AM msg_show.lua_error Error executing Lua callback: C:/Program Files/Neovim/share/nvim/runtime/plugin/man.lua:7: loop or previous error loading module 'man'
stack traceback:
	[C]: in function 'require'
	C:/Program Files/Neovim/share/nvim/runtime/plugin/man.lua:7: in function <C:/Program Files/Neovim/share/nvim/runtime/plugin/man.lua:6>

more windows being weird?

@Olical
Copy link
Owner

Olical commented Oct 18, 2024

Hm that error to me looks like the built in Neovim man page lookup which is the default for K in most filetypes I think? It appears to be to be trying to spawn a sub-process but the program it's trying to execute doesn't exist. Conjure doesn't do this other than when we're trying to start stdio REPLs.

So I suspect it's trying to run man and your system doesn't have it? The stack trace sadly doesn't give us all the details though so I can't really tell what it's trying to execute. I'm guessing man from the context clues of man.lua being further up the stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants