-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
How can I tell cider to establish a direct connection? #1142
Comments
I noticed that if I add an entry in /etc/hosts, I can workaround the issue. |
@vspinu Can you take a look at this? |
The output is incomplete. Unless you set |
Oups. Need not be. Your problem happens even before
Yes. We are currently relying on tramp for a list of known ssh hosts. I think we should limit that list to hosts explicitly declared in .ssh/config. |
Or maybe we should simply have a list of an internal list of hosts maintained by CIDER. This will produce the most accurate results long-term. |
That would burden users with keeping two imilar configuration lists. There is no harm in reading The problem is not that much that we are reading config files but that we are trying to be smart and detect all running instances of nrepl on the remote server. For that we need to call ps through tramp on the remote. We have Let's enhance I am not sure how well this will play with ssh tunneling. Let me propose a simple patch first and then we see if we want to go further. |
I have never used
Explicit beats implicit. I'm guessing we can just drop everything smart and simply this process.
Aren't those unrelated? |
You can connect through ssh either by specifying the whole command like
and provide password each time you connect or you can put
into your config and not be prompted for password each time. People who use ssh remotes always have configuration. It's global and every program will use it. Tramp uses it. Cider's SSH tunneling is using it. You don't want a separate configuration for cider only.
This is what tramp does and we are piggybacking on tramp for a reason.
Yes. Tramp and ssh configuration are explicit enough. We just have to document this in Cider's doc. Maybe on this occasion.
User has decided on this by placing an entry to
No. Tunneling relies on tramp which uses ssh which in turn uses its config file or |
@timothypratley, any particular reason of why you have an entry in There is a big advantage of using ssh. Cider will provide completion for ports of all running nREPLs on the remote. |
I use ssh like all the time, but I simply use the same key on all hosts. Everything else seems like an overkill to me.
Maybe. The problem with the current functionality is that it's super confusing for some people. It's confusing even for me to some extent - we use the ssh config just to find out a remote nrepl port. Doesn't seem either right or expected.
Yeah, but there's no indication that a host in the ssh config is a host running an nREPL server.
I'm aware of this. What I meant is that we probably shouldn't be putting |
Security advantages and port completion aside, it boils down to people not expecting this. I think at the very least we should prompt them that we can establish an |
I have Vagrant hosting several Docker containers. The nrepl is in the Docker container. The entry in known_host is there because of Vagrant setup, but is not enough to reach the Docker container.
but the /etc/hosts entry allows me to connect. |
So you like to type the whole user@host-name each time you connect? Or how does it work for you more concretely? Do you open a remote file or dired each time, and then cider-connect?
Port completion is supposed to be only the first step. As tunneling happens through ssh anyways, theoretically we end up connecting through ssh either way. This is not true for @timothypratley's because of his rather unusual setup. The ssh connection seems to happen behind tramp's back through Vagrant setup. I am not familiar with Vagrant and unfortunately don't have time to investigate that right now.
Yes. Port completion is clearly unnecessary in this case. I am fixing this right away. No sniffing should happen when port is present. |
…known-endpoints entry
…n cider-known-endpoint
…n cider-known-endpoint
…n cider-known-endpoint
…n cider-known-endpoint
Usually I'm using my own user on the remote machines. In the other cases I either type user@host or create handy shell aliases. Anyways, I see your point. I'm just saying that you can't assume everyone is working like you. I've worked with plenty of people using my workflow.
I don't really connect to prod servers with CIDER - doing serious changes to prod seems pretty reckless to me and to inspect the local state of the system I don't really need more than a basic REPL. The fact that I don't use this functionality is the primary reason I didn't pay much attention to it when it was originally proposed. |
…n `cider-known-endpoints`
…n `cider-known-endpoints`
…n `cider-known-endpoints`
…n `cider-known-endpoints`
[Fix #1142] Don't sniff for ports when port is present in cider-known-endpoint
What was the ultimate resolution here? It's hard to tell from the commit. People on my team are still seeing Are there docs somewhere that explain this behavior and how to work around it when it isn't desired? For the record, I agree with @bbatsov that this is unexpected behavior. |
Regretfully I am not developing in clojure anymore and not using Cider. So I am not sure I would be the best person to look at it again. I see three straightforward solutions:
|
@cap10morgan You can file a new ticket and we can continue the discussion there. |
P.S. I'd generally go for option 3. |
OSX Yosemite 10.10.3
cider 20150617.753
Previously I could type C-c M-c
Cider would prompt me for Host:
I could type:
dockerized.foo.com
the it would prompt me for
port
and I could connect.Now it tries to establish an xssh connection as soon as I enter the host.
Password for /sshx:local-trek.outpace.com:
Here is my messages output:
Tramp: Opening connection for local-trek.outpace.com using sshx... Tramp: Sending command
exec ssh -o ControlMaster=auto -o ControlPath='tramp.%r@%h:%p' -o ControlPersist=no -e none -t -t local-trek.outpace.com /bin/sh'Tramp: Waiting for prompts from remote shell...
Tramp: Sending password`
The text was updated successfully, but these errors were encountered: