How Do You Troubleshoot the SonarQube Problem “Service unavailable” in the Web UI?

Problem scenarios
Your situation is described in one of two ways.

#1  You go to the SonarQube web UI to log in.  You see nowhere to log in.  You see this error: “Service Unavailable    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”  What should you do?

Or your situation is like this:

#2 

How Do You Install SonarQube Scanner on a RHEL Server?

Update on 2/10/22: The Python example is a little dated. Back when Python 2.x was common, the print statements didn’t necessarily have parentheses.

Problem scenario
SonarQube does not work without a launcher installed.  The web UI seems complete, but it is not.  You need a CLI launcher of some sort on the back-end.  You want to use sonar-scanner from the command prompt to analyze some code. 

How Do You Get the Sonar Scanner Tool to Be Reinstalled on a Jenkins Slave?

Problem scenario
You want to uninstall the Sonar Scanner CLI to force its reinstallation as you have a Jenkins job that does the installation automatically.  What do you do to uninstall it and make the Jenkins job do the installation again?

Solution
1.  For the Sonar Scanner job that will run, configure it so it runs on a specific slave.  Log into Jenkins.  Go to the Jenkins job,

How Do You Find the Version of SonarQube That You Have Installed?

Problem scenario
You have installed SonarQube.  You want to know what version you are using.  How do you find out?

Solution
Go to the web UI for SonarQube.  It may be as simple as opening a web browser and entering the external IP address of the server.  Without logging in scroll to the bottom.  You should see something like this near the bottom:  Version 6.7 (build 33306)

How Do You Change the Base URL for SonarQube?

Problem scenario
Currently you have to enter a URL like this to access SonarQube’s web UI:

http://servername.com:9000/sonar

You want to be able to type no path (e.g., no “sonar”) in the web browser.  You want to just enter the hostname in the web browser and the port number of the SonarQube server.  What should you do?

Solution
Go to the conf directory [that is a sibling] with the sonar.properties file. 

How Do You Troubleshoot the SonarQube Problem with Nothing Displaying in the Web Browser?

Problem scenario
You go to the SonarQube web UI to log in.  You see nowhere to log in but no error either.  What could be wrong?

Solution
Have your web browser accept cookies.  If you block cookies and using Apache web server with SonarQube 7.x, you may experience this problem.

What is the Sonar Scanner?

Question
You have read about the Sonar Scanner.  What is it exactly?

Answer
It is now called the SonarQube Scanner — not the Sonar Scanner.  Source: https://docs.sonarqube.org/latest/

“The SonarQube Scanner is recommended as the default launcher to analyze a project with SonarQube.”  This quote was taken from
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner.

How Do You Install SonarQube on a Red Hat Distribution of Linux?

Problem scenario
You have a Red Hat distribution of Linux (e.g., CentOS/RHEL/Fedora).  How do you install SonarQube?

Solution

Prerequisites
Install the Java Development Kit so you can later take advantage of plugins.  If you need assistance with this, see this link.

Procedures
For future reference, at some point the “9.6”s you see below will have to be incremented to a newer version of PostgreSQL.