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

[Bug]: wsh not connecting #2026

Open
1 of 3 tasks
darrynlowe opened this issue Feb 25, 2025 · 0 comments
Open
1 of 3 tasks

[Bug]: wsh not connecting #2026

darrynlowe opened this issue Feb 25, 2025 · 0 comments
Labels
bug Something isn't working triage Needs triage

Comments

@darrynlowe
Copy link

Current Behavior

I have Wave installed on my Windows client and want to connect to Linux remote hosts (all running Arch).

When I connect to a headful machine, running X with Wave installed as a GUI client, everything works normally (see expected behavior block below). sshd on all remote hosts is set up with AcceptEnv * in case that matters.

However, when I connect to a headless host, I get the below:

[conndebug] trying to connect to "user@host"...
[conndebug] connectInternal user@host
[conndebug] ConnectToClient user@host (jump:0)...
[conndebug] ssh dial user@host:22
[conndebug] Password Authentication requested from connection [email protected]...
[conndebug] got password from user, sending to ssh
[conndebug] successful ssh connection to user@host:22
[conndebug] normalized knownhosts address: user@host:22
[conndebug] running tryEnableWsh...
[conndebug] wsh settings enable:true ask:true
[conndebug] running getPermissionToInstallWsh...
[conndebug] requesting user confirmation...
[conndebug] user response to allowing wsh: true
[conndebug] writing conn:wshenabled=true to connections.json
[conndebug] running OpenDomainSocketListener...
[conndebug] generated domain socket name /tmp/waveterm-7706da0d6d6d7f81.sock
[conndebug] successfully connected domain socket
[conndebug] running StartConnServer...
[conndebug] SSH-NEWSESSION (StartConnServer)
[conndebug] wrapped command:
sh -c "~/.waveterm/bin/wsh version 2> /dev/null || (echo -n \"not-installed \"; uname -sm);\
exec ~/.waveterm/bin/wsh connserver"
**[conndebug] actual connnserverversion: "                  -`"
[conndebug] got connserver version: -`
[conndebug] ERROR starting conn server: error checking wsh version: unexpected version format: -`
[conndebug] ERROR enabling wsh: error starting conn server: error checking wsh version: unexpected version format: -`**
[conndebug] will connect with wsh disabled
[conndebug] successfully connected (wsh:false)



[conndebug] start blockcontroller UUID "shell" ("user@host") (curstatus init) (force false)
[conndebug] BlockController.run() "UUID"
[conndebug] DoRunShellCommand
[conndebug] resetTerminalState: resetting terminal state
[conndebug] remoteName: "user@host", connType: ssh, wshEnabled: false, shell: "", shellType: 
[conndebug] created swaptoken: TOKEN

When I check the environment variables in the remote shell, I do not see anything for WAVETERM.

I have tried to manually install the wsh client on the remote host (and add it to the PATH), and that does get it to work from the command line. However, without the appropriate tokens set, the wsh commands all function as if they were running on the local terminal rather than the remote host. But at least that confirms that it isn't a dependency thing.

As a debugging measure, I tried running the wsh connserver manually - per the debug messages above - and I got the following:

sh -c "~/.waveterm/bin/wsh version 2> /dev/null || (echo -n "not-installed "; uname -sm);
exec ~/.waveterm/bin/wsh connserver"
wsh v0.11.0
NEED-JWT

I'm running zsh as the remote shell, but I've tried it with bash as well.

Expected Behavior

Debug message when running this on a headful remote host with Waveterm installed in the GUI works perfectly.

[conndebug] stopping blockcontroller due to conn change "user@host" => "user@host"

[conndebug] trying to connect to "user@host"...
[conndebug] connectInternal user@host
[conndebug] ConnectToClient user@host (jump:0)...
[conndebug] ssh dial user@host
[conndebug] Password Authentication requested from connection user@host...
[conndebug] got password from user, sending to ssh
[conndebug] successful ssh connection to user@host
[conndebug] normalized knownhosts address: user@host
[conndebug] running tryEnableWsh...
[conndebug] wsh settings enable:true ask:false
[conndebug] running OpenDomainSocketListener...
[conndebug] generated domain socket name /tmp/waveterm-b31b07f097584d65.sock
[conndebug] successfully connected domain socket
[conndebug] running StartConnServer...
[conndebug] SSH-NEWSESSION (StartConnServer)
[conndebug] wrapped command:
sh -c "~/.waveterm/bin/wsh version 2> /dev/null || (echo -n \"not-installed \"; uname -sm);\
exec ~/.waveterm/bin/wsh connserver"
[conndebug] actual connnserverversion: "wsh v0.11.1-beta.2"
[conndebug] got connserver version: wsh v0.11.1-beta.2
[conndebug] connserver up-to-date: false
[conndebug] connserver needs to be (re)installed
[conndebug] running installWsh...
[conndebug] running `uname -sm` to detect client platform
[conndebug] detected remote platform os:linux arch:x64
[conndebug] CpWshToRemote, timeout: 57.0770109s
[conndebug] copying "C:\\Users\\USER\\AppData\\Local\\Programs\\waveterm\\resources\\app.asar.unpacked\\dist\\bin\\wsh-0.11.1-beta.3-linux.x64" to remote server "~/.waveterm/bin/wsh"
[conndebug] successfully installed wsh
[conndebug] running StartConnServer...
[conndebug] SSH-NEWSESSION `(StartConnServer)`
[conndebug] wrapped command:
sh -c "~/.waveterm/bin/wsh version 2> /dev/null || (echo -n \"not-installed \"; uname -sm);\
exec ~/.waveterm/bin/wsh connserver"
**[conndebug] actual connnserverversion: "wsh v0.11.1-beta.3"
[conndebug] got connserver version: wsh v0.11.1-beta.3**
[conndebug] connserver up-to-date: true
[conndebug] got jwt status line: NEED-JWT
[conndebug] writing jwt token to connserver
[conndebug] connserver started, waiting for route to be registered
[conndebug] connserver is registered and ready
[conndebug] successfully connected (wsh:true)



[conndebug] start blockcontroller UUID "shell" ("user@host") (curstatus init) (force false)
[conndebug] BlockController.run() "UUID"
[conndebug] DoRunShellCommand
[conndebug] resetTerminalState: resetting terminal state
[conndebug] remoteName: "user@host", connType: ssh, wshEnabled: true, shell: "/bin/bash", shellType: bash
[conndebug] created swaptoken: TOKEN
[conndebug] using shell path detected on remote machine: /bin/bash
[conndebug] detected shell type: bash
[conndebug] swaptoken: TOKEN
[conndebug] starting shell, using command: /bin/bash --rcfile ~/.waveterm/shell/bash/.bashrc
[conndebug] SSH-NEWSESSION (StartRemoteShellProc)
[conndebug] packed swaptoken TOKEN

When I run the connserver manually, I get what I'd expect:

sh -c "~/.waveterm/bin/wsh version 2> /dev/null || (echo -n "not-installed "; uname -sm);\

exec ~/.waveterm/bin/wsh connserver"
wsh v0.11.1-beta.3
HAVE-JWT
running wsh connserver

Steps To Reproduce

Try and connect to a remote host on Arch that is headless.

Wave Version

v0.11.1-beta.3

Platform

Windows

OS Version/Distribution

Windows 11

Architecture

arm64

Anything else?

No response

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@darrynlowe darrynlowe added bug Something isn't working triage Needs triage labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs triage
Projects
None yet
Development

No branches or pull requests

1 participant