While using the action "Get File Or Folder From Remote Agent" fails with the message:
Failed: failed to handle get file from [/tmp/test] to [/tmp]
CA Release Automation 5.5.2
The message above shows us that the "Source Path" is /tmp/test and the "Destination Path" is /tmp
The problem/cause is that the Destination Path /tmp already exists and is the name of a folder. The Destination Path needs to be the name of a file.
Update the "Get File Or Folder From Remote Agent" actions "Destination Path" field/property to use a filename. Example: /tmp/abcdefg
When this scenario is true the agent running the action will log this information similar to the following in its nolio_all.log file:
2016-04-08 10:20:09,868 [job-32773-jobServer-32773-6:Get File Or Folder From Remote Agent(P5787000.F5791000.E5792000):Get File Or Folder From Remote Agent] ERROR (com.nolio.platform.shared.datamodel.Action:249) - failed to execute GetFileFromRemoteAgent.
com.nolio.platform.shared.utils.FileTransferUtils$GetFileException: failed to handle get file from [/tmp/test] to [/tmp]:
at com.nolio.platform.shared.utils.FileTransferUtils.getFileFromRemoteAgent(FileTransferUtils.java:132)
at com.nolio.platform.shared.executables.actions.files.GetFileFromRemoteAgent.getFileIfRequired(GetFileFromRemoteAgent.java:262)
at com.nolio.platform.shared.executables.actions.files.GetFileFromRemoteAgent.innerLocalPreExecution(GetFileFromRemoteAgent.java:203)
at com.nolio.platform.shared.executables.actions.files.AgentsFilesTransferAction.localPreExecution(AgentsFilesTransferAction.java:60)
at com.nolio.platform.shared.datamodel.ActionExecutionState.localExecution(ActionExecutionState.java:331)
at com.nolio.platform.shared.datamodel.ActionExecutionState.access$500(ActionExecutionState.java:39)
at com.nolio.platform.shared.datamodel.ActionExecutionState$2.execAction(ActionExecutionState.java:112)
at com.nolio.platform.shared.datamodel.ActionExecutionState.exec(ActionExecutionState.java:343)
at com.nolio.platform.shared.datamodel.Action.run(Action.java:227)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.nolio.platform.shared.flowcontrol.LocalFlowController$JobBoundThreadFactory$1.run(LocalFlowController.java:788)
at java.lang.Thread.run(Unknown Source)
Caused by: com.nolio.platform.shared.utils.FileTransferUtils$GetFileException: Transferring file to tmp failed.
at com.nolio.platform.shared.utils.FileTransferUtils.getFileFromRemoteAgent(FileTransferUtils.java:119)
... 15 more
Caused by: java.io.IOException: Destination '/tmp' exists but is a directory
at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:796)
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:783)
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:731)
at com.nolio.platform.shared.utils.FileTransferUtils.copyFile(FileTransferUtils.java:194)
at com.nolio.platform.shared.utils.FileTransferUtils.getFileFromRemoteAgent(FileTransferUtils.java:117)
... 15 more
NOTE: Notice the last "Caused by" clause where it shows "java.io.IOException: Destination '/tmp' exists but is a directory.
2016-04-08 10:20:09,870 [job-32773-jobServer-32773-6:Get File Or Folder From Remote Agent(P5787000.F5791000.E5792000):Get File Or Folder From Remote Agent] INFO (com.nolio.platform.shared.datamodel.Action:334) - ------------------------Finished action [Get File Or Folder From Remote Agent(P5787000.F5791000.E5792000):Get File Or Folder From Remote Agent] result [false, failed to handle get file from [/tmp/test] to [/tmp]: ]