Job "Deploy over SSH" timeout

So I am trying to run a more sophisticated command with SSH, but no matter what my command is (even if I only add the git clone command), my workflow keeps saying it’s busy with the job “deploy over ssh” until it receives a time-out.

Now I tested the command from my own machine and it works quite well. I have added the SSH key of my server to my project and configured ssh for Github on my server. So it should work fine, but I’m already struggling all night to get this working.

Any help is much appreciated.

# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

jobs:
  deploy:
    machine:
      enabled: true
    steps:
      - add_ssh_keys:
          fingerprints:
            - "1f:bd:2c:20:79:af:b4:92:06:b0:e9:50:9d:5e:fa:46"
      - run:
          name: Deploy Over SSH
          command: |-
        ssh $SSH_USER@$SSH_HOST 'bash -c CURRDATE=$(date +%s);echo \$CURRDATE; cd /var/www/mydomain.com/releases && \
          git clone git@github.com:GithubUser/mydomain.com.git \$CURRDATE && \
          cd \$CURRDATE && \
          git checkout develop && \
          ln -s /var/www/mydomain.com/releases/\$CURRDATE /var/www/mydomain.com/current"'

workflows:
  build-and-deploy:
    jobs:
      - deploy:
          filters:
            branches:
              only:
                - master # only deploy on the master branch
                - develop

EDIT:
Now I even tried this very simple command, and fails as well, the task keeps running until a time-out occurs.

ssh $SSH_USER@$SSH_HOST 'touch /var/www/mydomain.com/releases/test.txt'

I fixed it. I tried to connect to my server using the ssh key I generated for circleci and I figured out I had to enter a password anyway. Because I didn’t add the key to the authorized_keys file. Now it seems to work.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.