-
Notifications
You must be signed in to change notification settings - Fork 38
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
SshSession::connect_mux hangs on MacOS 14.5 #150
Comments
Usually you want to use |
@NobodyXu , thanks for the tip. Maybe you could help with a full example? This is what I have right now. It's hanging after printing "SFTP 201". If I run ps -ax | grep ssh I do see ssh -E .../.local/state/.ssh-connectionbb4jRB/log -S .../.local/state/.ssh-connectionbb4jRB/master -M -f -N -o ControlPersist=yes -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p 22 -l ... -o IdentitiesOnly=yes -I ... ssh://...
|
Connecting is quite simple: let session = SshSessionBuilder::default()
.keyfile("...")
.connect_mux(format!(
"ssh://{}@{}:{}",
&credentials.username, &credentials.host, &credentials.port
)).await?; |
It's still hanging following the example provided after SFTP 201:
|
If I run ps -ax | grep ssh I do see ssh -E .../.local/state/.ssh-connectionbb4jRB/log -S .../.local/state/.ssh-connectionbb4jRB/master -M -f -N -o ControlPersist=yes -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p 22 -l ... -o IdentitiesOnly=yes -I ... ssh://... But Rust just hangs |
I think it might be the Can you login to the remote host using ssh on cmdline? |
@NobodyXu , yes I can ssh fine using command line. |
So multiplex master is not working for some reason... Can you try connecting to the multiplex master directly, using ssh? |
@NobodyXu , yes this works: ssh -S /.../.local/state/.ssh-connectionyNAAbu/master ip |
Can you try:
Maybe it's the openssh-mux-client not working? |
@NobodyXu
|
Ok I think I misunderstood the issue. It actually stucks in We expect the It's likely not the case here. |
@justin-elementlabs if you execute this command manually, does it exit immediately or stuck? |
@NobodyXu it will run for 1-2 seconds and then return to the terminal (exit immediately) % ssh -E .../.local/state/.ssh-connectionbb4jRB/log -S .../.local/state/.ssh-connectionbb4jRB/master -M -f -N -o ControlPersist=yes -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p 22 -l ... -o IdentitiesOnly=yes -I ... ... (1-2 seconds later with no more user input...) % |
In openssh, we just wait for the procees to exit and check its status https://docs.rs/openssh/latest/src/openssh/builder.rs.html#487 Given that we are using |
Which tokio version are you using? And what is the kernel (linux or macOS)? I strongly suspect it's a bug in tokio |
[[package]] macOS 14.5 |
I recommend to update to latest tokio (1.39.2), if it still doesn't work, it could be a tokio bug, try launching that ssh command using tokio::process directly, if that stucks with tokio but not your cmdline, then it could be a tokio bug. |
@NobodyXu , upgrading tokio didn't help. I created an issue just FYI: tokio-rs/tokio#6770 |
@justin-elementlabs assuming that this is still an issue, I think it might be caused by you using |
If block_on causes it to fail, then maybe you can try |
When running the example code, Rust will print "SSH before" but fail to print "SSH after". After a while, I will see a warning about my test "has been running for over 60 seconds". It will continue hang with no error or further output.
Am I missing libraries on my machine? Are there other suggestions on how to find out what is causing this to hang? The russh crate has the same issue.
println!("SSH before"); let result = SshSession::connect_mux( format!( "ssh://{}@{}:{}", &credentials.username, &credentials.host, &credentials.port ), KnownHosts::Add, ) .await; println!("SSH after");
The text was updated successfully, but these errors were encountered: