AIP Console - AIP Console Tools - Add Version Error - Unable to check remote location of provided folder

Purpose (problem description)

When initiating the Add Version step in AIP Console through the CLI tools jar, the process fails with the error - 

ERROR — Error occurred while attempting to upload the given file.

com.castsoftware.aip.console.tools.core.exceptions.UploadException: Unable to check remote location of provided folder.

Command line used:

<Folder containting om.castsoftware.aip.console.tools.1.28.0-funcrel>java -jar .\aip-console-tools-cli.jar add --apikey="XVEM9CJ1.vl8u3lPg1IJpfnUtQzjKD0XgcmDAiFSA" -n "TKT_CRIF" -f "C:\Users\SKS\Downloads" --verbose=false

The logs generated when the issue occurred can be seen below

C:\Users\SKS\Downloads\Compressed\com.castsoftware.aip.console.tools.1.28.0-funcrel>java -jar .\aip-console-tools-cli.jar add --apikey="XVEM9CJ1.vl8u3lPg1IJpfnUtQzjKD0XgcmDAiFSA" -n "TKT_CRIF" -f "C:\Users\SKS\Downloads" --verbose=false

2022-06-07 16:00:49.148 - INFO --- AddVersion version command has triggered with log verbose mode = 'false'

2022-06-07 16:00:49.151 - INFO --- [Debug options] Show Sql is 'false'

2022-06-07 16:00:49.152 - INFO --- [Debug options] AMT Profiling is 'false'

2022-06-07 16:00:49.152 - INFO --- Searching for application 'TKT_CRIF' on AIP Console

2022-06-07 16:00:49.687 -ERROR --- Error occurred while attempting to upload the given file.

com.castsoftware.aip.console.tools.core.exceptions.UploadException: Unable to check remote location of provided folder.

        at com.castsoftware.aip.console.tools.core.services.UploadServiceImpl.uploadFileAndGetSourcePath(UploadServiceImpl.java:110) ~[aip-console-tools-core-1.28.0.jar!/:1.28.0]

        at com.castsoftware.aip.console.tools.commands.AddVersionCommand.call(AddVersionCommand.java:220) [classes!/:1.28.0]

        at com.castsoftware.aip.console.tools.commands.AddVersionCommand.call(AddVersionCommand.java:39) [classes!/:1.28.0]

        at picocli.CommandLine.executeUserObject(CommandLine.java:1953) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at picocli.CommandLine.access$1300(CommandLine.java:145) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:2172) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at picocli.CommandLine.parseWithHandlers(CommandLine.java:2550) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at picocli.CommandLine.parseWithHandler(CommandLine.java:2485) [picocli-4.6.1.jar!/:task ':jar' property 'archiveVersion']

        at com.castsoftware.aip.console.tools.AipIntegrationCliMain.run(AipIntegrationCliMain.java:46) [classes!/:1.28.0]

        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]

        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:768) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:322) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]

        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]

        at com.castsoftware.aip.console.tools.AipIntegrationCliMain.main(AipIntegrationCliMain.java:35) [classes!/:1.28.0]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_333]

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]

        at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_333]

        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [aip-console-tools-cli.jar:1.28.0]

        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [aip-console-tools-cli.jar:1.28.0]

        at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [aip-console-tools-cli.jar:1.28.0]

        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [aip-console-tools-cli.jar:1.28.0]

Caused by: com.castsoftware.aip.console.tools.core.exceptions.ApiCallException: Response code from API was unexpected : 412

Content was [{"arguments":{},"code":"pathNotAllowed","defaultMessage":"The path type is not allowed","field":"pathType"}]

        at com.castsoftware.aip.console.tools.core.services.RestApiServiceImpl.exchangeForEntity(RestApiServiceImpl.java:278) ~[aip-console-tools-core-1.28.0.jar!/:1.28.0]

        at com.castsoftware.aip.console.tools.core.services.RestApiServiceImpl.exchangeForEntity(RestApiServiceImpl.java:247) ~[aip-console-tools-core-1.28.0.jar!/:1.28.0]

        at com.castsoftware.aip.console.tools.core.services.RestApiServiceImpl.postForEntity(RestApiServiceImpl.java:160) ~[aip-console-tools-core-1.28.0.jar!/:1.28.0]

        at com.castsoftware.aip.console.tools.core.services.UploadServiceImpl.uploadFileAndGetSourcePath(UploadServiceImpl.java:107) ~[aip-console-tools-core-1.28.0.jar!/:1.28.0]

        ... 24 common frames omitted

Observed in AIP console versions

ReleaseYes/No
AIP Console V1

Observed in RDBMS

RDBMSYes/No
Oracle ServerN/A
Microsoft SQL ServerN/A
CSS3N/A
CSS2N/A

Step by Step scenario

  1. Create a new version in AIP Console by using AIP Console tools
  2. The task fails immediately with the error: ERROR — Error occurred while attempting to upload the given file.

Action Plan

The issue occurs because the  path defined after the argument -f in the command is not a file path ( It is a folder path)

<Folder containting om.castsoftware.aip.console.tools.1.28.0-funcrel>java -jar .\aip-console-tools-cli.jar add --apikey="XVEM9CJ1.vl8u3lPg1IJpfnUtQzjKD0XgcmDAiFSA" -n "TKT_CRIF" -f "C:\Users\SKS\Downloads" --verbose=false

To troubleshoot the issue, 

  1. Change the path defined after argument -f  to a file path pointing to the zip as shown below

java -jar .\aip-console-tools-cli.jar add –apikey=“XVEM9CJ1.vl8u3lPg1IJpfnUtQzjKD0XgcmDAiFSA” -n “TKT_CRIF” -f “C:\Users\SKS\Downloads\abc.zip” –verbose=false

2. If the above steps do not solve your issue contact [CAST Technical Support](https://help.castsoftware.com/hc/en-us/requests/new). with the following [Relevant input](#AIPConsoleAIPConsoleToolsAddVersionErrorUnabletocheckremotelocationofprovidedfolder-Relevantinput) for CAST Technical Support to carry out further investigation.

 

#### Relevant input

- CAST AIP Console Logs
- Details of specific steps done
- Any applicable screenshots

Ticket # 36393