Bamboo SCP Task failed to upload file - Received unknown response code

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

Bamboo SCP Task failed to upload file. The following exception is present in the build log or <bamboo-install>/logs/catalina.out:

Failed to upload file '/opt/bamboo_agent_home/xml-data/build-dir/TEST-PLAN/xxx.war'
net.schmizz.sshj.xfer.scp.SCPException: Received unknown response code
        at net.schmizz.sshj.xfer.scp.SCPEngine.check(SCPEngine.java:92)
        at net.schmizz.sshj.xfer.scp.SCPUploadClient.startCopy(SCPUploadClient.java:64)
        at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:45)
        at net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload(SCPFileTransfer.java:52)
        at com.atlassian.bamboo.plugins.scp.ScpTask.transferFiles(ScpTask.java:418)
        at com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:284)
        at com.atlassian.bamboo.plugins.scp.ScpTask.run(ScpTask.java:127)
        at com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:105)
        at com.atlassian.bamboo.task.TaskExecutorImpl$2.call(TaskExecutorImpl.java:278)
        at com.atlassian.bamboo.task.TaskExecutorImpl$2.call(TaskExecutorImpl.java:274)
        at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:200)
        at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:274)
        at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:106)
        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:124)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:115)
        at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:114)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118)
        at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
        at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
        at java.lang.Thread.run(Thread.java:745)
Copy Failed. Some files were not uploaded successfully.

Cause

A login script on the destination host (e.g. .bashrc) that prints to stdoutscp expects to see its protocol data over the stdin/stdout channels

Resolution

  • Remove the statement or
  • Prefix the statement with: [ -n "$PS1" ] &&
    • E.g. [ -n $"PS1" ] && echo "a"

Last modified on Sep 5, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.