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

i/o timeout #309

Open
irakli-ika opened this issue Mar 30, 2024 · 12 comments
Open

i/o timeout #309

irakli-ika opened this issue Mar 30, 2024 · 12 comments

Comments

@irakli-ika
Copy link

Hello, I try to deploy a project with Github to Digitalocean, I use ssh-action@v1.0.3 and have this issue ***:22: i/o timeout.
I saw old solutions with port: 8000 but it returns the same error ***:8000: i/o timeout, can you help me fix this issue?

@appleboy
Copy link
Owner

Please post your all workflow. Thanks.

@irakli-ika
Copy link
Author

irakli-ika commented Mar 31, 2024

Please post your all workflow. Thanks.

This is my workflow at the moment

`name: Laravel

on:
push:
branches: [ "main" ]

jobs:
laravel-tests:

runs-on: ubuntu-latest

steps:
  - name: Deploy Laravel App
    uses: appleboy/ssh-action@v1.0.3
    with:
      host: ${{secrets.SSH_HOST}}
      key: ${{secrets.SSH_PRIVATE_KEY}}
      username: ${{secrets.SSH_USERNAME}}

      script: |
        mkdir www
        cd www
        mkdir html
        cd html
        git clone https://github.com/irakli-ika/reponamehere.git`

@felipe3dfx
Copy link

I have the same error:

  deploy:
    runs-on: self-hosted
    environment: production
    needs: [test]
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USER }}
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          script_stop: true
          script: |
            cd ${{ github.event.repository.name }}
            git fetch
            git checkout '${{ github.sha }}'
            bash bin/main_run

image

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2024

@felipe3dfx Your SSH Server OS version and make sure your firewall policy?

@ariwijayaikd
Copy link

Please post your all workflow. Thanks.

This is my workflow at the moment

`name: Laravel

on: push: branches: [ "main" ]

jobs: laravel-tests:

runs-on: ubuntu-latest

steps:
  - name: Deploy Laravel App
    uses: appleboy/ssh-action@v1.0.3
    with:
      host: ${{secrets.SSH_HOST}}
      key: ${{secrets.SSH_PRIVATE_KEY}}
      username: ${{secrets.SSH_USERNAME}}

      script: |
        mkdir www
        cd www
        mkdir html
        cd html
        git clone https://github.com/irakli-ika/reponamehere.git`

have you try add step to add vpn connection so at least you can ping the target server?

@ariwijayaikd
Copy link

ariwijayaikd commented Apr 4, 2024

@felipe3dfx did your self runner can ssh to the target host?
edit:
because I have the same issue, I can connect to target from the selfhosted runner server, but get timeout form ssh appleboy

@irakli-ika
Copy link
Author

Please post your all workflow. Thanks.

This is my workflow at the moment
`name: Laravel
on: push: branches: [ "main" ]
jobs: laravel-tests:

runs-on: ubuntu-latest

steps:
  - name: Deploy Laravel App
    uses: appleboy/ssh-action@v1.0.3
    with:
      host: ${{secrets.SSH_HOST}}
      key: ${{secrets.SSH_PRIVATE_KEY}}
      username: ${{secrets.SSH_USERNAME}}

      script: |
        mkdir www
        cd www
        mkdir html
        cd html
        git clone https://github.com/irakli-ika/reponamehere.git`

have you try add step to add vpn connection so at least you can ping the target server?

Thanks for the feedback, I researched and saw connect with a docker image, is the correct way? when I try this way it returns Failed to open /dev/net/tun Error: 2. No such file or directory. can you help me with how can I connect with a VPN?

@ariwijayaikd
Copy link

ariwijayaikd commented Apr 4, 2024

@irakli-ika depend on your case, but for me I use ovpn, so the jobs can go like this

jobs:
  deployment:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - name: Make VPN USER
        run: |
          echo "${{ secrets.USERVPN }}" > .github/workflows/vpn
      - name: Make Client VPN File
        run: |
          echo "${{ secrets.CLIENTVPN }}" > .github/workflows/client.ovpn
      - name: Install Open VPN
        run: |
          sudo apt-get update
          sudo apt-get install openvpn
      - name: Connect VPN
        run: |
          sudo openvpn --config .github/workflows/client.ovpn --daemon
      - name: Build on server
        uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.PASSWORD }}
          port: ${{ secrets.PORT }}
          script: |
            yourscript
      - name: kill vpn
        if: always()
        run: sudo killall openvpn

@felipe3dfx
Copy link

@felipe3dfx Your SSH Server OS version and make sure your firewall policy?

I don't have any restrictions on the firewall for port 22.

  • Ubuntu Server 22.04.4 LTS

@appleboy
Copy link
Owner

appleboy commented Apr 4, 2024

@felipe3dfx Where is your server? in Linode or any other cloud provider?

@ariwijayaikd
Copy link

I am experiencing a similar issue. I am using a GitHub self-hosted runner and from that server I was able to SSH into the target server. However, when using the appleyboy ssh-action, I am getting timeout response.

@felipe3dfx
Copy link

@felipe3dfx Where is your server? in Linode or any other cloud provider?

@appleboy I use Linode (Runner included)

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