GithubHelp home page GithubHelp logo

mxschmitt / action-tmate Goto Github PK

View Code? Open in Web Editor NEW
2.7K 16.0 275.0 1.18 MB

Debug your GitHub Actions via SSH by using tmate to get access to the runner system itself.

Home Page: https://mxschmitt.github.io/action-tmate/

License: MIT License

JavaScript 100.00%
github-actions github-action tmate ssh debugging actions hacktoberfest

action-tmate's Introduction

Hi 👋, I'm Max

Open Source enthusiast, security researcher and full stack web developer from Germany / Berlin.

Blogs posts

django docker gcp git go javascript kubernetes linux mongodb nextjs nginx nodejs php postgresql python rabbitMQ react typescript

mxschmitt

 mxschmitt

mxschmitt mx_schmitt https://www.linkedin.com/in/max-schmitt/ mxschmitt

action-tmate's People

Contributors

chenrui333 avatar dave-gray101 avatar dependabot[bot] avatar dscho avatar hedingber avatar itrooz avatar jacobtomlinson avatar joehorsnell avatar joeyparrish avatar maratori avatar mariocynicys avatar muzimuzhi avatar mxschmitt avatar parkerduckworth avatar seemethere avatar ssiccha avatar steve21168 avatar umegaya avatar vadz avatar whywaita avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-tmate's Issues

Typing in Console with v1.0.1 Fails in Linux

Thanks for the great Action! ❤️

It looks like v1.0.1 was released to support macOS. I tried upgrading to this version, and launched the action with ubuntu-latest. Once I ssh'ed in to the server, there was no response to typing visible. I tried restarting the build and tried again, and same result. As soon as I went back v1.0, everything started working great again.

"unknown command: -a" introduced by 03e13f

It seems that 03e13f1 introduces a bug.

This configuration:

      - name: Setup tmate session
        uses: mxschmitt/action-tmate@03e13f10cd0b4e4d7002dbb0f55e7dd92b7fb9d6
        with:
          limit-access-to-actor: true

Gives this error:

Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
Hit:2 http://azure.archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:6 https://packages.microsoft.com/repos/azure-cli focal InRelease [10.4 kB]
Get:7 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [10.5 kB]
Hit:8 https://storage.googleapis.com/bazel-apt stable InRelease
Get:9 https://packages.cloud.google.com/apt cloud-sdk InRelease [6739 B]
Ign:12 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
Hit:13 https://download.mono-project.com/repo/ubuntu stable-focal InRelease
Hit:10 https://cli-assets.heroku.com/apt ./ InRelease
Hit:14 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release
Get:11 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [9383 B]
Hit:15 http://ppa.launchpad.net/apt-fast/stable/ubuntu focal InRelease
Hit:16 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
Hit:17 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04  InRelease
Ign:19 https://dl.bintray.com/sbt/debian  InRelease
Hit:20 https://dl.yarnpkg.com/debian stable InRelease
Hit:21 http://ppa.launchpad.net/hvr/ghc/ubuntu focal InRelease
Hit:22 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
Get:23 https://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease [81.6 kB]
Get:24 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1082 B]
Hit:18 https://packagecloud.io/github/git-lfs/ubuntu focal InRelease
Get:25 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [890 kB]
Get:26 http://azure.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [207 kB]
Get:27 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [12.9 kB]
Get:28 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [171 kB]
Get:29 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [25.3 kB]
Get:30 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [755 kB]
Get:31 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [159 kB]
Get:32 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [16.4 kB]
Get:33 https://dl.bintray.com/sbt/debian  Release [815 B]
Get:34 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [574 kB]
Get:35 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [120 kB]
Get:36 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [7376 B]
Get:37 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [148 kB]
Get:38 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [21.6 kB]
Get:39 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [550 kB]
Get:40 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [81.2 kB]
Get:41 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [10.6 kB]
Get:42 https://packages.microsoft.com/repos/azure-cli focal/main amd64 Packages [4850 B]
Get:43 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [61.8 kB]
Get:44 https://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages [166 kB]
Get:46 https://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages [191 kB]
Fetched 4619 kB in 4s (1091 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
openssh-client is already the newest version (1:8.2p1-4ubuntu0.2).
xz-utils is already the newest version (5.2.4-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
unknown command: -a
Error: Error: 1

Using the previous version works:

      - name: Setup tmate session
        uses: mxschmitt/action-tmate@27157456061cf7becf3fddfea1d2762d78ce73b8
        with:
          limit-access-to-actor: true

I would say that line 78 03e13f1#diff-bfe9874d239014961b1ae4e89875a6155667db834a410aaaa2ebe3cf89820556R78 is to blame

xz-utils is a required package

Builds within a minimal Debian/Ubuntu container require that xz-utils is installed for unpacking the tmate static binary.

[Feature] Continue workflow after tmate

It would really help my debugging flow if there was a way to close the tmate session such that GitHub would consider the action completed successfully and continue with the workflow, so that you could hook multiple inspection points into a workflow

I saw #4, but the recommendation there only covers aborting the whole workflow. I've tried sending process signals to tmate but nothing gets github to keep going

Could whatever code wraps around launching tmate be set up to receive USR1 or USR2 as a signal to complete the action and continue the workflow?

Not possible to use a custom tmate host

I have the following in a github action:

jobs:
  debug:
    runs-on: ubuntu-latest
    steps:
      - uses: mxschmitt/action-tmate@v3
        with:
          limit-access-to-actor: true
          tmate-server-host: tmate.example.com
          tmate-server-port: 22
          tmate-server-rsa-fingerprint: "..."

The action rejects this configuration with:

Error: Error: Invalid value for 'tmate-server-host': 'tmate.example.com'

My javascript is a little rusty, but isn't this expression...

  if (/^[-.+A-Za-z0-9]*$/.test(value)) {
    throw new Error(`Invalid value for '${key}': '${value}'`);
  }

...going to reject all valid values? That looks like it rejects everything that consists only of alphanumerics, -, +, and ..

Support RHEL/CentOS and Fedora containers

Symlinking /bin/apt-get to /bin/true is a sufficient hack for the action to work with RHEL/CentOS and Fedora containers, provided that any dependencies are satisfied in advance, e.g. installing xz on Fedora.

If RPM support is not a priority then maybe the action should ignore failures in apt-get to avoid the need for the above hack.

Package update needed

At first, thanks a lot for this action.

When including action-tmate as a step, it fails on an ubuntu-latest for me because of failing installs. Running sudo apt-get update in a previous step solves this issue for me.
Thus, perhaps updating the packages first should be included.

is there any way to run tmate using the standard MSYS2 environment set by msys2/setup-msys2@v2?

I running into a difficult situation where my action runs on windows using msys2/setup-msys2@v2, but tmate runs it's own mingw enviroment.

I'm using msys2/setup-msys2@v2 pip to install pywin32, but it's failing during the build. In tmate, when I run pip install pywin32, it finds it and installs correctly.

Is there any way to run tmate using msys2/setup-msys2@v2 environment instead?

SyntaxError: Cannot use import statement outside a module

Log:

Run mxschmitt/action-tmate@master
  with:
    sudo: true
/home/runner/work/_actions/mxschmitt/action-tmate/master/lib/index.js:1
import { exitDebugSessionMessage } from "../src/helpers"
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11

Cannot use the new update to start tmate

Error: Error: ENOTDIR: not a directory, rmdir '/home/runner/work/_temp/9faafcc7-7ea5-42dc-8bc6-7067911414b4

With this CI config, I get the following error:

Run mxschmitt/action-tmate@v3
Hit:1 http://azure.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:4 https://storage.googleapis.com/bazel-apt stable InRelease
Get:5 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
Hit:6 https://cli-assets.heroku.com/apt ./ InRelease
Hit:7 https://packages.microsoft.com/repos/azure-cli focal InRelease
Get:9 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [10.5 kB]
Hit:10 https://download.mono-project.com/repo/ubuntu stable-focal InRelease
Get:11 https://packages.cloud.google.com/apt cloud-sdk InRelease [6739 B]
Ign:12 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
Get:13 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release [5377 B]
Hit:8 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
Get:14 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release.gpg [801 B]
Hit:15 http://ppa.launchpad.net/apt-fast/stable/ubuntu focal InRelease
Get:16 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:18 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease [23.8 kB]
Get:19 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [863 kB]
Ign:20 https://dl.bintray.com/sbt/debian  InRelease
Get:21 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04  InRelease [1642 B]
Get:22 http://azure.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [204 kB]
Get:23 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [12.8 kB]
Get:24 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [163 kB]
Get:25 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [24.3 kB]
Get:26 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [750 kB]
Hit:27 https://dl.yarnpkg.com/debian stable InRelease
Get:28 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4032 B]
Get:29 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [224 B]
Hit:30 http://ppa.launchpad.net/hvr/ghc/ubuntu focal InRelease
Hit:31 https://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Hit:32 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
Get:33 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1083 B]
Hit:17 https://packagecloud.io/github/git-lfs/ubuntu focal InRelease
Get:34 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [61.2 kB]
Get:35 https://dl.bintray.com/sbt/debian  Release [815 B]
Get:36 https://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages [164 kB]
Get:37 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 Packages [9029 B]
Get:38 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 Packages [6951 B]
Get:39 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04  Packages [12.5 kB]
Get:40 http://ppa.launchpad.net/git-core/ppa/ubuntu focal/main amd64 Packages [3060 B]
Get:41 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [547 kB]
Get:42 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [117 kB]
Get:43 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [7300 B]
Get:44 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [140 kB]
Get:45 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [20.6 kB]
Get:46 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [550 kB]
Fetched 4037 kB in 3s (1578 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
openssh-client is already the newest version (1:8.2p1-4ubuntu0.2).
xz-utils is already the newest version (5.2.4-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
Error: Error: ENOTDIR: not a directory, rmdir '/home/runner/work/_temp/9faafcc7-7ea5-42dc-8bc6-7067911414b4'

(Log is currently here but will likely disappear as I continue debugging this.)

Tmate sesssion step is just hanging

tmate session has been running over 5 minutes. Stuck on the bottom step. Never populating the session URL

openssh-client is already the newest version (1:8.2p1-4ubuntu0.4).
xz-utils is already the newest version (5.2.4-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 71 not upgraded.

Performance issues with `mxschmitt/action-tmate@v3`

Hello there!

I have been using the mxschmitt/action-tmate@v3 successfully for some time; however, nowadays it is impossible to get a terminal.

Preparation is dead-slow:

Thu, 10 Feb 2022 14:43:33 GMT Run mxschmitt/action-tmate@v3
...
Thu, 10 Feb 2022 14:43:43 GMT openssh-client is already the newest version (1:8.2p1-4ubuntu0.4).
Thu, 10 Feb 2022 14:43:43 GMT xz-utils is already the newest version (5.2.4-1ubuntu1).
Thu, 10 Feb 2022 14:43:43 GMT 0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.
Thu, 10 Feb 2022 14:51:50 GMT Created new session successfully
Thu, 10 Feb 2022 14:51:50 GMT ssh [email protected]
Thu, 10 Feb 2022 14:51:50 GMT
Thu, 10 Feb 2022 14:51:50 GMT Entering main loop
Thu, 10 Feb 2022 14:51:50 GMT SSH: ssh [email protected]

and after that:

$  ssh [email protected]
kex_exchange_identification: Connection closed by remote host

this happens constantly. I was wondering if you'd happen to have some insight into what could be causing this.

I'd prefer if I didn't have to host my own proxy to connect to the instances.

Make shell configurable

Is there a way to make the shell configurable by providing a path? I'm running into weird issues in debugging when using this on GitHub Actions windows-2016 because I'm not in git bash.

ssh_exchange_identification: Connection closed by remote host

Hi, Thanks for the amazing work!
I think I found a bug.

      - uses: actions/checkout@v2
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3

unlike documentation,it requires ssh key file of github user (ssh tmage... -i <my_pem_file>)
(I didn't set limit-access-to-actor)

this error happens

$ ssh [email protected]
ssh_exchange_identification: Connection closed by remote host

# (or sometimes)
kex_exchange_identification: read: Connection reset by peer

I still can access through the web browser though.

seems like something changed
I remember I could access without key exchange a month ago

Error: Invalid value for 'tmate-server-host': ''

I used mxschmitt/action-tmate with the following configuration

      - name: Setup tmate session
        uses: mxschmitt/[email protected]

I got the following error.

Error: Error: Invalid value for 'tmate-server-host': ''

ref: https://github.com/odan-sandbox/action-tmate-broken-sandbox/runs/5174243993?check_suite_focus=true

Maybe, an error because validation has been implemented.
#105

I think setting default values for each inputs such as tmate-server-host will solve this problem

[SECURITY] Alternative ways of sharing a connection string

While I also did something similar to access to other CIs, I'd like to point out that printing out such things to public logs is insecure, especially because some secrets can be exposed to that env.

I think that this action should have an option to send creds over email without exposing them publicly.

When running on windows-2019 worker: Error: ENOENT: no such file or directory, open '/tmp/tmate.bashrc' during tmate install

Workflow:

name: windows-tflite
on: [push]
defaults:
  run:
    shell: bash
jobs:
  build-tensorflow:
    runs-on: windows-2019
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: 'recursive'
      - uses: ./.github/actions/docker-login
        with:
          user: $GITHUB_ACTOR
          password: ${{ secrets.CR_PAT }}
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3

Log:

Run mxschmitt/action-tmate@v3
  with:
    sudo: true
    limit-access-to-actor: false
:: Synchronizing package databases...
downloading mingw32.db...
downloading mingw32.db.sig...
downloading mingw64.db...
downloading mingw64.db.sig...
downloading msys.db...
downloading msys.db.sig...
resolving dependencies...
looking for conflicting packages...

Packages (4) libevent-2.1.12-2  libssh-0.9.5-1  msgpack-c-3.3.0-1  tmate-2.4.0-1

Total Download Size:   0.51 MiB
Total Installed Size:  1.54 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
downloading libevent-2.1.12-2-x86_64.pkg.tar.zst...
downloading libssh-0.9.5-1-x86_64.pkg.tar.zst...
downloading msgpack-c-3.3.0-1-x86_64.pkg.tar.zst...
downloading tmate-2.4.0-1-x86_64.pkg.tar.zst...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
installing libevent...
Optional dependencies for libevent
    python: to use event_rpcgen.py [installed]
installing libssh...
installing msgpack-c...
installing tmate...
Error: Error: ENOENT: no such file or directory, open '/tmp/tmate.bashrc'

[Feature]: Skip if operating system is Windows

If I just add this step to the matrix, it crashes non-Linux workers which lead to auto-cancellation of all the jobs.

Workaround: make the action step conditional.

Fix: we could change it to be noop under mac/windows. It would be better to use homebrew to install tmate under mac, though and maybe research whether anybody hacked it to work under windows.

feat: make sudo configurable (self-hosted runners)?

For (some?) self-hosted runners not executing as superuser, the first use of action-tmate throws up a password prompt on the physical box. No way to continue/connect without being physically present at the device.

Presumably this would be fixed by removing the sudo requirement?

For reference, I'm running on a Jetson Nano, Ubuntu 18.04, at userlevel.

Incompatible with conda-incubator/setup-miniconda@v2 GitHub Action

This is a terrific tool and have used it successfully in the past to debug some complex scripts. Had to debug a problem build recently, but as soon as I connect to the build server (via url link or direct ssh in a separate terminal), the connection is terminated in less than 60 seconds. Not sure if others have experienced the same.

If it helps, here are the key config elements I am working with:

jobs:
  build:
    name: Build (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: ["ubuntu-latest"]
        python-version: ["3.8"]
        
    steps:
      - uses: actions/checkout@v2
      - uses: conda-incubator/setup-miniconda@v2
        # https://github.com/marketplace/actions/setup-miniconda
        with:
          miniconda-version: "latest"
          channels: conda-forge
          auto-update-conda: true
          python-version: 3.8
          environment-file: environment.yml  
...
      # Debugging session
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3

Specify alternative location for identity file

It would be good if you could specify an alternative location for the identity file when the ssh key gets generated.

The reason being: I'm trying to debug ssh problems within my pipeline and when the ssh key is generated by the action it conflicts with the rest of my pipeline.

For example:

- name: Setup tmate session
  uses: mxschmitt/action-tmate@v2
  with:
    name: id_rsa_tmate

Permission denied errors

Hello,

I am running the action-tmate action per the instructions, but I get this error:

Run mxschmitt/action-tmate@db65d6e9a5d44586bafd05807eef6e82d0a2e86c
Reading package lists...


E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

Considering I'm using this to debug my own stuff, I don't quite know how to debug this! Any help? Thanks in advance!

How to publish

Hey there. I am trying to play with an improvement on my fork, but I don't understand how you get the built lib directory to show up in my releases... Any advice?

Is there a better way to test without using releases?

[Feature] no sudo in centos-7 docker image...

Hi,

trying in centos-7 docker image, I get:

Run mxschmitt/action-tmate@v1
/usr/bin/docker exec f9eea0db3ac5f806e10942c6c631ff8bc9136ed60349f93f77b81b3378a1705c sh -c "cat /etc/*release | grep ^ID"
Running JavaScript Action with default external tool: node12
/bin/sh: sudo: command not found

Could there be an option to run without sudo?

Using this action caused account suspension due to TOS violation

Last week I used this action more-or-less as intended: I was having a hard time debugging my failing Actions job, so I added the lines

- name: Debug with tmate on failure
  if: ${{ failure() }}
  uses: mxschmitt/action-tmate@v3

to my script and clicked on the link in the Actions console to open a session on the Actions VM. I typed one or two commands (printing env vars and the like), disconnected, and killed the job in the console.

After doing so, my account was automatically suspended by Github for TOS violation. Since I'm the owner of my company's organization, our org was also flagged. I've spent the last week going back-and-forth with GH support, attempting to restore my account and remove the flag from our org. After 6 days, GH support finally informed me that master.tmate.io is a flagged DNS and was the reason for my account suspension.

I'm surprised no one else has experienced this issue. I'm not sure whether you can update the DNS to something allowed by GH, but this experience has scared me away from using this Action.

Unable to see tmate.io link/connection string

To get the connection string, just open the Checks tab in your Pull Request and scroll to the bottom. There you can connect either directly per SSH or via a web based terminal.

YML

I have a simple YML action workflow to try this action out

name: CI

on: [push]

jobs:
  build:

    runs-on:  ubuntu-latest
    
    steps:
    - uses: actions/checkout@v1
    
    - name: Setup tmate session
      uses: mxschmitt/action-tmate@v1

Screenshots

I have looked on the PR itself and can not find it and the streaming logs is not listing anything out for me to see the URL, only when I cancel/stop the run can I see the log output and what the tmate.io URL was.

image

image

Windows / MINGW environment

Hi,
I was able to connect to github actions server via tmate.
However, this gives me a mingw shell.
When I try to start command prompt via cmd.exe,
none of the common windows environment variables are set, like
"APPDATA", "ProgramFiles", etc.
As a result I can't run many windows applications.
How do I set the correct windows environment from the mingw command shell?

Action fails on non-x64 (self-hosted) runners

The tmate URL hard-codes amd64 as the architecture. If the runner CPU type were checked first, you could easily download an arm64 variant of the binary on arm devices.

I'll work on a PR for this. Thanks!

is there any way to access github runner(not self hosted) using tmux?

I need a requirement which i should able to access current github runner and troubleshoot issue which related to my application.

when i run any build on github runner it should run via tmux session which i should able to access that tmux session and see current running build process/logs
Tried:

  • created tmux session before current action(action-mate) later used this current action and accessed the runner. but if I do tmux ls I didn't see any session's. so does this current action would be limited to task level? or can we make this current action as runner level?

sudo: not found

Normally docker containers run using sudo so when running inside a container in a workflow the action fails not having sudo.

name: model-training
on: push
jobs:
  run:
    runs-on: [ubuntu-latest]
    container: docker://dvcorg/cml-py3:latest
    steps:
      - uses: actions/checkout@v2
      - name: cml_run
        env:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
        run: |
          pip install -r requirements.txt
          python train.py
          cat metrics.txt >> report.md
          cml-publish confusion_matrix.png --md >> report.md
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v2
Run mxschmitt/action-tmate@v2
/usr/bin/docker exec  04b4da717be66011e33fa414a42e06a919c21ce2fb0642263f568941275da640 sh -c "cat /etc/*release | grep ^ID"
/bin/sh: 1: sudo: not found

Timeout for connect

I am using this action to enable debugging for our CI. It would be nice to have a configurable timeout for the main loop so that the job ends if someone starts a job with tmate enabled, and forgets to connect to it. That way they don't eat up all our minutes.

This check was cancelled

This simply does not work.

I've created a fairly simple workflow:

name: Show Me the S3cr3tz
on: [push]

jobs:
  debug:
    name: Debug
    runs-on: ubuntu-latest

    steps:
      - name: Check out code
        uses: actions/checkout@v2

      - name: Set up secret file
        env:
          MY_SECRET: ${{ secrets.MY_SECRET }}
        run: |
          echo $MY_SECRET >> secrets.txt

      - name: Run tmate
        uses: mxschmitt/action-tmate@v3

However, I can never see the tmate link because it is canceled automatically and immediately after leaving the queue:

image

Am I simply doing something wrong?

tmate.io might be shutting down

See this comment: tmate-io/tmate#257 (comment) by tmate's maintainer. It would be really sad to see this tool go, and with it the ability to log into GitHub Actions runners via this here action.

I wonder what could be done to keep the functionality of this action going. Maybe running tmate-ssh-server on Azure somehow, and use that instead of tmate.io...

repeated output of tmate info

Is it normal that it repeatedly outputs the tmate connection info until you run touch continue?

image

Also - thanks this is amazing!

Sudo not found issue

I'm trying to include this action as part of our workflow but I'm receiving this issue:

Part of steps:

      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v1

image

Any ideas?

同学,您这个项目引入了335个开源组件,存在1个漏洞,辛苦升级一下

Rethink deploment/releasing

This was one of the first Actions available afaik, the releasing strategy suggested by GitHub was in the beginning to create a v4 branch and then a v4 tag. Since tags are connected to the GitHub Actions marketplace. This is confusing and causes Git to not function probably (shows a warning and is confused), since there is a tag and a branch with the same name.

Not sure which way we should go, open to hear your thoughts in it.

@dscho

End connection?

How do I end the connection, and end the action run? It's been running for past 15 minutes.

I did exit on the tmate web terminal, but action is still running.

Unstable on Mac due to GitHub API restrictions

I have been consistently running across this error when trying to use tmate on a macos-10.15 runner:

==> Installing dependencies for tmate: libssh and msgpack
==> Installing tmate dependency: libssh
==> Pouring libssh-0.9.5_1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libssh/0.9.5_1: 23 files, 1.2MB
==> Installing tmate dependency: msgpack
==> Pouring msgpack-3.3.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/msgpack/3.3.0: 757 files, 5.2MB
==> Installing tmate
==> Pouring tmate-2.4.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/tmate/2.4.0: 9 files, 660.9KB
Error: HttpError: API rate limit exceeded for 199.19.85.34. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

I'm not sure what exactly is triggering this, but I am in fact using limit-access-to-actor which relies on octokit

      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3
        with:
          limit-access-to-actor: true

It seems to be related to this: actions/runner-images/issues/602

Looking at octokit's documentation, it seems setting the GITHUB_TOKEN environment variable might be enough to authenticate the user. I will try that and report back with anything I find. Edit: I have yet again come across the same error with the GITHUB_TOKEN environment variable set

Support Windows Hosts

Windows hosts usually come with OpenSSH preinstalled already so the only thing that is missing would be the tmate client, I think this should be visited as we at Vignette heavily relies on this action for debugging Actions CI.

Is there a way to start tmate in the background?

Hi,

If I understand the readme/doc correctly, with the current behavior, tmate will pause further execution of the workflow until a continue file is created. Or if the action is configured to be enabled on the failure of a previous step, it will stay active until the timeout is reached.

Would it be feasible to somewhat reverse this behavior and configure a workflow in this fashion:

name: CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Setup tmate session
      uses: mxschmitt/action-tmate@v3
    - [...] Any other steps needed
    - name: Keep tmate session alive
      uses: mxschmitt/action-tmate-alive@v3

In the workflow, the tmate session would always be created and would always be available for incoming connection during the entire job runtime, the tmate session would shut down alongside the runner at the end of the job execution.

If there is a need for debugging, it would be possible to drop a debug file on the filesystem, which would keep the hypothetical action-tmate-alive active while the debug file is present (+ eventually with a timeout).

If that sounds like a feasible approach, I'd be happy to give a shot at submitting a PR.

Windows?

Please offer an alternative or workaround to get this running on Windows?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.