While running analysis with CLI the error (4) Command Line analysis error which is error code 4 is seen.
Action Plan
Check if the following errors are also seen.
- Check if there is any error related to memory such as INFO perl: out: Out of memory!. If it is there please refer CAST HIGHLIGHT - CLI - perl: out: Out of memory! ERROR AnalysisPipeline: Analysis failed
-
Check if the file size exceeds 10,000, check for messages similar to the ones below in the logs.
Processing: CCpp for 14476 files
Analysis child process failed with exit status 255By default the size of the file that can be analysed is set to the recommended 3MB and it is recommended to split the scan if file count exceeds 10,000 files. Please refer CAST HIGHLIGHT - Analysis - How to manage the file size and file count limits set for analysis?
- Check if there are Generated code errors like Lib::GeneratedCodeException
As per the getting started guide (https://doc.casthighlight.com/Getting-Started-Guide.pdf), Generated code (e.g. *.t.ds, *.flow.js) should be excluded as they are automatically produced by the system. The development team can't really manage software health of this aspect of the code. Please refer CAST HIGHLIGHT - Discovery Step - Additional files that should be excluded or included in the analysis - Check if there are Encoding errors
INFO perl: out: UTF-8 "\xF3" does not map to Unicode at perl/FileList.pm line 68, line 16. Having the source code in UTF-8 encoding is a pre-requisite. Every file in the analysis should have an encoding readable by Highlight. Please refer CAST HIGHLIGHT - Results Upload - CLI - UTF-8 "\xE7" does not map to Unicode at perl/FileList.pm line xx - Check in the logs whether the same working directory is reused for concurrent scans. If running concurrent scans, then the working directory should be unique for each scan.
- While running analysis on a PHP file if you get the error perl: out: PARSE error : unterminated PHP section started at line 1 !!! then please refer CAST HIGHLIGHT - Analysis - PHP - perl: out: PARSE error : unterminated PHP section started at line 1 !!!
- If there is analysis Error - java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 0, the issue occurs when multiple scans are run in parallel. Run the scans one by one.
-
If in the log the error AnalysisPipeline: Analysis failed java.lang.Exception: Analysis child process failed with exit status 137 is seen.
-
-
- Check in the HL automation log if any particular file is creating the problem and check if by excluding the file the analysis proceeds.
-
-
-
If the analysis fails while parsing yarn.lock file then take a small part of code and include all the yarn.lock files to see where it fails by trying with the exclusion, starting from the last file. Once the correct yarn.lock file is identified exclude it in the main analysis and proceed. INFO perl: out: [framework] yarn.lock : I:\chat\yarn.lock
INFO perl: out: * Parsing I:\chat\yarn.lock
ERROR AnalysisPipeline: Analysis failed
java.lang.Exception: Analysis child process failed with exit status 255
at com.castsoftware.highlight.HighlightAutomation.main(HighlightAutomation.java:16)
ERROR console: (4) Command Line analysis error
- Check if you are using the correct version of the Perl required by the CLI (eg: Highlight CLI 5.9.x requires Perl 5.40).The latest and correct version of Perl comes with the latest version of the Code reader. Install the latest version of CAST Highlight’s Code Reader on your machine as it embeds the required Perl binaries (eg: Latest version of Code Reader installs Strawberry 5.40 for CLI version 5.9.x). Please check the section "Requirements" in Highlight Automated Code Scan (Command Line) for alternatives.
- Use the latest version of the CLI. As the platform evolves (new features, new API endpoints, etc.) are added, the command line also uses some of these functionalities.
-
If the issue is still not resolved to get a workaround please raise an incident ticket to support and provide the below details. - HLAutomation.log, OS and the JVM version
Related Articles
CAST HIGHLIGHT - CLI - Error Codes
CAST HIGHLIGHT - CLI - Error code 2 - Command Line options parse error
CAST HIGHLIGHT - CLI - Error code 3 - Command Line techno discovery error
CAST HIGHLIGHT - CLI - Error code 4 - Command Line analysis error
CAST HIGHLIGHT - CLI - Error code 5 - Command Line result upload error
CAST HIGHLIGHT - CLI - Error code 6 - Command Line source dir or output dir validation error
CAST HIGHLIGHT - CLI - Error code 9 - Command Line unziping jars or zip error
CAST HIGHLIGHT - CLI - Docker - Results Upload - Upload failed with code 5 when using Docker
CAST HIGHLIGHT - CLI - ERROR: Failed to fetch company with id when using --basicAuth
CAST HIGHLIGHT - CLI - Analysis child process failed with exit status 1
Highlight Automated Code Scan (Command Line)
Additional Resources
CAST Highlight Troubleshooting Guides
CAST Highlight Product Documentation
Tickets
43171, 42824. 43170, 42821, 42490, 25191, 41805, 42221, 44443, 47057, 52160
Comments