net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command had error: scp: /tmp/myproject/1.1.18-SNAPSHOT-434/: Is a directory

Atlassian JIRA | Tomas Vala | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    SCP Task should check whether given Remote Path exists and create it if necessary. At this point it attempts to transfer file(s) to non-existant folder structure and fails. Example. Attempt 1: path fragment ".../*1.1.18-SNAPSHOT-434*/" doesn't exist yet. *{color:red}Fail{color}*. {noformat} 09-V-2013 16:07:28 Starting task 'SCP Task' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask' 09-V-2013 16:07:28 Uploading '/opt/atlassian/bamboo-home/xml-data/build-dir/myplan/myfile.jar'... 09-V-2013 16:07:28 Failed to upload file '/myfile.jar' 09-V-2013 16:07:28 net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command had error: scp: /tmp/myproject/1.1.18-SNAPSHOT-434/: Is a directory 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPEngine.check(SCPEngine.java:90) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPEngine.sendMessage(SCPEngine.java:154) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.sendFile(SCPUploadClient.java:92) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.process(SCPUploadClient.java:73) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.startCopy(SCPUploadClient.java:65) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:45) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload(SCPFileTransfer.java:52) 09-V-2013 16:07:28 at com.atlassian.bamboo.plugins.scp.ScpTask.transferFiles(ScpTask.java:199) 09-V-2013 16:07:28 at com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:97) 09-V-2013 16:07:28 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:188) 09-V-2013 16:07:28 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:94) 09-V-2013 16:07:28 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87) 09-V-2013 16:07:28 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206) 09-V-2013 16:07:28 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103) 09-V-2013 16:07:28 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111) 09-V-2013 16:07:28 at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52) 09-V-2013 16:07:28 at java.lang.Thread.run(Thread.java:722) 09-V-2013 16:07:28 Copy Failed. Some files were not uploaded successfully. {noformat} Attempt 2: path fragment ".../*1.1.18-SNAPSHOT-434*/" has been created manually. *{color:green}Success{color}*. {noformat} 09-V-2013 16:10:10 Starting task 'SCP Task' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask' 09-V-2013 16:10:10 Uploading '/opt/atlassian/bamboo-home/xml-data/build-dir/myplan/myfile.jar'... 09-V-2013 16:10:10 '/opt/atlassian/bamboo-home/xml-data/build-dir/myplan/myfile.jar' was uploaded successfully. {noformat} This becomes an issue if you indend to use variables in Remote Path field, like I do. For instance: {noformat}Remote Path = /tmp/${bamboo.repository.branch.name}/${bamboo.maven.version}-${bamboo.repository.revision.number}/ {noformat} Thanks for considering, Tomas

    Atlassian JIRA | 4 years ago | Tomas Vala
    net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command had error: scp: /tmp/myproject/1.1.18-SNAPSHOT-434/: Is a directory
  2. 0

    SCP Task should check whether given Remote Path exists and create it if necessary. At this point it attempts to transfer file(s) to non-existant folder structure and fails. Example. Attempt 1: path fragment ".../*1.1.18-SNAPSHOT-434*/" doesn't exist yet. *{color:red}Fail{color}*. {noformat} 09-V-2013 16:07:28 Starting task 'SCP Task' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask' 09-V-2013 16:07:28 Uploading '/opt/atlassian/bamboo-home/xml-data/build-dir/myplan/myfile.jar'... 09-V-2013 16:07:28 Failed to upload file '/myfile.jar' 09-V-2013 16:07:28 net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command had error: scp: /tmp/myproject/1.1.18-SNAPSHOT-434/: Is a directory 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPEngine.check(SCPEngine.java:90) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPEngine.sendMessage(SCPEngine.java:154) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.sendFile(SCPUploadClient.java:92) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.process(SCPUploadClient.java:73) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.startCopy(SCPUploadClient.java:65) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:45) 09-V-2013 16:07:28 at net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload(SCPFileTransfer.java:52) 09-V-2013 16:07:28 at com.atlassian.bamboo.plugins.scp.ScpTask.transferFiles(ScpTask.java:199) 09-V-2013 16:07:28 at com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:97) 09-V-2013 16:07:28 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:188) 09-V-2013 16:07:28 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:94) 09-V-2013 16:07:28 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87) 09-V-2013 16:07:28 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206) 09-V-2013 16:07:28 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103) 09-V-2013 16:07:28 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111) 09-V-2013 16:07:28 at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52) 09-V-2013 16:07:28 at java.lang.Thread.run(Thread.java:722) 09-V-2013 16:07:28 Copy Failed. Some files were not uploaded successfully. {noformat} Attempt 2: path fragment ".../*1.1.18-SNAPSHOT-434*/" has been created manually. *{color:green}Success{color}*. {noformat} 09-V-2013 16:10:10 Starting task 'SCP Task' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask' 09-V-2013 16:10:10 Uploading '/opt/atlassian/bamboo-home/xml-data/build-dir/myplan/myfile.jar'... 09-V-2013 16:10:10 '/opt/atlassian/bamboo-home/xml-data/build-dir/myplan/myfile.jar' was uploaded successfully. {noformat} This becomes an issue if you indend to use variables in Remote Path field, like I do. For instance: {noformat}Remote Path = /tmp/${bamboo.repository.branch.name}/${bamboo.maven.version}-${bamboo.repository.revision.number}/ {noformat} Thanks for considering, Tomas

    Atlassian JIRA | 4 years ago | Tomas Vala
    net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command had error: scp: /tmp/myproject/1.1.18-SNAPSHOT-434/: Is a directory

    Root Cause Analysis

    1. net.schmizz.sshj.xfer.scp.SCPException

      Remote SCP command had error: scp: /tmp/myproject/1.1.18-SNAPSHOT-434/: Is a directory

      at net.schmizz.sshj.xfer.scp.SCPEngine.check()
    2. sshj
      SCPFileTransfer.upload
      1. net.schmizz.sshj.xfer.scp.SCPEngine.check(SCPEngine.java:90)
      2. net.schmizz.sshj.xfer.scp.SCPEngine.sendMessage(SCPEngine.java:154)
      3. net.schmizz.sshj.xfer.scp.SCPUploadClient.sendFile(SCPUploadClient.java:92)
      4. net.schmizz.sshj.xfer.scp.SCPUploadClient.process(SCPUploadClient.java:73)
      5. net.schmizz.sshj.xfer.scp.SCPUploadClient.startCopy(SCPUploadClient.java:65)
      6. net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:45)
      7. net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload(SCPFileTransfer.java:52)
      7 frames
    3. com.atlassian.bamboo
      NamedThreadFactory$2.run
      1. com.atlassian.bamboo.plugins.scp.ScpTask.transferFiles(ScpTask.java:199)
      2. com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:97)
      3. com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:188)
      4. com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:94)
      5. com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87)
      6. com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206)
      7. com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103)
      8. com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111)
      9. com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52)
      9 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:722)
      1 frame