SCP Plugin Throws Exception When Trying to Transfer Multiple Files

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

This widget could not be displayed.

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

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.

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

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

This widget could not be displayed.

Thanks

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

32 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you