CAST HIGHLIGHT - CLI - Error code 5 - Command Line result upload error

When trying to run the command line it is failing with (5) Command Line result upload error.

Action Plan

  1. Check the  user status, user role, and domain. The error code 5  - Command-Line result upload error" is usually seen with the permission issues with User ID / Password. 
    1.  Check whether  --login , --password and –-serverUrl are entered correctly.
    2.  Check whether the user has changed the password for the login to HL whether the user was able to login and upload results previously.
    3. Check whether the account is locked.
    4. If token feature is enabled for the instance, use user tokens instead.
    5. Check whether the user role has  the permission to upload. eg, Application contributor role, Domain contributor or Portfolio Manager has the permission to upload.
    6. Check whether the user is attached to the correct domain.
  2. Check whether there is any proxy involved. If proxy is there user needs to pass the proxy parameters to the command line so that it can reach Highlight server through the proxy. An example can be found in the Command Line readme. Below is the sample command line with proxy 

Special configuration for proxy server
Using a proxy server for upload.

Proxy with no password :
-Dhttps.proxyHost=<your proxy host>
-Dhttps.proxyPort=<your proxy port>

If a password is requested for proxy add the following additional parameter

java -Dhttps.proxyHost=your proxy host -Dhttps.proxyPort=your proxy port -Dhttps.proxyUser=user -Dhttps.proxyPassword=password -jar HighlightAutomation.jar --workingDir "C:\highlight-myproject" --sourceDir "C:\myproject\src" --login xxx --password xxxx  

      1. If using a proxy, and if the proxy name is similar to (http://something) check whether using  the proxy name without http;//  solves the issue.
      2. Ensure that the format of the command is followed. For eg proxy name need not be given in quotes.
  1. Confirm whether the TLS version used is supported by Highlight. Check in the logs for messages like Remote host terminated the handshake                              Check the log, to find out the TLS version used 
                        "ClientHello": {
      "client version"      : "TLSv1.2",
    "supported_versions (43)": {
          "versions": [TLSv1.3]
        },                                                                                                                                                      Configure Jenkins to use the TLS version used by Highlight or edit the command to correct the TLS version used. To find out the TLS version used by Highlight 
    1. Open highlight URL in chrome browser and open developer tools.
    2. Go to security tab and in connection details we can determine the version of TLS that is being used.
    3. Match the TLS format in command line and check if upload works.
  2. Check whether user is trying with a campaign name (snapshotLabel) that already exists? CLI uploads create their own campaigns. If so  try without a snapshotLabel and/or a unique one.
  3. If you are getting messages like "ERROR AnalysisPipeline: Upload failed
    com.castsoftware.highlight.RTExceptionWithStatus: PKIX path building failed: unable to find valid certification path to requested target" please check out the workarounds mentioned in CAST HIGHLIGHT - SSL - "PKIX path building failed: unable to find valid certification path to requested target"
  4. If there are errors like - Caused by: java.lang.Exception: Failed to upload file 'Java-2023_0018.CloudReady.csv' to application result id='6369' with company [name='xxxxx='000000'] and application [name='XXXX',id=1234], which helps in identifying the particular file and the application then try to upload the app manually and sees if it throws the error. 
  5. Check if there are any errors such as  UTF-8 "\xE7" does not map to Unicode at perl/ line XX and/or ERROR highlight: No header can be extracted to patch framework files (if all the code is not properly encoded) related to encoding which was not readable by Highlight. Please refer CAST HIGHLIGHT - Results Upload - CLI - UTF-8 "\xE7" does not map to Unicode at perl/ line xx
  6. If NoAnalysis messages are seen in logs it means there are no results or there is an empty analysis upload, hence upload has failed.  
    1. Check if the --workingDir option is included in the CLI
    2. Check if there is a post the analysis completion. If yes, please try to upload it manually for that application.
    3. Check if the result zip file has .csv files in the root path. If not move the .csv file to the root path .zip file. Then result will get uploaded. 
    4. Check the result csv's. If there is no code that has been analyzed, but there are a few dlls found in the binary library csv file, then add one 'dummy' source file to the analysis so that the binary library csv has some context.
    5. Check whether code is not accessible due to some permission issues. 
    6. Check if source code contains only technologies that are not supported by Highlight. Then you may get the error ERROR AnalysisPipeline: Discover failed
      java.lang.Exception: Discovery child process failed with exit status 13. If Highlight is not able to find any source code for the technologies supported it may go directly from the discovery step to the upload step without listing any technologies as there is nothing to scan thus generating the error. Please refer CAST HIGHLIGHT - CLI - ERROR AnalysisPipeline: Discovery child process failed with exit status 13
  7. If you see errors like this in HL Automation log    2023-06-21 13:40:31,881 INFO  perl: out: Out of memory!  2023-06-21 13:40:31,881 INFO  perl: out: Out of memory! then the analysis ended with "out of memory" before it reached the upload stage. Then split the scan as recommended in the Getting Started Guide.
  8. If there are errors like --appendResult --skipSubmit failed with code 5 check whether you are using both --appendResult and --skipSubmit together in the command.  It is recommended to use --skipSubmit and scan the result first and then in the second scan use --appendResult. Both should not be used in the same command. One of the following should be the criteria 
      • if the source code is complete you should not use either flag
      • If it's the first set of files to upload then you should only use --skipSubmit
      • If it's the second set to upload then you should only use--appendResult
  9. If in the HL Automation log the error is  Failed to fetch company with id='xxxxx' then follow  CAST HIGHLIGHT - Results Upload - CLI - Failed to fetch company with id='XXXX'
  10. Use the latest version of the CLI. As the platform evolves (new features, new API endpoints, etc.), the command line also uses some of these functionalities. 



Related Articles


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 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 - Results Upload - Partial Upload of CSV files when Manual Upload was attempted

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 - Scan fails for an application with an error Failed to fetch company with id XXXSTDERR

CAST HIGHLIGHT - CLI - ERROR Failed to upload submission for application result id='XXXXXX' with company [name='XXX',id='XXXX'] and application [name='XXX',id=XXXXX] message: 400 highlight.server.client.campaignApplication.update.NoAnalysis

CAST HIGHLIGHT - Results Upload - CLI - UTF-8 "\xE7" does not map to Unicode at perl/ line xx

Highlight Automated Code Scan (Command Line)



29229, 37307, 36849, 40904, 43479, 41938, 42213, 44762, 44434, 44352, 45115, 43169, 45962,46149


Have more questions? Submit a request


Powered by Zendesk