Intermitttent Issue : dial tcp <ip>:22: connect: connection refused
@appleboy is already working on this.
Since Mar 5, 2025.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
We are intermittently encountering an issue where we are unable to connect to a VM. Before attempting to connect, we proactively check whether the machine is online. Only if it is online do we proceed with the connection using the SSH GitHub Action. Despite these precautions, the issue occurs occasionally, but it mostly resolves after a rerun.
Error we get
Yaml Config
Please post your Yaml configuration file along with the output results.
- name: Wait for machine to be online
run: |
while ! nc -w10 -z -v $vmIpAddress 22;do echo "Waiting for machine to be online..."; done
id: vm_ip_address
- name: Exporting variables to bash profile
uses: appleboy/ssh-action@master
with:
command_timeout: 60m
host: ${{ steps.vm_ip_address.outputs.IP_ADDRESS }}
username: azureuser
key: ${{ secrets.PRIVATE_KEY }}
port: 22
script: |
HOME_DIR="/home/azureuser"
Related environment
Please provide the following information:
- Your hosting provider information, such as DigitalOcean, Linode, AWS, or GCP.
- Azure
- The version information of your host's SSH service.
- latest ('@master')
- The information from your host's SSH configuration file.
- Dominant language
- Shell
- Stars
- 6.2k
- Forks
- 680
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from appleboy/ssh-action
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
appleboy/ssh-action#416 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
appleboy/ssh-action#407 · 1 reaction ·
-
Add a title Openbug
appleboy/ssh-action#399 · 1 assignee ·
-
bug
appleboy/ssh-action#393 · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
appleboy/ssh-action#388 · 5 reactions ·
All issues in appleboy/ssh-action
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·