appleboy / scp-action

GitHub Action that copy files and artifacts via SSH.
https://github.com/marketplace/actions/scp-command-to-transfer-files
MIT License
1.14k stars 134 forks source link

IO Timeout Regression since 2023-04-03 #106

Open dcaslin opened 1 year ago

dcaslin commented 1 year ago

As of today Actions using https://github.com/dcaslin/d2-checklist/actions with

uses: appleboy/scp-action@master

Have been failing with an IO timeout after uploading the tarball (see https://github.com/dcaslin/d2-checklist/actions/runs/4652652207 for a live case)

tar all files into /tmp/AMsdjMEvbv.tar.gz
scp file to server.
create folder /home/***/d2checklist/
untar file AMsdjMEvbv.tar.gz
remove file AMsdjMEvbv.tar.gz
drone-scp error:  dial tcp ***:***: i/o timeout
drone-scp rollback: remove all target tmp file
remove file AMsdjMEvbv.tar.gz
2023/04/09 ***:04:05 dial tcp ***:***: i/o timeout

By pinning to a previous version

uses: appleboy/scp-action@98930d398ce425af0148ea8a0e3295cd04fe2b7a

The issue goes away

appleboy commented 1 year ago

Can you show your config and remote OS version?

appleboy commented 1 year ago

According to your config

Run appleboy/scp-action@master
  with:
    source: ./dist/
    target: /home/***/d[2](https://github.com/dcaslin/d2-checklist/actions/runs/4652652207/jobs/8233035792#step:11:2)checklist/
    strip_components: 2
    port: ***
    timeout: [3](https://github.com/dcaslin/d2-checklist/actions/runs/4652652207/jobs/8233035792#step:11:3)0s
    command_timeout: 10m
    use_insecure_cipher: false
    rm: false
    debug: false
    overwrite: false
    tar_dereference: false
    tar_exec: tar
    proxy_port: ***
    proxy_timeout: 30s
    proxy_use_insecure_cipher: false
  env:
    HOST: ***
    USERNAME: ***
    PORT: ***
    KEY: ***
appleboy commented 1 year ago

@dcaslin Can you help to try the two versions?

  1. appleboy/scp-action@v0.1.3 (working?)
  2. appleboy/scp-action@v0.1.4 (not working?)
  3. appleboy/scp-action@209e8c05e0492f6ed6fe8a22dfcaefb083c4cf35 (?)

Thanks.

dcaslin commented 1 year ago

image

Confirmed, 0.1.3 works, 0.1.4 fails

dcaslin commented 1 year ago

Btw in terms of target OS:

NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.1 LTS" VERSION_ID="20.04"

cacacaio commented 1 year ago

I'm having the same issue, reverting my workflow to 0.1.3 works for now, but basically every workflow in my org is broken cause of this update, I'm hoping for a fix soon cause we have a lot of projects and changing every single one by hand kind of sucks.

appleboy commented 1 year ago

@cacacaio @dcaslin please help to try the following version

- appleboy/scp-action@v0.1.3
+ appleboy/scp-action@209e8c05e0492f6ed6fe8a22dfcaefb083c4cf35
appleboy commented 1 year ago

You will see the following log

image

remote server os type is uix

appleboy commented 1 year ago

@cacacaio Don't use the master version in your production.

csalmeida commented 1 year ago

I have the same issue pinning the package to version appleboy/scp-action@98930d398ce425af0148ea8a0e3295cd04fe2b7a fixed it.

Thanks! 🙏

appleboy commented 1 year ago

@csalmeida You should try v0.1.4

dcaslin commented 1 year ago

@cacacaio @dcaslin please help to try the following version

- appleboy/scp-action@v0.1.3
+ appleboy/scp-action@209e8c05e0492f6ed6fe8a22dfcaefb083c4cf35

Tested here: https://github.com/dcaslin/d2-checklist/actions/runs/4704329113/jobs/8343852155

appleboy commented 1 year ago

@dcaslin

Find

      env:
        HOST: ${{ secrets.HOST }}
        USERNAME: ${{ secrets.UID }}
        PORT: ${{ secrets.PORT }}
        KEY: ${{ secrets.SSH }}
      with:
        source: "./dist/"
        target: "/home/${{ secrets.UID }}/d2checklist/"
        strip_components: 2 # this is important

Change to

      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.UID }}
        port: ${{ secrets.PORT }}
        key: ${{ secrets.SSH }}
        source: "./dist/"
        target: "/home/${{ secrets.UID }}/d2checklist/"
        strip_components: 2 # this is important

Don't use env and please try the master branch appleboy/scp-action@master

csalmeida commented 1 year ago

@csalmeida You should try v0.1.4

Thanks @appleboy, will give that a go when I find a moment. 🙏

alepiumetti commented 1 year ago

@dcaslin Can you help to try the two versions?

  1. appleboy/scp-action@v0.1.3 (working?)
  2. appleboy/scp-action@v0.1.4 (not working?)
  3. appleboy/scp-action@209e8c05e0492f6ed6fe8a22dfcaefb083c4cf35 (?)

Thanks.

i tried this. v0.1.3 working for me v0.1.4 , 209e8c05e0492f6ed6fe8a22dfcaefb083c4cf35 and master not

martinmine commented 1 year ago

Can confirm I also have the same issue on scp-action@master:

tar all files into /tmp/ksMjbzXtJD.tar.gz
remote server os type is unix
scp file to server.
create folder /var/www/itemsearch
untar file ksMjbzXtJD.tar.gz
drone-scp error:  dial tcp ***:***: i/o timeout
drone-scp rollback: remove all target tmp file
remove file ksMjbzXtJD.tar.gz

Here is my pipeline yaml for reference.

v0.1.4 and master is broken for me. v0.1.3 is working fine.

ghost commented 1 year ago

The same issue for me on v0.1.4 and all works on v0.1.3. Here is my pipeline:

- name: copy docker-compose via ssh key
      uses: appleboy/scp-action@v0.1.3
      with:
        host: ${{ secrets.DROPLET_SSH_HOST }}
        username: ${{ secrets.DROPLET_SSH_USER }}
        port: 22
        key: ${{ secrets.DROPLET_SSH_PRIVATE_KEY }}
        source: "docker-compose.yml"
        target: "/subscriber-core"
appleboy commented 1 year ago

@dev-subscriber-world @martinmine Thanks for your feedback. I will check the difference between 0.1.4 and 0.1.3

ezio-melotti commented 12 months ago

This might be caused by a rate limit on the server. You can use iptables -L -n and see in the Chain INPUT (policy ACCEPT) section if there are any TCP rate limits on the SSH port you are using (usually 22). To remove/edit the rule, you can use iptables-save > rules.txt; vim rules.txt; iptables-restore < rules.txt.

I had no issues using this action on one server, but when I tried a different one I started getting errors, first while trying to create the folder (while using master or v0.1.4), then while removing the .tar (v0.1.3). Note that I also have rm: true, which likely adds an additional request and causes the action to fail sooner.

I suspect that the number of requests sent by the action increased in version v0.1.4 and this caused the failure. If this is true, I'd recommend mentioning the rate limit in the README and, if possible, reduce the number of requests sent by >=v0.1.4.

relevic commented 11 months ago
appleboy commented 1 month ago

Somebody can provide the server host information which works in v0.1.3 version and does not work in v0.1.4 version. I will try it out.