lhotari / action-upterm Goto Github PK
View Code? Open in Web Editor NEWDebug your GitHub Actions via SSH by using upterm/tmux to get access to the runner system itself.
License: MIT License
Debug your GitHub Actions via SSH by using upterm/tmux to get access to the runner system itself.
License: MIT License
Please add a parameter to specify the session status refresh interval, I often don't need it to refresh so much and it clutters up the logs really bad.
Please add a parameter to specify the URL so that self-hosted upterm can be used.
This is awesome, thanks!
Hey, I'm trying to use the upterm action to debug some test failures, and it appears to be failing. This used to work (as of a month ago or so). I'm not hosting my own upterm server or anything, but the runs are failing like this:
=== YU0HKZGLXX4IWRUUUFRM
Command: tmux new -s upterm -x 132 -y 43
Force Command: tmux attach -t upterm
Host: ssh://uptermd.upterm.dev:22
SSH Session: ssh Yu0hKZGLXx4IWRuuufRM:[email protected]
bash: upterm: command not found
127
Given the lack of configuration options, I'm reasonably sure this isn't something I messed up somehow, unless this type of runner is no longer supported.
Any ideas?
Run lhotari/action-upterm@v1
upterm
Auto-generating ~/.ssh/known_hosts by attempting connection to uptermd.upterm.dev
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added 'uptermd.upterm.dev' (ED25519) to the list of known hosts.
Connection closed by xxx.yyy.zzz.aa port 22
Adding actor "pvonmoradi" to allowed users.
Fetching SSH keys registered with GitHub profiles: pvonmoradi
Fetched 1 ssh public keys
Creating a new session. Connecting to upterm server ssh://uptermd.upterm.dev:22
invalid option: window-size
invalid option: window-size
Error: 1
Here is the relavant parts from my yml file:
- name: Setup upterm session
uses: lhotari/action-upterm@v1
with:
## limits ssh access and adds the ssh public key for the user which
#triggered the workflow
limit-access-to-actor: true
## limits ssh access and adds the ssh public keys of the listed
#GitHub users
limit-access-to-users: pvonmoradi
I followed the instructions with a simple setup:
- name: Setup upterm session
uses: lhotari/action-upterm@v1
but when trying to connect using:
ssh XhMfjw1FxKdix4uQGdWd:[email protected]
I get the following error:
XhMfjw1FxKdix4uQGdWd:[email protected]: Permission denied (publickey).
I didn't use any authorisation options so I expected it would work just like that - but it doesn't.
I found this Upterm issue that could be related: owenthereal/upterm#93
Hey,
I'm not sure if the docs are unclear or something is wrong, but I couldn't use either limit-access-to-actor
together with limit-access-to-users
or limit-access-to-actor
by itself (introduced in #8).
The ssh command I used was:
ssh -i ~/.ssh/gh_current_key b9mSRLZzh0Br3aVNmSNE:[email protected]
b9mSRLZzh0Br3aVNmSNE:[email protected]: Permission denied (publickey).
I also tried stripping the password string, as the connection string
instruction in the docs is a little ambiguous.
ssh -i ~/.ssh/gh_current_key [email protected]
Connection closed by 157.230.199.75 port 22
To sanity check I tried doing an ssh connection test to github, which worked fine:
ssh -T -i ~/.ssh/gh_current_key [email protected]
Warning: remote port forwarding failed for listen port 2222
Hi Folcon! You've successfully authenticated, but GitHub does not provide shell access.
Not sure what the problem is or if this is an upstream issue...
The documentation talks about using the checks tab in a pull-request to determine how to access the runner via this action. However it does not explain how to do this when there is no pull-request. Can the README.md be updated to handle this case?
Hi. I'm trying to use this action, but it just fails both on macOS and Linux:
time="2020-11-27T04:15:42Z" level=fatal msg="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory\""
How can I debug/fix these problems?
Use case: I've set up my workflow to automatically run the upterm action if the job fails. This works really well, except for one thing - it causes the action not to complete for hours if there's a failure, because the upterm server just waits there. I could set timeout-minutes
on the entire step, but that will kill the terminal even if a user connects to it. Instead, I'd like it if there were a timeout-minutes
field specific to this action that terminates the action if no one SSH's to the server within that number of minutes, but keeps the terminal open if someone connects.
This is a really next github action! Thanks! It def saved my butt :)
Anyhow, wondering if there's a way to make the session password-protected in some way, so that it's not accessible (complete with any secrets present in session) from anyone following the CI run logs.
Thanks for considering!
It would be amazing, if your action could also support WSL in Windows.
I'm the creator of https://github.com/Vampire/setup-wsl and right now need to investigate some strange behavior within the WSL distribution on the Windows runner.
It would have been very nice if this action could have been used for that.
Thanks for this action, huge fan, have used a number of times when debugging workflows.
Stupid question: Once connected, the upterm screen appears locked to the current line count - is there some way to scroll-up or see line history when a command produces multiple screens of output?
Now that I'm typing this i guess I could pipe the output to more
.
It would be wonderful to scp files between the remote host and workstations.
Here the action log
When I re-ran my action, the process freezes on "/home/runner/.ssh/id_rsa already exists.
Overwrite (y/n)? "
Have searched for a way around this but cannot find in documentation.
This action is failing to launch the upterm host, when using my custom uptermd server.
My custom server itself is working (both with ssh and ws protocols) when I try to connect from my terminal.
This is the failed action log (for my last ws attempt; using ssh results in a similar log):
2022-05-28T15:41:27.1593300Z Secret source: Actions
2022-05-28T15:41:27.1594079Z Prepare workflow directory
2022-05-28T15:41:27.2941208Z Prepare all required actions
2022-05-28T15:41:27.3150184Z Getting action download info
2022-05-28T15:41:27.5609560Z Download action repository 'lhotari/action-upterm@v1' (SHA:d23c2722bdab893785c9fbeae314cbf080645bd7)
2022-05-28T15:41:28.4010066Z ##[group]Run lhotari/action-upterm@v1
2022-05-28T15:41:28.4010419Z with:
2022-05-28T15:41:28.4010662Z limit-access-to-actor: true
2022-05-28T15:41:28.4010938Z limit-access-to-users: CarloDePieri
2022-05-28T15:41:28.4011343Z upterm-server: ws://***:80
2022-05-28T15:41:28.4011728Z GITHUB_TOKEN: ***
2022-05-28T15:41:28.4011947Z env:
2022-05-28T15:41:28.4012131Z is_cron: false
2022-05-28T15:41:28.4012338Z ##[endgroup]
2022-05-28T15:41:29.0131355Z upterm
2022-05-28T15:41:29.0131993Z
2022-05-28T15:41:29.3917240Z Auto-generating ~/.ssh/known_hosts by attempting connection to uptermd.upterm.dev
2022-05-28T15:41:29.6491930Z Pseudo-terminal will not be allocated because stdin is not a terminal.
2022-05-28T15:41:29.6492275Z
2022-05-28T15:41:29.7888068Z Warning: Permanently added 'uptermd.upterm.dev' (ED25519) to the list of known hosts.
2022-05-28T15:41:29.7888373Z
2022-05-28T15:41:29.8048808Z Connection closed by *** port 22
2022-05-28T15:41:29.8049254Z
2022-05-28T15:41:29.8109578Z Adding actor "CarloDePieri" to allowed users.
2022-05-28T15:41:29.8123618Z Fetching SSH keys registered with GitHub profiles: CarloDePieri
2022-05-28T15:41:30.0561924Z Fetched 3 ssh public keys
2022-05-28T15:41:30.0562557Z Creating a new session. Connecting to upterm server ws://***:80
2022-05-28T15:41:32.2601272Z Created new session successfully
2022-05-28T15:41:33.2618623Z Entering main loop
2022-05-28T15:41:33.2735134Z Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory"
2022-05-28T15:41:33.2735882Z
2022-05-28T15:41:33.2736901Z Usage:
2022-05-28T15:41:33.2737397Z upterm session current [flags]
2022-05-28T15:41:33.2737782Z
2022-05-28T15:41:33.2827031Z Aliases:
2022-05-28T15:41:33.2827320Z current, c
2022-05-28T15:41:33.2827468Z
2022-05-28T15:41:33.2827548Z 1
2022-05-28T15:41:33.2829383Z Examples:
2022-05-28T15:41:33.2829691Z # Display the current session defined in $UPTERM_ADMIN_SOCKET
2022-05-28T15:41:33.2831313Z upterm session current
2022-05-28T15:41:33.2831980Z # Display the current session with a custom path
2022-05-28T15:41:33.2833909Z upterm session current --admin-socket ADMIN_SOCKET_PATH
2022-05-28T15:41:33.2834122Z
2022-05-28T15:41:33.2834219Z Flags:
2022-05-28T15:41:33.2835429Z --admin-socket string admin unix domain socket (required)
2022-05-28T15:41:33.2835824Z -h, --help help for current
2022-05-28T15:41:33.2837029Z
2022-05-28T15:41:33.2837849Z time="2022-05-28T15:41:33Z" level=fatal msg="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory\""
2022-05-28T15:41:33.2838210Z
2022-05-28T15:41:33.3168761Z Cleaning up orphan processes
2022-05-28T15:41:33.3590362Z Terminate orphan process: pid (1695) (tmux: server)
2022-05-28T15:41:33.3659997Z Terminate orphan process: pid (1696) (upterm)
And this is the server log:
root@myserver:~/upterm/build# ./uptermd --ws-addr 0.0.0.0:80
INFO[0000] starting server app=uptermd network=mem network-opt="[]" node-addr="127.0.0.1:2222" ssh-addr="127.0.0.1:2222" ws-addr="[::]:80"
INFO[0250] dialing sshproxy sshd app=uptermd com=ws-sshproxy-dialer host=runner network=mem network-opt="[]" node-addr="127.0.0.1:2222" ssh-addr="127.0.0.1:2222" sshproxy-addr="127.0.0.1:2222" ws-addr="[::]:80"
ERRO[0253] error piping app=uptermd com=ws-proxy error="readfrom tcp 127.0.0.1:56024->127.0.0.1:2222: websocket: close 1006 (abnormal closure): unexpected EOF" network=mem network-opt="[]" node-addr="127.0.0.1:2222" ssh-addr="127.0.0.1:2222" ws-addr="[::]:80"
And this is the action config:
- name: Setup upterm session
uses: lhotari/action-upterm@v1
with:
limit-access-to-actor: true
limit-access-to-users: CarloDePieri
upterm-server: ws://${{ secrets.UPTERM_SERVER }}:80
The action does work when using the default upterm server.
EDIT: taking a quick look at the code I see that from here
Line 56 in d23c272
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\""
Error when using lhotari/action-upterm
, was working yesterday, not sure what went wrong.
Run lhotari/action-upterm@v1
upterm
Auto-generating ~/.ssh/known_hosts by attempting connection to uptermd.upterm.dev
Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh: connect to host uptermd.upterm.dev port 22: Network is unreachable
Creating a new session. Connecting to upterm server ssh://uptermd.upterm.dev:22
Created new session successfully
Entering main loop
Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory"
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
upterm session current --admin-socket ADMIN_SOCKET_PATH
Flags:
--admin-socket string admin unix domain socket (required)
-h, --help help for current
time="[20](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:21)[22](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:23)-09-15T[23](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:24):[20](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:21):01Z" level=fatal msg="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory\""
1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.