Skip to content

tmate fails to connect #203

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

Open
aaron-siegel opened this issue Sep 26, 2024 · 6 comments
Open

tmate fails to connect #203

aaron-siegel opened this issue Sep 26, 2024 · 6 comments

Comments

@aaron-siegel
Copy link

aaron-siegel commented Sep 26, 2024

I tried using tmate for the first time today, with the suggested minimal configuration:

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

On all my runners, tmate simply went into an infinite loop (and blocked progress on the remaining workflow steps). The output looks like this:

Run mxschmitt/action-tmate@v3
Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [142 B]
Hit:6 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Get:7 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3632 B]
Hit:2 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
Get:3 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Get:4 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
Get:5 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Get:8 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [15.6 kB]
Get:9 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main arm64 Packages [43.5 kB]
Get:10 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [173 kB]
Get:11 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2066 kB]
Get:12 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [357 kB]
Get:13 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [17.8 kB]
Get:14 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2504 kB]
Get:15 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [432 kB]
Get:[16](https://github.com/pixeltable/pixeltable/actions/runs/11060569333/job/30731380861#step:3:17) http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1128 kB]
Get:[17](https://github.com/pixeltable/pixeltable/actions/runs/11060569333/job/30731380861#step:3:18) http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [263 kB]
Get:[18](https://github.com/pixeltable/pixeltable/actions/runs/11060569333/job/30731380861#step:3:19) http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [26.3 kB]
Get:[19](https://github.com/pixeltable/pixeltable/actions/runs/11060569333/job/30731380861#step:3:20) http://azure.archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [91.6 kB]
Get:20 http://azure.archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
Get:21 http://azure.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [31.3 kB]
Get:22 http://azure.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [672 B]
Get:23 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1848 kB]
Get:24 http://azure.archive.ubuntu.com/ubuntu jammy-security/main Translation-en [299 kB]
Get:25 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [13.3 kB]
Get:26 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2444 kB]
Get:27 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted Translation-en [4[21](https://github.com/pixeltable/pixeltable/actions/runs/11060569333/job/30731380861#step:3:22) kB]
Get:28 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [907 kB]
Get:29 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe Translation-en [179 kB]
Get:30 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [19.4 kB]
Fetched 13.7 MB in 2s (7814 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
xz-utils is already the newest version (5.2.5-2ubuntu1).
openssh-client is already the newest version (1:8.9p1-3ubuntu0.10).
0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
or: ssh -i <path-to-private-SSH-key> K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io
SSH: ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io

[continues indefinitely, until I cancel the workflow]

In this case, the action was running on a standard ubuntu-22.04 instance.

Thanks!
Aaron

@bohdanbinahai
Copy link

Same story

@JoeHCQ1
Copy link

JoeHCQ1 commented Nov 20, 2024

That's exactly what it's supposed to do. It stalls the job so you can work, and spits out the command you can use to access the runner now. In your case, you'd run:

ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io

@aaron-siegel
Copy link
Author

aaron-siegel commented Nov 21, 2024

Thanks for the reply! Yes, this wasn't clear at first, but I eventually figured it out.

tmate team: You might consider printing a log message such as "Waiting for SSH client to connect ..." alongside the existing messages. This would make it crystal clear that tmate is pausing execution while waiting to hear from the client.

Thanks!
Aaron

That's exactly what it's supposed to do. It stalls the job so you can work, and spits out the command you can use to access the runner now. In your case, you'd run:

ssh K9pP7zf7QGpDdNVpZWnStHXTp@nyc1.tmate.io

@glass-ships
Copy link

New to tmate, but running similar issue as well:

> ssh -v SMnaNf2ECWFcSSHPCA8wUwJaU@nyc1.tmate.io
OpenSSH_9.6p1 Ubuntu-3ubuntu13.9, OpenSSL 3.0.13 30 Jan 2024
debug1: Reading configuration data /home/ge2/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to nyc1.tmate.io [134.209.128.51] port 22.
debug1: Connection established.
debug1: identity file /home/ge2/.ssh/id_rsa type 0
debug1: identity file /home/ge2/.ssh/id_rsa-cert type -1
debug1: identity file /home/ge2/.ssh/id_ecdsa type -1
debug1: identity file /home/ge2/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ge2/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/ge2/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/ge2/.ssh/id_ed25519 type -1
debug1: identity file /home/ge2/.ssh/id_ed25519-cert type -1
debug1: identity file /home/ge2/.ssh/id_ed25519_sk type -1
debug1: identity file /home/ge2/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/ge2/.ssh/id_xmss type -1
debug1: identity file /home/ge2/.ssh/id_xmss-cert type -1
debug1: identity file /home/ge2/.ssh/id_dsa type -1
debug1: identity file /home/ge2/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.9

connection is allegedly made, but doesn't actually put me into an interactive shell, and git action continues to print out the connection string every few seconds.

am I missing a step?

testing using a minimal workflow as follows:

name: test tmate
on:
  workflow_dispatch:

jobs:
  tmate_test:
    runs-on: ubuntu-22.04
    steps:
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3

@aaron-siegel
Copy link
Author

It will continue to do that until you actually connect.

You can change this behavior by putting

        with:
          detached: true

as a tmate action parameter; this will instruct tmate to listen for connections, but in a non-blocking way

connection is allegedly made, but doesn't actually put me into an interactive shell, and git action continues to print out the connection string every few seconds.

@glass-ships
Copy link

thanks Aaron!
the issue is that it never seems to actually connect, despite verbose mode saying that a connection was made - it just hangs there indefinitely

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