What Do You Do If SonarQube Has No Logs and the Service Will Not Start?

Problem scenario
You try to start the SonarQube service.  It does not turn on or stay on.  You go to the logs directory in the "sonar" subdirectory on the Linux server.  Every time you run "sudo systemctl start sonar", there are no corresponding log entries.  You may find no logs at all.  What should you do to troubleshoot SonarQube to start when the logs are not helping you?

1.  Have the permissions changed on the files where it is installed?  Has the ownership or group of the files and the subdirectories of the Sonarqube installation changed?

If the user that runs the "sonar" service does not have the ability to write to the logs directory, you will not get proper information in the logs.  Check what Linux user and group owns the "sonar" subdirectory.  Run these two commands (where /path/of/parentdir/ is the path of the directory that houses the "sonar" subdirectory):

cd /path/of/parentdir/

2.  If you do indeed find that the sonar subdirectory is owned by a user and group that is not special or dedicated for running the sonarqube service, run a command such as this:

chown -R sonar:sonargroup /path/of/parentdir/sonar

(If you need to find what the sonargroup is, try this: Log in as the sonar user or become root and run "su sonar".  Then run the groups command to see what user the sonar user has.)

3.  Try running these commands:
sudo systemctl enable sonar
sudo systemctl start sonar

Leave a comment

Your email address will not be published. Required fields are marked *