Self-Hosted Errors and Solutions

CodeScan Self-Hosted (On-Premises)

Errors and Solutions

Why did I get the following error during initialization of VM: Could not reserve enough space for xxxKB object heap?

If you are experiencing this error when running a scan, the issue may be with your Java version. 32-bit Java versions have a lower limit to their heap size. This limit can be as low as 1.6GB on Windows operating systems.

If you are running a 64-bit operating system, you will need to upgrade to a 64-bit version of Java.

You can check whether your Java version is 32 or 64-bit by using the command: java -d64 -version in your command prompt or terminal. If you have a 32-bit version of Java installed, you will get the message:

Error: This Java instance does not support a 64-bit JVM.

To correct this error, please install the proper Java version.

Why am I getting the error: java.lang.OutOfMemoryError: GC overhead limit exceeded?

This error can be solved by manually adding a parameter to your Ant environment path variable.

In Windows:

set ANT_OPTS=%ANT_OPTS% -Xmx2048M

In Linux/OS X:

export ANT_OPTS=$ANT_OPTS -Xmx2048M

If the problem persists, please contact support@autorabit.com.

Why am I getting the error: Jenkins: java.lang.OutOfMemoryError: Java heap space?

This error can be solved by manually adding a parameter to dedicate memory to the build process.

  1. In your Jenkins project, click Configure.

  2. Scroll down to the Build section of the page to the Build Step titled Invoke Ant with the fields:

    • Ant Version: CodeScan Bundled Ant

    • Targets: sonar

  3. Click on Advanced.

  4. In the Java Options field, add the parameter -Xmx2000m. This will assign 2000mb of memory to you build.

If after increasing the heap space, you get the error:

Error occurred during initialization of VM Could not reserve enough space for xxxxxxKB object heap

The problem may be that you are using a 32-bit version of Java. Please refer to the following article for more details.

Why am I getting a PKIX Path Building failed error?

Error Code:

javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: 
PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target.

This error occurs when the Java environment does not trust the certificate of the server running your SonarQube™ instance.

To correct this issue, you need to install the server certificate to the Java key.

  1. In your browser, to the left of the URL, there is a lock icon (). Click on this icon and a window will pop up.

  2. From the window, select Connection is secure.

  1. Next, select the second option: Certificate is valid.

  1. Go to the Details tab and click on Export.

  1. Rename the certificate (e.g., codescan-certificate), then choose a location and save the certificate.

  1. The next process is to install the certificate in the cacerts file of the jdk installed in the system using the command line.

Command:

keytool -import -alias {alias-name for the certificate} -keystore “{path for the cacerts file}” -file {path where we have save the certificate}

Example:

keytool -import -alias codescan-certificate -keystore "C:\Program Files\Java\jdk-11.0.9\lib\security\cacerts" -file c:/tmp/codescan-certificate.crt

When adding the certificate, password is required. The password is changeit.

Note:

If adding the certificate as a trusted certificate to the Java Keystore still results in the PKIX path building failed error, delete the currently installed certificate from the Java Keystore, export a new certificate, and then attempt a new installation of the certificate.

Command to list all of the certificates from the Java Keystore: keytool -list -v -keystore “{path for the cacerts file}” > /tmp/certs_list.txt

Example: keytool -list -v -keystore “c:\Program Files\Java\jdk-11.0.13\lib\security\cacerts” > /tmp/certs_list.txt Command to delete the certificate: keytool -delete -noprompt -alias {alias-name for the certificate} -keystore “{path for the cacerts file}”

Example: keytool -delete -noprompt -alias codescan-certificate -keystore “c:\Program Files\Java\jdk-11.0.13\lib\security\cacerts”

Last updated