fifsky / ssh-action

🖥 github ssh action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Operation timed out

proartti opened this issue · comments

I am trying to use the action to run a .sh file to sync and build a Laravel/React app.

The action successfully connects via ssh and runs the file but there is no output and after 30sec it exits with timeout error.

I start running a couple of tests I got the same error just copying and paste your example code.

I am trying to connect to a Ubuntu 18 server.
Any tips?

Action out put:

Warning: This action does not currently support host verification; verification is disabled. 
 
/home/***/deploy/deploy_dev.sh
Start Run Command
Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh: connect to host *** port 22: Operation timed out
##[error]Docker run failed with exit code 255

Hi,There may be two possibilities
1、Blocked by firewall
2、Try ssh -t -t(or ssh -tt for short) to force pseudo-tty allocation even if stdin isn't a terminal.
https://stackoverflow.com/questions/7114990/pseudo-terminal-will-not-be-allocated-because-stdin-is-not-a-terminal

For the second problem, I added a args parameter to pass the extra parameters of SSH

See https://github.com/fifsky/ssh-action#options

- name: ls -a via ssh
  uses: fifsky/ssh-action@master
  with:
    command: |
      cd /tmp
      ls -a
    host: ${{ secrets.HOST }}
    user: root
    key: ${{ secrets.PRIVATE_KEY}}
    args:"-tt"

Thanks for the quick reply =]
I added the args and the Pseudo-terminal alert is gone but the result is the same.

cd /var/www
ls -a
 exit
Start Run Command
ssh: connect to host *** port 22: Operation timed out
##[error]Docker run failed with exit code 255

You can add parameters to see more error information, such as

args:"-tt -vvv"

Thanks for the reply! Added the arg -vvv and managed to identify the error.
Turns out it was a typo in the secret configuration.

I am embarrassed for this silly mistake but also relieved that all works now.
Thanks!