While using Cast Highlight CLI for uploading results, with --login and --password everything works as expected. But when using --basicAuth with the same login (base64 encode and split with :), you may get the following error message:
com.castsoftware.highlight.RTExceptionWithStatus: Failed to fetch company with id='****'
at com.castsoftware.highlight.RTExceptionWithStatus.errUpload(RTExceptionWithStatus.java:47)
at com.castsoftware.highlight.upload.Upload.fetchCompanyId(Upload.java:67)
at com.castsoftware.highlight.upload.Upload.process(Upload.java:285)
at com.castsoftware.highlight.AnalysisPipeline.upload(AnalysisPipeline.java:128)
at com.castsoftware.highlight.AnalysisPipeline.process(AnalysisPipeline.java:41)
at com.castsoftware.highlight.CommandLine.run(CommandLine.java:262)
at com.castsoftware.highlight.HighlightAutomation.main(HighlightAutomation.java:11)
Caused by: java.lang.IllegalArgumentException: Failed to fetch company with id='****'
... 6 more
Caused by: org.springframework.web.client.HttpClientErrorException: 401
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:86)
at com.castsoftware.highlight.util.RestTemplateSSL$1.handleError(RestTemplateSSL.java:94)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:708)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:661)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:621)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:567)
at com.castsoftware.highlight.upload.Upload.fetchCompanyId(Upload.java:59)
... 5 more
Workaround
The issue is due to encoding of the basicAuth field.
The error mentioned occurs when the base64 code of login and password is wrong.
To solve the issue
1. Arrange username and password in the below format: separated by a colon
Username:Password
2. Now convert them to base 64 code: (you can use URL https://www.base64encode.org/)
3. Now copy the code in your command: after basic auth
Java -jar HighlightAutomation --sourceDir <sourcedirectorypath> --workingDir <working directory path> --ignoreDirectories .Tests,Docs,bin,obj,.git,.vs --applicationId <app id> --companyId <company id> --basicAuth **** --serverUrl https://rpa.casthighlight.com
Related Articles
CAST HIGHLIGHT - CLI - Error Codes
CAST HIGHLIGHT - CLI - Upload failed with error Failed to fetch company with id='XXXX'
Additional Resources
CAST Highlight Troubleshooting Guides
CAST Highlight Product Documentation
Zendesk Ticket Number
25708
Comments