SonarQube is not starting up properly. What should you do?
Possible Solution #1
For the sonar.properties file do not put “#” symbols on lines that are not completely commented out. They can cause you problems.
Possible Solution #2
You may want to click here to see more about re-installing it or troubleshooting the error.
Continue reading “How Do You Troubleshoot SonarQube Not Starting up Properly?”
You run sonar-scanner from the command prompt, but you receive an error. The error looks like one of the following:
“Task ‘-x’ does not exist. Please use ‘list’ task to see all available tasks”
“You must define the folowing mandatory properties for ‘Unknown’: sonar.projectKey, sonar.sources”
What should you do to get sonar-scanner to work?
Run the sonar-scanner command from a local directory where you have sonar-project.properties.
Continue reading “How Do You Troubleshoot the sonar-scanner CLI Not Working?”
You try to start an old SonarQube instance but with a new database connection. In the web.log file you see a message like this: “Can not connect to database. Please check connectivity and settings.” What should you do?
Go to sonar.properties. Find the connection string for the new database. It should look something like this:
The default port for Oracle databases is 1521.
Continue reading “How Do You Get SonarQube to Use a New Database Connection and Change It from the Previous One It Was Working with?”
You run sonar-scanner, but it fails with an error such as this: “No quality profiles have been found, you probably don’t have any language plugin installed.”
You run sonar-scanner with the “-X” and see a Java stack trace like this: “Error during SonarQube Scanner execution java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.report.MetadataPublisher”
You log into the SonarQube web UI. You go to “Quality Profiles” but you see no profiles and no button or option to create one.
Continue reading “How Do You Get sonar-scanner to Work When You Seem to Have No Quality Profiles and Your Server Has No Internet Access?”
You are trying to set up SonarQube for the first time. You run this command:
bash /opt/sonarqube/bin/linux-x86-64/sonar.sh console
You see this error:
“jvm 1 | java.nio.file.AccessDeniedException: /opt/sonarqube/temp/conf/es/elasticsearch.yml”
What do you do?
Make sure that the user who is running the command has the ability to execute files in the /opt/sonarqube/ directory (or wherever the destination is that you are installing Sonarqube).
Continue reading “How Do You Get around The AccessDeniedException Error with SonarQube?”
You want to utilize SonarQube to do some analysis of some code. What do you do?
This assumes you have SonarQube and SonarQube Scanner (aka sonar-scanner) installed. If you need assistance with either of these, see this link to install SonarQube or this link to install sonar-scanner.
- Place the source code file (e.g.,
Continue reading “How Do You Analyze Code with SonarQube?”
You try to run sonarscanner from a command prompt. But you get this message:
“java.lang.IllegalStateException: Failed to create lock in /opt/app/sonar-scanner/conf/…sonar_locak…DirectoryLock…”
What should you do?
Become a different user to run the sonarscanner command or use “sudo ” before your command.
Continue reading “How Do You Troubleshoot the SonarScanner Error “java.lang.IllegalStateException: Failed to create lock in /opt/app/sonar-scanner/conf/…sonar_locak…DirectoryLock…”?”
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
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?
Continue reading “How Do You Get the sonar.sh Console to Actually Work When the Screen Says That “SonarQube is already running”?”
The SonarQube service failed to start.
You see this message:
? sonar.service – SonarQube service
Loaded: loaded (/etc/systemd/system/sonar.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Mon 2018-05-21 14:34:34 UTC; 12min ago
May 21 14:34:33 sonarserver systemd: Started SonarQube service.
May 21 14:34:34 sonarserver systemd: sonar.service holdoff time over, scheduling restart.
May 21 14:34:34 sonarserver systemd: start request repeated too quickly for sonar.service
May 21 14:34:34 sonarserver systemd: Failed to start SonarQube service.
Continue reading “How Do You Troubleshoot the SonarQube Service Not Working with a “vendor preset: disabled” Error?”
You are trying to run SonarScanner, but you get an error about “java.lang.IllegalStateException: Unable to load component class or.sonar.scanner.scan.ProjectLock”. What should you do?
Is there a sonar-project.properties file in the directory where you are running the above command? Does your user have access to read the file? Check these things first.
Continue reading “How Do You Troubleshoot the SonarQube Scanner Error “java.lang.IllegalStateException: Unable to load component class or.sonar.scanner.scan.ProjectLock”?”