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

Debug mode not working

Open jhasse opened this issue 7 years ago • 12 comments

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 :/

jhasse avatar Mar 17 '17 10:03 jhasse

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

appleboy avatar Mar 17 '17 14:03 appleboy

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 avatar Apr 19 '17 15:04 lcnja

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

lcnja avatar Apr 19 '17 15:04 lcnja

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

alexanderwink avatar Aug 15 '17 19:08 alexanderwink

+1

hkeio avatar Dec 05 '18 18:12 hkeio

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

cyberb avatar Dec 13 '19 16:12 cyberb

+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.

darkguy2008 avatar Jun 06 '20 23:06 darkguy2008

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

digitalica avatar Aug 19 '20 19:08 digitalica

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

Frickeldave avatar Mar 17 '21 05:03 Frickeldave

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

StuartMorris0 avatar Mar 21 '21 22:03 StuartMorris0

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.

Techassi avatar Apr 28 '21 00:04 Techassi

I will take it.

appleboy avatar Apr 09 '23 05:04 appleboy