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

drone-scp error: Process exited with status 1 #144

Open reza00farjam opened 9 months ago

reza00farjam commented 9 months ago

Hi, I have this simple setup:

- name: Upload build files to VPS via SSH
  uses: appleboy/scp-action@v0.1.4
  with:
    host: ${{ secrets.SSH_HOST }}
    port: ${{ secrets.SSH_PORT }}
    username: ${{ secrets.SSH_USERNAME }}
    password: ${{ secrets.SSH_PASSWORD }}
    rm: true
    source: "./build/web/*"
    target: "${{ secrets.SCP_TARGET }}"
    strip_components: 2

But it ends up with this error:

tar all files into /tmp/RmOmwBuqmG.tar.gz
scp file to server.
Remove target folder: ***
drone-scp error:  Process exited with status 1
drone-scp rollback: remove all target tmp file
remove file RmOmwBuqmG.tar.gz
2023/09/27 00:54:42 Process exited with status 1  

My SCP_TARGET is /var/www/example.com/html.

reza00farjam commented 9 months ago

In fact, rm does remove target folder content, but rest fails.

reza00farjam commented 9 months ago

I fixed it by set user to root instead of my non-root user. But I don't mark this issue as closed because there should be a solution for non-root user as well.

Root3287 commented 9 months ago

afaik there is an issue with appleboy/drone-scp that may be related. You could also try using the previous version appleboy/scp-action@v0.1.3

Related issues: #106 and appleboy/drone-scp#170

Eriteym commented 5 months ago

@reza00farjam Hi, I had a similar problem, but it was that I accidentally created a directory, on behalf of the root user, and non-root. Please check with yourself, the owner of the directory using the ls -lacommand, if it was created as root, then recreate it as a non-root user, this should solve your problem, it solved for me)

Maximauve commented 5 months ago

Hi, I have the same issue. My job works fine if I run it with root user, but is there a solution where we can run as a normal user with sudo privileges ?