Troubleshooting

Here are some strategies to troubleshoot problems you might have while analyzing your code with SonarQube Cloud.

Issues when analyzing your code

Code platform authentication error

An error occurred due to a communication error with your code repository platform. This is often a temporary issue.

To resolve this issue, commit and push a code change to your repository to trigger a new analysis.

Missing SonarQube Cloud app on fork

An error occurred when analyzing a pull request from a private forked repository.

To resolve this issue, follow these steps:

  1. Install the SonarQube Cloud application on the forked repository.

  2. Commit and push a code change to the pull request to trigger a new analysis.

Compute engine timeout

The analysis exceeded the maximum time limit of 30min. This usually happens with very large or complex projects.

To resolve this issue, refer to the "Getting Started" guide for your code repository and try to scan your project using another CI tool. This allows you to use stronger, self-managed hardware and avoid strict time limits.

Number of lines exceeded

The analysis failed because the total number of lines of code in your organization exceeds your current subscription limit.

To resolve this, review your usage and if necessary upgrade your plan. See the Introduction to managing your subscription page for more details.

Then, commit and push a code change to your repository to trigger a new analysis.

Organization is suspended

Your organization has been suspended.

To resolve this, you need to update the billing information for your organization. See Updating billing or payment details for more information.

Then, commit and push a code change to your repository to trigger a new analysis.

Quality gate condition is ignored

Conditions on Coverage and Duplicated lines are not calculated when there are fewer than 20 lines.

For example, if you want to release a simple bug fix that requires only a couple of lines, it could be impossible to release because you can’t meet your coverage requirement. Another case could be you start working on a new version, and the first few lines of code that are pushed are involved in a duplication; your quality gate will be red until more lines are added.

Users unable to use groups ( SAML group number over 150)

You use SAML with Microsoft Entra ID and some users are automatically removed from groups. This may mean that you have reached the SAML group limitation (for these users, the groups claim is replaced by http://schemas.microsoft.com/claims/groups.link). Microsoft Entra ID SAML tokens have a limit regarding the number of groups a user can belong to. See the description of groups in the Claims in SAML Token table.

In such cases, you might need to reduce the number of groups these users are in.

Automatic Analysis timeout

The analysis exceeded the maximum time limit of 45min for Automatic Analysis. This usually happens with very large or complex projects.

To resolve this issue, refer to the ‘Getting Started’ guide for your code repository and try to scan your project using another CI tool. This allows you to use stronger, self-managed hardware and avoid strict time limits.

Please refer to the ‘Getting Started’ guide for your code repository and try to scan your project using another CI tool.

Out of memory

The analysis failed because it exceeded the maximum memory available for Automatic Analysis. This usually happens with very large or complex projects.

To resolve this issue, refer to the ‘Getting Started’ guide for your code repository and try to scan your project using another CI tool. This allows you to use stronger, self-managed hardware and avoid strict time limits.

Missing file path pattern in issue scope

An issue scope is missing a mandatory file path pattern.

To resolve this, review the Restrict Scope of Coding Rules configuration in the Analysis Scope and ensure each entry includes a file path pattern.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on restricting specific files from specific coding rules, see Excluding specific files from specific coding rules.

Missing file path in ignore scope

A rule ignoring scope is missing a mandatory file path pattern.

To resolve this, review the Ignore Issues on Multiple Criteria configuration at the project level under Administration > General Settings > Analysis Scope, and ensure each entry includes a file path pattern.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on excluding specific files from specific coding rules, see Excluding specific files from specific coding rules.

Configuration issues

Invalid source path

The failed because the configured source path is either referencing an absolute path or a path that is outside the project directory.

Your .sonarcloud.properties file contains a configuration issue that has caused the analysis of your project to fail.

To fix this configuration issue do one of the following:

  • Ensure that the user-defined source path is not absolute, for example, sonar.sources=/etc/conf.

  • Ensure that the user-defined source path is not defined to access the outside of the bound, for example, sonar.sources=../../xyz.

Conflicting language patterns

A file extension has been configured for multiple languages, causing a conflict.

To fix this configuration issue, do one of the following:

  • Edit your sonar-project.properties file and update the *.suffixes patterns.

  • At the project level, go to Administration > General Settings, select the Languages tab, and fix the patterns in the languages you previously configured.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on excluding files on file extension, check Excluding based on file extension.

Encoding error

Your .sonarcloud.properties file contains an encoding error or cannot be read correctly.

To resolve this issue, make sure that the encoding of the .sonarcloud.properties file is UTF-8, then commit and push the file again to trigger a new analysis.

Invalid encoding setting

The value provided for sonar.sourceEncoding is invalid.

To resolve this, correct the *.sourceEncoding property in your .sonarcloud.properties file or your Maven or Gradle configurations. Then, commit and push a code change to your repository to trigger a new analysis.

Invalid file exclusion pattern

The pattern to ignore all issues (except the ones from the common repository) on files is not correct.

To resolve this, correct the regular expression used for Ignore Issues on Files at the project level under Administration > General Settings > Analysis Scope.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on excluding blocks within files, see Excluding blocks within files.

Invalid block exclusion pattern

The patterns to ignore all issues (except the ones from the common repository) on specific blocks of code are not correct.

To resolve this, correct the regular expressions used for start/end of block used for Ignore Issues in Blocks at the project level under Administration > General Settings > Analysis Scope.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on excluding blocks within files, see Excluding blocks within files.

Source and test paths overlap

The analysis failed because source and test file paths are overlapping. This often happens if test files are in a directory included in your main source path.

Please verify this configuration using the sonar.sources and sonar.tests parameters, and the source file and tests file inclusions and exclusions.

Then, commit and push a code change to your repository to trigger a new analysis.

Note that sonar.sources and sonar.tests are configured only in the .sonarcloud.properties or build configurations. The inclusions and exclusions can be configured:

  • In the .sonarcloud.properties using sonar.exclusions, sonar.inclusions, sonar.tests.exclusions and sonar.test.inclusions.

  • In the Project settings, under Analysis Scope > Files.

For more information on setting the analysis scope and configuring exclusions and inclusions, check Setting initial scopeand Excluding based on path-matching patterns.

Project is not found

The project was not found due to permission issues. Please verify that:

  • The sonar.projectKey and sonar.organization properties are properly configured in your .sonarcloud.properties file.

  • Your SONAR_TOKEN is available to analysis (by passing it as an environment variable for example) and has the correct permissions:

    • If you use a Scoped Organization Token (SOT): The SOT's scope includes the project with the execute analysis permission.

    • If you use a Personal Access Token (PAT): The token is issued by a user with execute analysis permission on the project.

For example, when using GitHub Actions, make sure that the SONAR_TOKEN environment variable:

  • is properly configured in GitHub under Your organization > Your repository > Settings > Security > Actions > Repository secrets

  • is used in your GitHub Actions workflow run:

env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Source code not found

The analysis failed because no source code files could be found.

To resolve this, ensure that the sonar.sources in the .sonarcloud.properties file or your build configurations are pointing to existing directories.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on setting up the Analysis scope, see Setting initial scope.

Test files not found

The analysis failed because no test files could be found.

To resolve this, ensure that the sonar.tests in the .sonarcloud.properties file or your build configurations point to existing directories.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on setting up the Analysis scope check Setting initial scope.

VPN use

The presence of a VPN client on the machine running the analysis may cause the analysis of your project to fail. If you receive a failure message, disable the VPN on the device and log in to SonarQube Cloud again.

Error when analyzing files with non-ASCII characters in the name

When analyzing files with non-ASCII characters in the name, if the Malformed input or input contains unmappable characters error is raised then you should make sure that the environment variables LC_ALL and LANG are properly set before running the analysis as shown below.

export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"

Missing blame information or Could not find ref error

The errors "Missing blame information…" and "Could not find ref…" can be caused by checking out with a partial or shallow clone, or when using Git submodules. You should disable git shallow clone to make sure the scanner has access to all of your history when running analysis. See Checked-out code for more details.

Wildcards are not supported in sources and tests

The use of wildcards (** or *) is not supported in sonar.sources or sonar.tests properties.

To resolve this, remove all wildcards from the sonar.sources and sonar.tests parameters and from the source file and tests file inclusions and exclusions.

Note that sonar.sources and sonar.tests are configured only in the .sonarcloud.properties file or build configurations. The inclusions and exclusions can be configured:

  • In the .sonarcloud.properties file using the sonar.exclusions, sonar.inclusions, sonar.tests.exclusions and sonar.test.inclusions.

  • In the Project settings, under Analysis Scope > Files.

For more information on setting the analysis scope and configuring exclusions and inclusions check Setting the initial scope and Excluding based on path-matching patterns.

Missing rule key in issue scope

An issue scope is missing a mandatory rule key pattern.

To resolve this, review the Restrict Scope of Coding Rules configuration in the Analysis Scope and ensure each entry includes a rule key pattern.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on restricting specific files from specific coding rules, see Excluding specific files from specific coding rules.

Missing rule key in ignore scope

A rule ignoring scope is missing a mandatory rule key pattern.

To resolve this, review the Ignore Issues on Multiple Criteria configuration at the project level under Administration > General Settings > Analysis Scope, and ensure each entry includes a rule key pattern.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on excluding specific files from specific coding rules, see Excluding specific files from specific coding rules.

Missing start string in issue ignore block

A block exclusion is missing the mandatory Start block regexp pattern.

To resolve this, review the Ignore Issues in Blocks configuration at the project level under Administration > General Settings > Analysis Scope, and ensure the Start of regexp is included for every block exclusion entry.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on excluding blocks within files, see Excluding blocks within files.

Empty regex in issue ignore pattern

An issue ignoring pattern is empty.

To resolve this, review the Ignore Issues on Files configuration at the project level under Administration > General Settings > Analysis Scope and ensure no regex values are empty.

Then, commit and push a code change to your repository to trigger a new analysis.

For more information on Excluding files based on file content see Excluding based on file content.

Various issues

Microsoft Entra ID: Need Admin Approval error

When a user tries to sign up for SonarQube Cloud, the Need Admin Approval error is raised.

Check the users and admin consent setup to Enterprise applications in Microsoft Entra ID. If user consent is not allowed for the application, check that users can request admin consent to apps they are unable to consent to.

Azure DevOps: Build pipeline fails

If your build pipeline fails on the analysis stage, check that you correctly set the integration with the Azure DevOps organization. In particular, check the PAT failure points in the Step 1: Create a PAT on the Azure organization section.

Analysis stops with an error on Windows

If your username on Windows ends with a special character, for example C:\Users\myUser!\the analysis will fail. Either change the username or, if that’s not possible, use the sonar.userHome parameter and set a path that doesn’t include any special characters. See Analysis parameters for more information about sonar.userHome.

Error when accessing Bitbucket API

To avoid exceeding Bitbucket Cloud API rate limits, it is recommended to use a dedicated Bitbucket user for SonarQube Cloud integration.

Debugging the analysis

For debugging purposes, you can use the sonar.scanner.internal.dumpToFile parameter to output to a specific file a full list of properties retrieved by the scanners (CLI, Gradle, Maven, and NPM). The properties include user properties passed through command line arguments, configuration files, environmental variables, and other properties relevant to the specific scanners.

Possible value: path to the output file name.

Deprecated: sonar.scanner.dumpToFile

Note: The equivalent output is available in Your Project > Administration > Background Tasks > 3-dots menu > Show SonarScanner Context. If the analysis report fails, the list is not generated in Show SonarScanner Context.

Could not find an answer?

Please join our Community Forum and ask your questions.

Last updated

Was this helpful?