appleboy / drone-scp

Copy files and artifacts via SSH using a binary, docker or Drone CI.
MIT License
142 stars 30 forks source link

Debug mode not working #50

Open jhasse opened 7 years ago

jhasse commented 7 years ago

I'm getting

2017/03/17 10:22:43 host: scp file to server.
2017/03/17 10:22:47 host: create folder /path
drone-scp error:  Process exited with status 1

and tried to debug that by setting debug to true:

docker run --rm \
                              -e PLUGIN_HOST=host \
                              -e PLUGIN_USERNAME=user \
                              -e PLUGIN_PASSWORD=pw \
                              -e PLUGIN_SOURCE="file" \
                              -e PLUGIN_TARGET=/path \
                              -e PLUGIN_DEBUG=true \
                              -e DRONE_REPO_OWNER=appleboy \
                              -e DRONE_REPO_NAME=go-hello \
                              -e DRONE_COMMIT_SHA=e5e82b5eb3737205c25955dcc3dcacc839b7be52 \
                              -e DRONE_COMMIT_BRANCH=master \
                              -e DRONE_COMMIT_AUTHOR=appleboy \
                              -e DRONE_BUILD_NUMBER=1 \
                              -e DRONE_BUILD_STATUS=success \
                              -e DRONE_BUILD_LINK=http://github.com/appleboy/go-hello \
                              -v $PWD:$PWD \
                              -w $PWD \
                              appleboy/drone-scp

I've also tried setting it via a simple .drone.yml, but the output stays the same :/

appleboy commented 7 years ago

I have not implemented debug mode. I will take it asap.

lcnja commented 7 years ago

2017/04/19 14:51:25 172.16.218.238: scp file to server. drone-scp error: error copy file to dest: 172.16.218.238 drone-scp error: error copy file to dest: 172.16.218.238 error copy file to dest: 172.16.218.238 error copy file to dest: 172.16.218.238 1

how to debug?

lcnja commented 7 years ago

scp: image: appleboy/drone-scp host: 172.16.218.238 port: 22 username: root password: ${passwd} target: /vmfs/volumes/vms1/iso source: ./*.iso when: status: success

alexanderwink commented 7 years ago

Any progress on this? It's very hard to find out whats going wrong e.g. when using wildcards in source list

hkeio commented 5 years ago

+1

cyberb commented 4 years ago

It would be great to have this feature, I get this (it was working fine):



tar all files into /tmp/658263401/y2AiHlI6cf.tar
scp file to server.
drone-scp error: ****
error copy file to dest: , error message: Process exited with status 1 
2019/12/13 10:22:08 error copy file to dest: ********, error message: Process exited with status 1
darkguy2008 commented 4 years ago

+1 to debugging, just trying to set this up and I have no idea why it says:

tar all files into /tmp/862925648/XDZfHeRQLN.tar
--
2 | tar: empty archive
3 | exit status 1

So I'm like, WTF?

EDIT:

For those who come here after me: I had to use the shared Drone path (/drone/src) which is shared between pipeline steps. drone-scp is a new step, therefore it can't transfer files that are not in its container files. Basic stuff I know, but it threw me off for an hour or so.

digitalica commented 4 years ago

debug would be nice. I'm stuck with an error trying to use appleboy/scp-action in a github action...

tar all files into /tmp/085014346/hmydY87Rd9.tar
$ tar -cf /tmp/085014346/hmydY87Rd9.tar build/
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 hmydY87Rd9.tar
2020/08/19 19:00:05 Process exited with status 1
Frickeldave commented 3 years ago

+1 Sitting in front of "Process exited with status 1" since hours and try to find the error by staring at the monitor.

StuartMorris0 commented 3 years ago

Also getting this error. As we are uploading a large .tar file I can see the file being pushed onto the server. However, when creating a new folder OR using an existing folder it just errors out Process exited with status 1

tar all files into /tmp/652906755/cQwb4NqbMg.tar
scp file to server.
create folder /test
drone-scp error:  Process exited with status 1
drone-scp rollback: remove all target tmp file
remove file cQwb4NqbMg.tar
2021/03/21 ***:11:59 Process exited with status 1
Techassi commented 3 years ago

I'm also encountering Process exited with status 1. It seems like this is the case when using rm and the plugin tries to remove the target folder with rm -rf <target>. This somehow fails and thus returns an error which in turn cancels the transmission.

I tried to adjust ownership of the folder(s) with chown and even changed privileges to 777 with chmod. To no success. When I manually remove the target folder by SSHing into the machine, the 'deletion' succeeds and tar file is succesfully transmitted.

I briefly looked at the source code but I could not find an obvious issue with error handling of commands executed via a SSH channel... Maybe @appleboy can look into this!

EDIT 1

I just tested this locally (git clone and go build) and it worked without any issues. I then tested it with my pipeline and it magically works now. Maybe @appleboy did some changes and released a new version. I'm not super sure about this, because the latest release was v1.6.2 and was released in June last year.

appleboy commented 1 year ago

I will take it.