Troubleshooting

Errors found on <sonar_root>/logs/sonar.log

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

If you are using systemd to start SonarQube, you must specify those limits inside your unit file in the section [service] :

/lib/systemd/system/sonar.service
[Service]
...
LimitNOFILE=65536
LimitNPROC=4096
...

And then reload services definitions and restart sonar service.

$ sudo systemctl daemon-reload
$ sudo service sonar restart

Otherwise, following files must be edited and limits must be assigned to 65536 (even though the message indicates 65535):

/etc/systemd/system.conf
...
DefaultLimitNOFILE=65536
...
/etc/systemd/user.conf
...
DefaultLimitNOFILE=65536
...
/etc/security/limits.conf
...
sonar                  - nofile  65536
sonar                  - nproc   4096
...

And reboot after changes are done!

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Following files must be edited and set new max_map_count:

/etc/sysctl.conf
...
vm.max_map_count=262144
...

You can reload configuration with:

$ sudo sysctl -p

Errors found on <sonar_root>/logs/web.log

Execution of migration step #2506 'Migrate quality gate conditions using warning, period and no more supported operations' failed

This error can happen on updating to a new SonarQube version. First of all, go back to your previous version, restoring your database, and then do the following checks:

  1. Check if you have some error in your Quality Gates; if so, solve them before continue.
  2. Check if you have some error in your Quality Profiles; if so, solve them before continue.
  3. Check if there is a LTS version between your current version and the target version; if so, you have to upgrade first to the LTS. If there are more than one, you will have to upgrade to each LTS from lower to greater.
  4. After each upgrade, check again steps 1 and 2.

After thoses steps, you should be able to upgrade to your target version with no problem.

Errors found on "Quality profiles" section

Outdated copy

After an update you can find the following message for some profiles:

If you want to remove the outdated copy:

1. Open the engine on the right of the non-outdated copy, an select "Set as Default".

2. Open the engine on the right of the outdated copy, an select "Delete".

Console output messages

Language of file 'MyFile.INC' can not be decided as the file matches patterns of both sonar.lang.patterns.objectscript : **/*.cls,**/*.mac,**/*.int,**/*.inc,**/*.ro and sonar.lang.patterns.php : **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc

This ig given that extension can be recognized by different languages. To avoid that situation, you have to sacrify the scan in some language. In that case, disable the PHP analyzer plugin:

$ mv /opt/sonarqube/sonar/extensions/plugins/sonar-php-plugin-3.2.0.4868.jar /opt/sonarqube/sonar/extensions/plugins/sonar-php-plugin-3.2.0.4868.jar.DISABLED
$ service sonar restart

Remember to change versioned file to match your installation.