ssh-action: I/O Timeout Error
It doesn’t just make any other error:
`======CMD====== docker rm -f $(docker ps -aq -f name=erp-front) docker rmi $(docker images | grep ‘emiryumak/erp-front’ | awk ‘{print $3}’) docker pull emiryumak/erp-front:latest docker run --name erp-front -p 5000:80 --restart=always -d emiryumak/erp-front
======END====== ======ENV======
======END====== 2020/05/16 20:31:15 dial tcp :: i/o timeout`
I don’t understand thats error. Its meaning can not connect to my server?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 25 (5 by maintainers)
I faced the same issue as well (while having none with
appleboy/scp-action
) and was eventually able to resolve this by reconfiguringufw
on my server. The action for22/tcp
wasLIMIT
for some reason.Running
fixed it for me.
In my case, it was a conflict because I was declaring to use it for the Node app, while this was affecting the
ssh-action
.The solution was to rename the variable from
PORT
toAPP_PORT
.I just started getting this issue as well. The commands I was executing on the remote server was a series of docker commands as part of my deployment process. I connected to the server and ran them manually and they ran fine.
@luisfalconmx’s comment stood out to me since I was also running docker commands. I connected to a box and ran
docker image prune -a -f
it took a minute but then completed, clearing up 8GB of space on the machine. After that the deployment actions using SSH completed successfully.I suspect the machine may have slowed down due to all the images on disk. I’m going to try incorporating
docker image prune -a -f
into my deployment process and see if it helps with future deployments. Certainly all that space consumption will eventually strangle the server anyway.The Problem
After several hours trying to solve this problem, I came to the next conclusion:
Apparently there are some commands like
docker rm -f $(docker ps -aq -f name=erp-front)
ordocker rmi $(docker images | grep 'emiryumak/erp-front' | awk '{print $3}')
that make the connection saturate and throw the I/O Timeout error.This may be because the command
docker rmi $(docker images | grep 'emiryumak/erp-front' | awk '{print $3}')
first tries to return all images namedemiryumak/erp-front
and then remove each of them, which can be too complicated to process.Possible Solution
My recommendation would be to keep the commands as simple as possible or use them as shown in official documentation. Also make sure you configure the credentials correctly. In case you use an ssh key make sure to add the public key on the server and the private key in the repository as a secret.
Setting up a SSH Key
Some examples of how to use the commands correctly.
Delete a specific container
Delete old and unused images
Workflow File
This is the configuration that I am using to run a docker container on a server via ssh every time I publish a new release
With environment variables
I hope this information has been useful to you 😉
Using GCP where I have ssh allowed on instance firewall and executed
sudo ufw allow ssh
, checked it was enabled withsudo ufw status
and it is. Still facing timeout issue.I was facing the same issue and I have solved it… I have first used @Shaance’s way then I have changed inbound and outbound for EC-2 instance ( Security Groups). Some other debugging and bingo it works now… Thanks to all
I’m getting the same error. Trying to connect to a Windows Server 2008 r2 with freesshd on it.