While running analysis with CLI the error (4) Command Line analysis error which is error code 4 is seen.
at com.castsoftware.highlight.CommandLine.run(CommandLine.java:530)
at com.castsoftware.highlight.HighlightAutomation.main(HighlightAutomation.java:16)
2023-08-21 16:29:24,463 ERROR console: (4) Command Line analysis error
Action Plan
Check if the following errors are also seen.
- Check if there is an error related to checking size: 2023-08-21 15:16:38,715 INFO perl: out: ERROR when checking size: D:/share/CAST/App/CD/ . These error is seen when the path/file name combination is too long. The workaround is to make sure that the Analyze directory path is not more than 255 characters. Please refer CAST HIGHLIGHT - CLI - Command line agent scan is failing when file path is more than 255 characters with an "ERROR when checking size file doesn't exist"
- Check if there are Generated code errors: 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
2023-02-01 00:20:49,563 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 !!!
- 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 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.
- Check in the HL automation log if any particular file is creating the problem with errors like AnalysisPipeline: Analysis failed java.lang.Exception: Analysis child process failed with exit status 137 Check if by excluding the file the analysis proceeds.
-
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, content of HLTemporary in the working directory of the scan.
Related Articles
CAST HIGHLIGHT - CLI - Error Codes
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 - Docker - Results Upload - Upload failed with code 5 when using Docker
CAST HIGHLIGHT - CLI - ERROR: Failed to fetch company with id when using --basicAuth
Highlight Automated Code Scan (Command Line)
Tickets
43171, 42824. 43170, 42821, 42490, 25191, 41805, 42221
Comments