scp-action
scp-action copied to clipboard
drone-scp error: Process exited with status 1
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
.
In fact, rm
does remove target folder content, but rest fails.
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.
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
@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)
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 ?