capistrano-deploy icon indicating copy to clipboard operation
capistrano-deploy copied to clipboard

Workflow fails with error in /tmp/ssh-auth.sock after 2 or more runs in Github Actions

Open TakashiAihara opened this issue 1 year ago • 2 comments

I encountered an error when running a GitHub Actions workflow, as detailed below:

/usr/bin/openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
/usr/bin/openssl enc -d -aes-256-cbc -md sha512 -salt -in config/deploy_id_rsa_enc -out config/deploy_id_rsa -k *** -a -pbkdf2
/usr/bin/chmod 0600 config/deploy_id_rsa
/usr/bin/ssh-agent -a /tmp/ssh-auth.sock
unix_listener: cannot bind to path /tmp/ssh-auth.sock: Address already in use
Error: Error: The process '/usr/bin/ssh-agent' failed with exit code 1

The workflow configuration is as follows:

name: Continuous Deployment

on:
  push:

env:
  RUBY_VERSION: 2.6.2

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Wait in-flight Deployment
        uses: softprops/turnstyle@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          abort-after-seconds: 3600

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ env.RUBY_VERSION }}
          bundler-cache: true

      - name: Deploy Check
        uses: miloserdow/capistrano-deploy@master
        with:
          target: Test
          deploy_key: ${{ secrets.DEPLOY_KEY }}
          enc_rsa_key_val: ${{ secrets.ENC_RSA_KEY_VAL }}
          capistrano_commands: '["deploy:check"]'

      - name: Deploy
        uses: miloserdow/capistrano-deploy@master
        with:
          target: Test
          deploy_key: ${{ secrets.DEPLOY_KEY }}
          enc_rsa_key_val: ${{ secrets.ENC_RSA_KEY_VAL }}

Is it necessary to explicitly delete /tmp/ssh-auth.sock? It would be helpful if this could be mentioned in the README or made configurable via the with clause.

TakashiAihara avatar Nov 06 '23 03:11 TakashiAihara

Just chiming in to say I am seeing the same thing among some other issues.

jbrodie avatar Dec 05 '23 21:12 jbrodie