ssh-action
                                
                                 ssh-action copied to clipboard
                                
                                    ssh-action copied to clipboard
                            
                            
                            
                        My workflow now is timming out
nothing changed... suddenly it stopped working...
it has been working since october 2020.
if i enter the server via SSH and run the commands of the workflow everything goes fine.
: err: Creating container_yarn_run ...
and then time out.
running docker-compose commands with -d flags solved the problem but it used to run before without the flag.
I prefer the old way... Why is it not functioning anymore???
Please post the logs?
I'm having a similar issue - I'm trying to just run a python script with python3 main.py - It seems to run the script (my bot comes online) but it stays in progress until it times out... Any suggestions?
Raw logs from Github Actions
2022-07-13T23:57:01.0795394Z ##[group]Run appleboy/ssh-action@master
2022-07-13T23:57:01.0796046Z with:
2022-07-13T23:57:01.0796545Z   host: 95.179.229.192
2022-07-13T23:57:01.0797052Z   username: root
2022-07-13T23:57:01.0808345Z   key: ***
2022-07-13T23:57:01.0809742Z   port: 22
2022-07-13T23:57:01.0810346Z   script: whoami
pwd
cd baby-yoda/
python3 launcher.py
  
2022-07-13T23:57:01.0811004Z   sync: false
2022-07-13T23:57:01.0811525Z   use_insecure_cipher: false
2022-07-13T23:57:01.0812085Z   timeout: 30s
2022-07-13T23:57:01.0812576Z   command_timeout: 10m
2022-07-13T23:57:01.0813090Z   proxy_port: 22
2022-07-13T23:57:01.0813592Z   proxy_timeout: 30s
2022-07-13T23:57:01.0814124Z   proxy_use_insecure_cipher: false
2022-07-13T23:57:01.0814668Z   script_stop: false
2022-07-13T23:57:01.0815150Z   debug: false
2022-07-13T23:57:01.0815660Z ##[endgroup]
2022-07-13T23:57:01.1162408Z ##[command]/usr/bin/docker run --name cd98fe6e11eefa9da4ab19e235fb57a0856d6_6aa88d --label 4cd98f --workdir /github/workspace --rm -e INPUT_HOST -e INPUT_USERNAME -e INPUT_KEY -e INPUT_PORT -e INPUT_SCRIPT -e INPUT_PASSPHRASE -e INPUT_PASSWORD -e INPUT_SYNC -e INPUT_USE_INSECURE_CIPHER -e INPUT_CIPHER -e INPUT_TIMEOUT -e INPUT_COMMAND_TIMEOUT -e INPUT_KEY_PATH -e INPUT_FINGERPRINT -e INPUT_PROXY_HOST -e INPUT_PROXY_PORT -e INPUT_PROXY_USERNAME -e INPUT_PROXY_PASSWORD -e INPUT_PROXY_PASSPHRASE -e INPUT_PROXY_TIMEOUT -e INPUT_PROXY_KEY -e INPUT_PROXY_KEY_PATH -e INPUT_PROXY_FINGERPRINT -e INPUT_PROXY_CIPHER -e INPUT_PROXY_USE_INSECURE_CIPHER -e INPUT_SCRIPT_STOP -e INPUT_ENVS -e INPUT_DEBUG -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/baby-yoda/baby-yoda":"/github/workspace" 4cd98f:e6e11eefa9da4ab19e235fb57a0856d6
2022-07-13T23:57:01.5108869Z ======CMD======
2022-07-13T23:57:01.5109531Z whoami
2022-07-13T23:57:01.5109995Z pwd
2022-07-13T23:57:01.5110734Z cd baby-yoda/
2022-07-13T23:57:01.5111244Z python3 launcher.py
2022-07-13T23:57:01.5111720Z   
2022-07-13T23:57:01.5111978Z 
2022-07-13T23:57:01.5112186Z ======END======
2022-07-13T23:57:02.4504858Z out: root
2022-07-13T23:57:02.4551315Z out: /root
2022-07-13T23:59:05.1368518Z ##[error]The operation was canceled.
2022-07-13T23:59:05.1539495Z Cleaning up orphan processes
It seemed to work just once with
      - name: executing remote ssh commands using ssh key
        uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.username }}
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          port: 22
          script: |
            cd baby-yoda/
            python3 exit.py
            python3 launcher.py
Now I'm trying again with no luck...
Same thing here, this is my action
- name: Execute docker-compose on app server
      uses: appleboy/ssh-action@master
      with:
        host: 0.0.0.0    # IP IS FAKE
        port: 22
        command_timeout: 200m
        username: foo
        key: ${{ secrets.SCP_KEY }}
        script: |
          docker login --username="REDACTED" --password="${{secrets.NGINX_DOCKER_REGISTRY_PASSWORD}}" registry.gitlab.com
          docker pull registry.gitlab.com/REDACTED
          docker login --username="REDACTED" --password="${{secrets.HOMER_DOCKER_REGISTRY_PASSWORD}}" registry.gitlab.com
          docker pull registry.gitlab.com/REDACTED
          docker-compose up -d
          docker-compose run homer rake db:migrate
It hangs forever at
docker-compose up -d
And never executes the next command.
@sangregoriopaolo - No idea if this will be any help to you at all. Probably not, but if anyone else ever comes across my problem with python. I figured out my problem, it wasn't appleboy/ssh-action@master at all, but the way I was attempting it.
I was attempting to run a python script with the Workflow, the script was always executed but when my python script is running... it stays running. So there was never an exit code returned for GitHub actions to know that it had completed, and eventually, it timed out.
I had to create a systemd service to run my python script instead of attempting to run it with the Github action.
Thanks @HenrySpartGlobal I see what you mean. In my case, the docker-compose up -d command should already fork and create a new process in the background (-d stands for detach) so it is supposedly correct. It also used to work until some months ago, I just released for the first time after months last week and it doesn't work anymore
Ran into the same issue. My script is this:
      - name: SSH
        uses: appleboy/[email protected]
        with:
          host: ${{ env.SSH_HOST }}
          port: ${{ env.SSH_PORT }}
          username: ${{ env.SSH_USERNAME }}
          password: ${{ secrets.SSH_PASSWORD }}
          script: |
            ruby main.rb &
Because of the & the ruby command is supposed to run in the background and not block the pipeline. But for some reason the pipeline keeps waiting for that command to end anyway.
This issue has been long-standing. I will close it for now. If there are similar problems in the future, please open a new issue.