scp-action icon indicating copy to clipboard operation
scp-action copied to clipboard

error copy file to dest: ***, error message: dial tcp *** i/o timeout

Open Pumpk1ns opened this issue 3 years ago • 22 comments

I have been using this actions in one of my projects. So far it works fine, but sometimes I get the following error:

tar all files into /tmp/979006019/KQmgptshHs.tar
scp file to server.
2021/03/19 12:52:01 error copy file to dest: ***, error message: dial tcp **.**.**.**:***: i/o timeout
drone-scp error:  error copy file to dest: ***, error message: dial tcp **.**.**.**:***: i/o timeout

Pumpk1ns avatar Mar 19 '21 13:03 Pumpk1ns

Same error here

wesleyfeitosa avatar Apr 03 '21 02:04 wesleyfeitosa

@Pumpk1ns check with your cloud provider if the ssh port (22) is released for everyone to access, after I make these releases my pipeline ran successfully

wesleyfeitosa avatar Apr 03 '21 04:04 wesleyfeitosa

Same here, but with remove old .tar

tar all files into /tmp/861092316/wuXwBu8u8s.tar
scp file to server.
create folder .
untar file wuXwBu8u8s.tar
remove file wuXwBu8u8s.tar
drone-scp error:  dial tcp ***.***.***.***:22: i/o timeout
drone-scp rollback: remove all target tmp file
remove file wuXwBu8u8s.tar
dial tcp ***.***.***.***:22: i/o timeout

So it's able to upload file but unable to delete .tar.

ZhilinS avatar Apr 11 '21 18:04 ZhilinS

Same error

thalesrbs avatar May 21 '21 21:05 thalesrbs

I switched to another scp action and everything was fine, until I started to make several consecutive requests - then it started to fail after a couple of tries. Perhaps the problem is that my remote server is hosted on the smallest DigitalOcean droplet and it cannot handle such "intentional" request rate. After reducing count of requests to one, everything started working flawlessly.

ZhilinS avatar May 25 '21 20:05 ZhilinS

I received this issue when I was sending a file and listing the file name (with file extensions) in the target option, assuming it would land in the home directory of the user.

I changed it to ~/ and the issue went away.

trjohnst avatar Jun 19 '21 19:06 trjohnst

Unfortunately, the same error.

UPD: when I had changed host and port without secrets - action was successful

alexdeia avatar Sep 27 '21 12:09 alexdeia

Hey I am getting this same issue right now and tried all of your guys work arounds aside from @ZhillinS recommendation to reduce the count of requests. Would you be able to walk me through how to do that on my droplet? I have the same configuration (smallest droplet DO offers)

mahtaraatwit avatar Dec 22 '21 11:12 mahtaraatwit

I am getting the same error. i want to deploy my artifact into a Azure window VM.
Is "appleboy/scp-action@master" only for Linux VM? Can somebody help me here?

KamleshTestEY avatar Feb 21 '22 08:02 KamleshTestEY

Same error here

coaperator avatar Aug 10 '22 18:08 coaperator

Can happen if your host has an ipv6 and your firewall only allow ipv4

stafyniaksacha avatar Oct 18 '22 14:10 stafyniaksacha

Had the same issue.

My solution was to change the firewall rule(ufw) for my ssh port from LIMIT to ALLOW

fabrlyn avatar Feb 12 '23 10:02 fabrlyn

In my case it was that I was connecting to the wrong port, changing from 722 to 22 solved the issue.

csalmeida avatar Mar 10 '23 15:03 csalmeida

As of now, you can use version 0.1.3

appleboy/[email protected]

instead

appleboy/scp-action@master

It's working fine with me instead of master branch

AhmedHdeawy avatar May 29 '23 09:05 AhmedHdeawy

As of now, you can use version 0.1.3

appleboy/[email protected]

instead

appleboy/scp-action@master

It's working fine with me instead of master branch

Thankyou bro!

mppbg avatar Jun 27 '23 02:06 mppbg

I think I was able to find a way around it.

Firstly: The default timeout for ssh to remote host is 30 seconds, you can try increasing it to probably 120 seconds. you can do this by simply defining the timeout input as 120 as shown below: Screenshot 2023-07-24 at 12 11 55 PM for more info on the possible inputs you can edit or change check https://github.com/appleboy/scp-action/blob/master/action.yml

That should work, well, hopefully it worked well for me.

I noticed an issue though, even though everything worked fine, somehow the 'tar.gz' files still remained. I did a simple work around in my yaml file as shown below: Screenshot 2023-07-24 at 12 16 49 PM

Please Note: I only did this after confirming that no other tar .gz files exist in my target directory.

I hope this helps.

Themirror-2023 avatar Jul 24 '23 11:07 Themirror-2023

As of now, you can use version 0.1.3

appleboy/[email protected]

instead

appleboy/scp-action@master

It's working fine with me instead of master branch

This is the solutions, a lot of thanks!

blackerfin avatar Jul 31 '23 11:07 blackerfin

Setting a longer timeout worked for me. Thanks @Themirror-2023 !

danielsotopino avatar Oct 23 '23 22:10 danielsotopino

Longer timeout worked 👍 I am using appleboy/scp-action@master

trymedo avatar Feb 03 '24 08:02 trymedo

At the end I have got to work it fine in an aws instance

The solution is to fix the rules of ufw

#sudo ufw allow 22

picarenlamina avatar Mar 04 '24 17:03 picarenlamina

In an aws instance the solution is to open port 22

#sudo ufw allow 22

picarenlamina avatar Mar 04 '24 17:03 picarenlamina