User is getting an error below when trying to perform the Highlight scan in Jenkins Pipeline at the discovery step.
+ java -jar /var/jenkins_home/Highlight-Automation-Command/HighlightAutomation.jar --analyzerDir /var/jenkins_home/Highlight-Automation-Command/perl --workingDir /home/jenkins/workspace/CASTIntegration --sourceDir /var/jenkins_home/Highlight-Automation-Command --login xxxx@castsoftware.com --password xxx--applicationId xxx--companyId xxx--serverUrl https://rpa.casthighlight.com
Command Line version : 5.1.24-RELEASE
Preparing analysis...
Preparation stage completed.
Analysing...
Start discovering
Discovery child process failed with exit status 2
[ERR3] HighlightAutomation --analyzerDir /var/jenkins_home/Highlight-Automation-Command/perl --workingDir /home/jenkins/workspace/CASTIntegration --sourceDir /var/jenkins_home/Highlight-Automation-Command --login xxxx@castsoftware.com --password xxxxx --applicationId xxxx--companyId xxx --serverUrl https://rpa.casthighlight.com failed with code 3
java.lang.Exception: Discovery child process failed with exit status 2
at com.castsoftware.highlight.discover.Discover.process(Discover.java:67)
at com.castsoftware.highlight.AnalysisPipeline.executeAnalysis(AnalysisPipeline.java:106)
at com.castsoftware.highlight.AnalysisPipeline.process(AnalysisPipeline.java:37)
at com.castsoftware.highlight.CommandLine.run(CommandLine.java:262)
at com.castsoftware.highlight.HighlightAutomation.main(HighlightAutomation.java:11)
Solution
The solution is to verify whether the user have Perl installed on the machine by using the command
perl -v
Also we have to install all the required libraries using the below command for the respective OS.
See the requirements section in the documentation here for details:
https://doc.casthighlight.com/product-tutorials-third-party-tools/automated-code-scan-command-line/
After Installing all the required libraries check for the path where perl is installed using the command
which perl
Also the command to be used in the Jenkins Pipeline is as below (add the perlInstallDir parameter extra.)
+ java -jar /var/jenkins_home/Highlight-Automation-Command/HighlightAutomation.jar --analyzerDir /var/jenkins_home/Highlight-Automation-Command/perl --perlInstallDir usr/bin/perl --workingDir /home/jenkins/workspace/CASTIntegration --sourceDir /var/jenkins_home/Highlight-Automation-Command --login xxxx@castsoftware.com --password xxx--applicationId xxx--companyId xxx--serverUrl https://rpa.casthighlight.com
Related Article
CAST HIGHLIGHT - CLI - Discovery child process failed with exit status 2
Highlight Automated Code Scan (Command Line)
Additional Resources
CAST Highlight Troubleshooting Guides
CAST Highlight Product Documentation
Zendesk Ticket Number
# 23875, 30538
Comments