xpipe-io / xpipe

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

"Shell opener was stuck in loop" when connecting from Windows 11 to Proxmox via SSH #360

Closed bigsby-exe closed 1 month ago

bigsby-exe commented 1 month ago

When connecting via Windows 11 to Proxmox via SSH I get a connection but I get an error when trying to identify services with the following message:

Shell opener was stuck in loop:
Linux elliot 6.8.4-3-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-3 (202
Linux elliot 6.8.4-3-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-3 (2024-05-02T11:55Z) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

[38;5;203m ������������������

This goes on like this for some time before ending in

[38;5;203m������������������������ ������������������  ������������������  ������   ������ ������������������������������   ������������������  ������   [38;5;63

-bash: line 2: $'\r': command not found

image

I have tried getting the command executed by via the 'Insights' button on the add connection dialog and pasting that into cmd.exe and this works fine image I have also tried setting the gateway to Powershell.exe

Any ideas where I am going wrong?

bigsby-exe commented 1 month ago

Just to add I have read #290 and it seems like a similar issue, the output of ssh-add -l for me is as follows:

bigsby > ssh-add -l
Error connecting to agent: No such file or directory

but sshing from PowerShell or cmd.exe prompt works fine (ssh user@host)

crschnick commented 1 month ago

So the issue I can see so far is that there are ANSI escape sequences in your terminal output. XPipe connects to your system without a tty, so there shouldn't be any. That might confuse XPipe and make it think that it is stuck in a loop. Are you using any kind of shell prompt or other shell configuration on your Proxmox system?

About the ssh-add issue, are you using the SSH agent for authentication? Because for the Proxmox system you showed it didn't use the agent. Or are we talking about a different system here?

bigsby-exe commented 1 month ago

You are completely correct I use figurine on all my systems. Weirdly xpipe didn't have an issue with it on the Ubuntu VM but did take issue to it on the Proxmox device however removing the config allows xpipe to work without any issues. Thanks

crschnick commented 1 month ago

Can you share your figurine config that broke it? That way I can try to reproduce it

bigsby-exe commented 1 month ago

Sure I have a file at /etc/profile.d/figurine.sh with the contents

#!/bin/bash

echo ""
figurine -f "3d.flf" proxmox
echo ""
crschnick commented 1 month ago

You can keep using that as long as you make it respect common variables. In this case, if $TERM is dumb, you should not execute that command.

bigsby-exe commented 1 month ago

Just tested and this is a perfect fix, thanks

crschnick commented 1 month ago

I think I was able to fix the underlying issue. Could you try https://github.com/xpipe-io/xpipe-ptb/releases/tag/12.3-3 with your init scripts while not respecting $TERM again? It should work now in any scenario

crschnick commented 1 month ago

The fix for this is now released, so you shouldn't have to adjust your profile script at all