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

macOS host: session dies as soon as I connect (transport: Error while dialing dial unix /Users/runner/.upterm/xxxxxxxxxxx.sock: connect: connection refused") #11

Open
phil-blain opened this issue Feb 22, 2022 · 7 comments

Comments

@phil-blain
Copy link

Hi!

Thanks for this action. I'm trying it out for the first time on macos-10.15 GHA runners, and as soon as I ssh from my machine, the upterm session seems to die. Locally I simply get:

$ ssh szq1wc1331uu9SXcR9DY:[email protected]
Connection closed by 157.230.199.75 port 22

and in the GitHub Actions log (example: https://github.com/phil-blain/github-actions-debug/runs/5293251543?check_suite_focus=true#step:3:96)

Creating a new session. Connecting to upterm server ssh://uptermd.upterm.dev:22
Created new session successfully
Entering main loop
=== SZQ1WC1331UU9SXCR9DY                                                                 
Command:                tmux new -s upterm -x 132 -y 43                                 

Force Command:          tmux attach -t upterm                                           
Host:                   ssh://uptermd.upterm.dev:22                                     
SSH Session:            ssh szq1wc1331uu9SXcR9DY:[email protected]

=== SZQ1WC1331UU9SXCR9DY                                                                 
Command:                tmux new -s upterm -x 132 -y 43                                 
Force Command:          tmux attach -t upterm                                           
Host:                   ssh://uptermd.upterm.dev:22                                     
SSH Session:            ssh szq1wc1331uu9SXcR9DY:[email protected]

Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /Users/runner/.upterm/szq1wc1331uu9SXcR9DY.sock: connect: connection refused"

Usage:
  upterm session current [flags]

Aliases:
  current, c

Examples:
  # Display the current session defined in $UPTERM_ADMIN_SOCKET
  upterm session current
  # Display the current session with a custom path
1
  upterm session current --admin-socket ADMIN_SOCKET_PATH

Flags:
      --admin-socket string   admin unix domain socket (required)
  -h, --help                  help for current

time="2022-02-22T18:52:18Z" level=fatal msg="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /Users/runner/.upterm/szq1wc1331uu9SXcR9DY.sock: connect: connection refused\""
@phil-blain
Copy link
Author

phil-blain commented Feb 23, 2022

  • This happens when I try to connect from macOS 10.11, 12.1, and also from Ubuntu 20.04.
  • It does not happen if I use the ubuntu-latest GHA image.
  • It also happens if I use the macos-latest GHA image.

@phil-blain phil-blain changed the title Session dies as soon as I connect (transport: Error while dialing dial unix /Users/runner/.upterm/xxxxxxxxxxx.sock: connect: connection refused") macOS host: session dies as soon as I connect (transport: Error while dialing dial unix /Users/runner/.upterm/xxxxxxxxxxx.sock: connect: connection refused") Feb 23, 2022
@phil-blain
Copy link
Author

I see that on Linux, you use a fixed version of upterm:

if (process.platform == "linux") {
await execShellCommand("curl -sL https://github.com/owenthereal/upterm/releases/download/v0.6.7/upterm_linux_amd64.tar.gz | tar zxvf - -C /tmp upterm && sudo install /tmp/upterm /usr/local/bin/")

whereas on macOS you simply install whatever upterm's Homebrew tap has:
} else {
await execShellCommand("brew install owenthereal/upterm/upterm")
.

So maybe that's caused by a regression in upterm...

@phil-blain
Copy link
Author

OK, so I forked the action and replaced the brew install above by the same curl call as for Linux, but downloading the appropriate release for macOS (upterm_darwin_amd64.tar.gz). And with that, connecting did work !

So it is definitely a regression in upterm, I would think.

@prein
Copy link

prein commented Mar 14, 2022

I run into the same issue. I would help perhaps if I could pass the version to install to the action

@lhotari
Copy link
Owner

lhotari commented Mar 22, 2022

This might be an issue with the ssh key type. See #9 for more details. There's also some notes about RSA keys in the README of upterm. The workaround is to use an Ed25519 key.

@lhotari
Copy link
Owner

lhotari commented Mar 22, 2022

Here's the example of a successful connection: https://github.com/lhotari/github-actions-debug/runs/5640278819?check_suite_focus=true#step:3:111

After the client disconnects, the log output is similar to what is described in this issue.

I tested with macos-latest, this was my workflow yaml: https://github.com/lhotari/github-actions-debug/blob/22a32d44acbcf23647eae1ef9ce31a48a8f7fbf7/.github/workflows/ci.yml

@Typraeurion
Copy link

I got this error the first time I tried it, but it turns out I hadn’t configured my SSH public key in my GitHub profile. Go to your account settings and click on “SSH and GPG keys” in the navigation bar, then click “New SSH key” and paste the contents of your ~/.ssh/id_rsa.pub file.

Unfortunately I ran into another issue:

Permission denied (publickey)

which I suspect is due to the key type not being supported as @lhotari suggested in the earlier post. Now I just need to figure out how to generate a SHA-1 or Ed25519 key…

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

No branches or pull requests

4 participants