ssh-action icon indicating copy to clipboard operation
ssh-action copied to clipboard

Upgrading from `1.0.3` to `1.2.0` causes ssh-action to `i/o timeout`

Open jcarroll-ls opened this issue 1 year ago • 12 comments

Describe the bug

ssh-action was previously working on 1.0.3 but has stopped connecting since upgrading to 1.2.0.

The error being throw in 1.2.0 as follows: image

Screenshot of the successful run using 1.0.3: image

Yaml Config

Please post your Yaml configuration file along with the output results.

name: test-ssh-update

on: push

jobs:
  ssh-103:
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - uses: ORG-OMITTED/github-actions/openvpn@main
        with:
          config: ${{ secrets.VPN_CONFIG }}
          username: ${{ secrets.VPN_USERNAME }}
          password: ${{ secrets.VPN_PASSWORD }}

      - uses: appleboy/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.DEVOPS_WORKFLOWS_PAT }}
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USERNAME }}
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          script: |
            echo hello world 103

  ssh-120:
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - uses: ORG-OMITTED/github-actions/openvpn@main
        with:
          config: ${{ secrets.VPN_CONFIG }}
          username: ${{ secrets.VPN_USERNAME }}
          password: ${{ secrets.VPN_PASSWORD }}

      - uses: appleboy/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.DEVOPS_WORKFLOWS_PAT }}
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USERNAME }}
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          script: |
            echo hello world 120

Related environment

Please provide the following information:

  1. Test host ssh service is OpenSSH 6.6.1.

jcarroll-ls avatar Nov 18 '24 12:11 jcarroll-ls

@jcarroll-ls Any firewall rule?

appleboy avatar Nov 26 '24 14:11 appleboy

No rule was defined. I have this problem too.

aknkaplanoglu avatar Dec 02 '24 09:12 aknkaplanoglu

I still get this error.

cengizemre avatar Dec 03 '24 13:12 cengizemre

@aknkaplanoglu @cengizemre What is your hosting? maybe I can try it.

appleboy avatar Dec 04 '24 01:12 appleboy

遇到了同樣的問題,看了下好像是代理的問題

好了......定位後是runs-on: self-hosted的問題

Eminlin avatar Dec 04 '24 08:12 Eminlin

yeah, no rules defined I'm afraid. The servers are behind a VPN.

However, the timeouts begin immediately after upgrading the previously working v1.0.3 task to 1.2.0. It consistently fails, so not an intermittent issue either by looks of it.

jcarroll-ls avatar Dec 04 '24 16:12 jcarroll-ls

Might there be some useful logging I could pull from the github runner? I could capture and write out as artefacts for review.

jcarroll-ls avatar Dec 04 '24 18:12 jcarroll-ls

Having the same issue. Always times out regardless of configuration. Using private key with passphrase.

Also, as seen below, when using 1.0.3, the action gets to the point where it pulls down the SSH dependency and seems to run the command, but it always times out there as well. I've not gotten this action to finish successfully with any configuration/setup.

on:
  #push:
  #  branches:
  #  - main
  workflow_dispatch:

jobs:
  update_journal:
    runs-on: ubuntu-24.04
    steps:
    - name: run commands via ssh
      uses: appleboy/[email protected]
      with:
        host: ${{ secrets.HOSTNAME }}
        username: ${{ secrets.SSH_USERNAME }}
        key: ${{ secrets.SSH_KEY }}
        passphrase: ${{ secrets.SSH_PASSPHRASE }}
        script: | 
          whoami
Run appleboy/[email protected]
Run echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
Run entrypoint.sh
Will download drone-ssh-1.8.0-linux-amd64 from https://github.com/appleboy/drone-ssh/releases/download/v1.8.0
======= CLI Version =======
Drone SSH version 1.8.0
===========================
2024/12/13 17:56:08 dial tcp ***:22: i/o timeout
Error: Process completed with exit code 1.
on:
  #push:
  #  branches:
  #  - main
  workflow_dispatch:

jobs:
  update_journal:
    runs-on: ubuntu-24.04
    steps:
    - name: run commands via ssh
      uses: appleboy/[email protected]
      with:
        host: ${{ secrets.HOSTNAME }}
        username: ${{ secrets.SSH_USERNAME }}
        key: ${{ secrets.SSH_KEY }}
        passphrase: ${{ secrets.SSH_PASSPHRASE }}
        script: | 
          whoami
Run appleboy/[email protected]
...
======CMD======
whoami
======END======
2024/12/13 17:58:11 dial tcp ***:22: i/o timeout

lanmaster53 avatar Dec 12 '24 19:12 lanmaster53

I get the same error. Is there a solution at the moment?

FoxTes avatar Feb 23 '25 12:02 FoxTes

I get the same error. Is there a solution at the moment?

Yes. Use a private key without a passphrase and it works just fine. I never could get it to work with a passphrase.

lanmaster53 avatar Feb 23 '25 16:02 lanmaster53

I get the same error. Is there a solution at the moment?

Yes. Use a certificate without a passphrase and it works just fine. I never could get it to work with a passphrase.

What do you mean by "certificate"?

cengizemre avatar Feb 27 '25 09:02 cengizemre

I get the same error. Is there a solution at the moment?

Yes. Use a certificate without a passphrase and it works just fine. I never could get it to work with a passphrase.

What do you mean by "certificate"?

My apologies for not being more clear. I meant to say a private key. I'll edit my original response.

lanmaster53 avatar Feb 27 '25 14:02 lanmaster53