It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

1 vote

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

Thanks

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

659 views 2 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you