How Do You Get the sonar.sh Console to Actually Work When the Screen Says That “SonarQube is already running”?

Problem scenario
You stop SonarQube services from running.  You want to log into the web UI console to set things up.  You run this command:

sudo bash /opt/sonarqube/bin/linux-x86-64/sonar.sh console

But all you see is

"
Running SonarQube...
SonarQube is already running.
"

You never get a network service to listen on port 9000.  How do you use "sonar.sh console" to initially configure Sonar?

Solution
Run this command:
sudo bash /opt/sonarqube/bin/linux-x86-64/sonar.sh stop

Make sure you starting the script as a non-root user.  Then run this:

bash /opt/sonarqube/bin/linux-x86-64/sonar.sh console

Make sure that the user who is running the command has the ability to execute files in the /opt/sonarqube/ directory.  You may want to draft a command such as this:

sudo chown -R jdoe:goodgroup /opt/sonarqube

# Replace jdoe with the username that is trying to run the command.  Replace goodgroup with the group associated with the user.  If you do not know what group that is, log in as that user or use "su jdoe" (where jdoe is the username).  Then run the command "groups".

Then run the command you have drafted.

Leave a comment

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