xpipe-io / xpipe

Your entire server infrastructure at your fingertips
https://xpipe.io
Apache License 2.0
3.42k stars 88 forks source link

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

Closed yottoya closed 6 months ago

yottoya commented 6 months ago

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

Main Issue:

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)
crschnick commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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) https://github.com/PowerShell/Win32-OpenSSH/issues/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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

if you still have your window system, you can try this: https://github.com/xpipe-io/xpipe/issues/257#issuecomment-2096945084