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

drone-scp error: Process exited with status 1

Open reza00farjam opened this issue 1 year ago • 5 comments

Hi, I have this simple setup:

- name: Upload build files to VPS via SSH
  uses: appleboy/[email protected]
  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 avatar Sep 27 '23 01:09 reza00farjam

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

reza00farjam avatar Sep 27 '23 01:09 reza00farjam

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.

reza00farjam avatar Sep 30 '23 12:09 reza00farjam

afaik there is an issue with appleboy/drone-scp that may be related. You could also try using the previous version appleboy/[email protected]

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

Root3287 avatar Oct 02 '23 05:10 Root3287

@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 -la command, if it was created as root, then recreate it as a non-root user, this should solve your problem, it solved for me)

Eriteym avatar Jan 19 '24 15:01 Eriteym

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 ?

Maximauve avatar Jan 31 '24 12:01 Maximauve