SCP Plugin Throws Exception When Trying to Transfer Multiple Files

Arif Khan December 31, 2014

I am using Atlasssian Bamboo version 5.0 build 3715 - 11 Jul 13. I tried adding scp task to my build plan in order to transfer some build artifacts to a remote server. When trying to transfer multiple files (by comma separated list or by ant pattern or the whole directory), I encounter this exception:

net.schmizz.sshj.xfer.scp.SCPException: EOF while expecting response to protocol message

However If I add separate scp task for each file, there is no problem.

I tried to transfer the same files using my local scp client and my local scp client can transfer them to the remote with no problem. I tried with different set of files. Only once bamboo scp plugin could send multiple files. Does anybody know whats the problem?

2 answers

1 vote
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 1, 2015

Hello Arif,

Thank you for your question.

I would kindly suggest you the following:

  1. please, create a new Plan
  2. please, add a Script task as per following:

    # on Linux
    echo "foo" > foo.txt
    echo "bar" > bar.txt
    
    mkdir directory
    echo "foo" > directory/foo.txt
    echo "bar" > directory/bar.txt
    # on Windows
    echo "foo" > foo.txt
    echo "bar" > bar.txt
    
    md directory
    echo "foo" > directory/foo.txt
    echo "bar" > directory/bar.txt
  3. please, add a SCP task as per following:

    Local Path*:
    foo.txt,bar.txt,directory/foo.txt,directory/bar.txt
     
    Remote Path:
    /path/to/remote/server
     
    [ ] Use Ant patterns to select files
  4. As a result, you would have the following in the build log and the files copied to the "Remote Path" provided.

    ...
    simple	01-Jan-2015 12:50:49	Finished task 'Script'
    simple	01-Jan-2015 12:50:49	Starting task 'SCP Task' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask'
    simple	01-Jan-2015 12:50:50	Performing a recursive copy...
    simple	01-Jan-2015 12:50:50	Uploading 'bar.txt'...
    simple	01-Jan-2015 12:50:50	Creating remote directory 'directory'...
    simple	01-Jan-2015 12:50:50	Creating remote directory 'directory'...
    simple	01-Jan-2015 12:50:50	Uploading 'foo.txt'...
    simple	01-Jan-2015 12:50:50	Uploading '<bamboo-home>/xml-data/build-dir/PROJ-SCP-JOB1/bar.txt'...
    simple	01-Jan-2015 12:50:50	'<bamboo-home>/xml-data/build-dir/PROJ-SCP-JOB1/bar.txt' was uploaded successfully.
    simple	01-Jan-2015 12:50:50	Uploading '<bamboo-home>/xml-data/build-dir/PROJ-SCP-JOB1/directory'...
    simple	01-Jan-2015 12:50:50	Uploading 'directory/bar.txt'...
    simple	01-Jan-2015 12:50:50	Uploading 'directory/foo.txt'...
    simple	01-Jan-2015 12:50:50	'<bamboo-home>/xml-data/build-dir/PROJ-SCP-JOB1/directory' was uploaded successfully.
    simple	01-Jan-2015 12:50:50	Uploading '<bamboo-home>/xml-data/build-dir/PROJ-SCP-JOB1/foo.txt'...
    simple	01-Jan-2015 12:50:50	'<bamboo-home>/xml-data/build-dir/PROJ-SCP-JOB1/foo.txt' was uploaded successfully.
    simple	01-Jan-2015 12:50:50	Finished task 'SCP Task'
    ...

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

David Mine December 29, 2015

Is there any way to accomplish this without listing all my files followed by a comma? I would like to copy the folder's contents without having to do that.

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 30, 2015

Hello David, In 'Local Path', please use: **/* (it will copy everything) foo/* (it will copy everything from 'foo')

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 30, 2015

Hello David, Please, be aware of the following https://jira.atlassian.com/browse/BAM-14439

0 votes
Arif Khan January 5, 2015

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events