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

Mac/Linux to Windows Connection | Shell opener command was unsuccessful: client_loop: send disconnect: Broken pipe #235

Closed
yottoya opened this issue Apr 23, 2024 · 8 comments

Comments

@yottoya
Copy link

yottoya commented Apr 23, 2024

Hello! Really enjoying this software! It's a part of my daily workflow at this point, and I love how it seamlessly works with everything... except, as usual, WINDOWS!


My Specs

  • OS
    • MacOS M1 Sonoma 14.4.1
  • Set Terminal
    • Warp

Main Issue:

  • Every time I try to manually add my Windows 11 PC inside Xpipe as a new New > Remote Host > Simple SSH Connection, and add in the necessary fields with the proper fields: Host, Port, User, Password Authentication AND the Key-based authentication Identity File, and click to create the connection, a window pops-up and says:

Error:

Shell opener command was unsuccessful:
client_loop: send disconnect: Broken pipe

The initial and 1st Log file entry for this error:

00:41:37:409 - error: Shell opener command was unsuccessful:
Warning: Permanently added '192.168.2.2' (ED25519) to the list of known hosts.

client_loop: send disconnect: Broken pipe
io.xpipe.core.process.ProcessOutputException: Shell opener command was unsuccessful:
Warning: Permanently added '192.168.2.2' (ED25519) to the list of known hosts.

client_loop: send disconnect: Broken pipe
	at io.xpipe.core.process.ProcessOutputException.withPrefix(ProcessOutputException.java:29)
	at io.xpipe.ext.proc.util.d.a(SourceFile:277)
	at io.xpipe.ext.proc.k.m(SourceFile:1484)
	at io.xpipe.ext.proc.ssh.q.m(SourceFile:51)
	at io.xpipe.ext.proc.k.y(SourceFile:404)
	at io.xpipe.ext.proc.k.start(SourceFile:233)
	at io.xpipe.core.store.ShellStore.validate(ShellStore.java:31)
	at io.xpipe.app.storage.DataStoreEntry.validateOrThrow(DataStoreEntry.java:438)
	at io.xpipe.app.comp.store.StoreCreationComp.lambda$finish$16(StoreCreationComp.java:282)
	at io.xpipe.app.util.ThreadHelper.lambda$wrap$0(ThreadHelper.java:19)
	at java.lang.VirtualThread.run(VirtualThread.java:309)

Every subsequent Log file entry for this error for this connection:

00:42:15:919 - error: Shell opener command was unsuccessful:
client_loop: send disconnect: Broken pipe
io.xpipe.core.process.ProcessOutputException: Shell opener command was unsuccessful:
client_loop: send disconnect: Broken pipe
	at io.xpipe.core.process.ProcessOutputException.withPrefix(ProcessOutputException.java:29)
	at io.xpipe.ext.proc.util.d.a(SourceFile:277)
	at io.xpipe.ext.proc.k.m(SourceFile:1484)
	at io.xpipe.ext.proc.ssh.q.m(SourceFile:51)
	at io.xpipe.ext.proc.k.y(SourceFile:404)
	at io.xpipe.ext.proc.k.start(SourceFile:233)
	at io.xpipe.core.store.ShellStore.validate(ShellStore.java:31)
	at io.xpipe.app.storage.DataStoreEntry.validateOrThrow(DataStoreEntry.java:438)
	at io.xpipe.app.comp.store.StoreCreationComp.lambda$finish$16(StoreCreationComp.java:282)
	at io.xpipe.app.util.ThreadHelper.lambda$wrap$0(ThreadHelper.java:19)
	at java.lang.VirtualThread.run(VirtualThread.java:309)
  • I have ensured that my ~/.ssh/config file is set up 100% properly.

  • I can use ssh -i ~/.ssh/windows11 myWindowsUser@192.168.2.2 in Warp terminal, and it works fine, and I am launched into cmd.exe on my Windows 11 PC.

  • However, I cannot seem to add this to Xpipe without it resulting in the above error.

  • Every other system I connect to, which is all Linux, works fine, except when connecting to Windows.


Much appreciated with any assistance at your earliest convenience! 🙏

@crschnick
Copy link
Contributor

I assume that you are running the latest xpipe version? As a quick test, you can run the latest PTB build as there were many ssh changes: https://github.com/xpipe-io/xpipe-ptb

If that does not work, you can try running ssh -i ~/.ssh/windows11 myWindowsUser@192.168.2.2 -T and see whether that reproduces it. Note that if you run an ssh command in warp, it does run through the warp wrapper. I.e. you're not directly executing your local ssh client: https://docs.warp.dev/features/ssh. So you should try that in another terminal.

You can also try running the latest Windows SSH server from https://github.com/PowerShell/openssh-portable. One issue is that the SSH distribution included in windows is quite old, that has caused a few issues before.

@yottoya
Copy link
Author

yottoya commented Apr 23, 2024

Appreciate the quick response!

So, just now, I did the following:

  1. I downloaded the latest xpipe-ptb build, and resynced my linux connections, which got added perfectly no problem.

  2. I tried to add the Windows 11 PC as a connection in xpipe-ptb, and it threw back the same error.

  3. I totally understand what you mean by warp's wrapper because it doesn't work well when connecting to Windows.

    • So, in the regular terminal app, I ran ssh -i ~/.ssh/windows11 myWindowsUser@192.168.2.2 -T, and it threw back this error:

      • client_loop: send disconnect: Broken pipe
    • I also ran ssh -i ~/.ssh/windows11 myWindowsUser@192.168.2.2 -T in warp, and it also threw back this same error.

  4. I definitely have that exact OpenSSH installed, exactly for the reason you stated! 😬

@crschnick
Copy link
Contributor

So it seems to have something to do with the -T switch, i.e. the disabled pseudo terminal. You can try solutions listed in here:

I can successfully connect to my Windows systems, so can't reproduce that.

If you have WSL on the windows host, you can try running an SSH server in WSL instead.

@yottoya
Copy link
Author

yottoya commented Apr 24, 2024

Mannnnnnn I feel like nothing works for me the first time correctly, ever… 😢

As you fore-stated, none of these proposed solutions worked (for me)...

Solution Worked? Link
Didn't Work (for me) PowerShell/Win32-OpenSSH#1873
Didn't Work (for me) https://unix.stackexchange.com/questions/602518/ssh-connection-client-loop-send-disconnect-broken-pipe-or-connection-reset

This might be useful to you to mention, but when I try to add the Windows 11 PC as a Remote SSH connection, and it fails and throws back the Shell opener command was unsuccessful: client_loop: send disconnect: Broken pipe, I click the "insights" on the bottom left, and I take the command that xpipe would've executed, I executed it in my terminal, and I was able to successfully SSH in:

ssh "windows11" -oStrictHostKeyChecking=accept-new -oRemoteCommand=none -oNoHostAuthenticationForLocalhost=yes -t

I think the only solution is transitioning completely over to Linux, forever.

This issue can be closed out because if Windows connections work for you, and no one else has brought this up, it might just be something odd on my Windows 11 system not allowing me to connect.

Thanks for your super quick assistance @crschnick ! I appreciate that more than anything else 🙏

@crschnick
Copy link
Contributor

Let me try my Windows 11 laptop, I only used it on Windows 10.

The insights work because that is what is executed to launch a terminal with -t. The first connection by xpipe is made in the background with the -T switch. I guess you can try running ssh user@host -T -vvv to get some more output.

@crschnick
Copy link
Contributor

After spending some time trying to set up key-based authentication on windows, I gave up. It's honestly not worth it.

Note that you can still launch the connection from xpipe (I just can't do other stuff like the file browser) in the XPipe 9 PTB, if you enable the don't interact with systems setting for the connection. You should find that

@yottoya
Copy link
Author

yottoya commented Apr 24, 2024

Yeah, windows is on its last legs with me, and most definitely, it's not worth it.

Looks like I found a reason to go fully Linux.

Closing out this ticket!

@crschnick
Copy link
Contributor

if you still have your window system, you can try this: #257 (comment)

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

No branches or pull requests

2 participants