Sonar Runner 404 localhost - sonarqube

I'm trying to get Sonar working locally on an OS X box to do some proof of concept work, I've downloaded the following:
Sonar Qube: 4.5.6
Sonar Runner: 2.4
Sonar Qube is configured as:
sonar.web.host=localhost
sonar.web.context=/sonar
sonar.web.port=9000
When I try and use Sonar Runner with one of the example projects I get the following error:
ERROR: Error during Sonar runner execution
ERROR: Fail to request server version
ERROR: Caused by: Status returned by url : 'http://localhost:9000/sonar/api/server/version' is invalid : 404
If I copy and paste the URL from the console into the browser then the page loads (displaying 4.5.6).
What could be causing the script to receive a 404?
The box is behind a proxy but nothing should be trying to get to the outside world
UPDATE:
Changing the configuration from localhost to using the machines IP address produces a timeout rather than a 404, everything still works fine through the browser.

So it turned out my problem was that the JVM wasn't using the proxy settings of my machine, I had to add the following to the Sonar runner script.
SONAR_RUNNER_OPTS="-Dhttp.proxyHost=myproxy -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=my.local.host"

It's possible that HTTP queries from sonar-runner are routed based on system proxy settings, while your browsers may use their own proxy settings.
Go check the system-wide setting:
System Preferences/Network/Advanced/Proxies/Bypass proxy settings for these Hosts & Domains
And make sure that localhost/127.0.0.1 is in there.

Related

SONAR_HOST_URL not reachable in bitbucket pipeline sonarqube

I am trying to integrate the sonarqube to bitbucket pipeline, and have following code there
- pipe: sonarsource/sonarqube-scan:1.0.0
variables:
SONAR_HOST_URL: ${SONAR_HOST_URL}
SONAR_TOKEN: ${SONAR_TOKEN}
- pipe: sonarsource/sonarqube-quality-gate:1.0.0
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
and I am getting error
SonarQube server [$SONAR_HOST_URL] can not be reached
I first tried setting localhost:9000, which is running at my local server, got this error, then I give website url, still getting same error,
what should I give SONAR_HOST_URL
Any help,
Thanks,
SonarQube server [$SONAR_HOST_URL] can not be reached
means SONAR_HOST_URL is not defined in the CI environment. You want to use Repository settings -> Repository variables to add both host url & token (ensure Secured check box is set for token).
P.S. The host url should be publicly accessible. It won't work for localhost:9000 because the Bitbucket CI has not\ way to connect to the instance of the sonarqube server running on your local dev box.

What is the right host url in sonar for bamboo(plugin) configuration?

I have to set host url in sonar for bamboo(bambo plugin) configuration.
While my local docker program is running sonarqube container, it is confused to use localhost:9000 at host url in app configuration.
The error message is saying An error occurred while connecting the given SonarQube server: localhost:9000 failed to respond.
What should I do? Am I doing wrong or Is there anything to set more thing?
enter image description here
As your SonarQube instance is running in a different server, you need to point your "Sonar for Bamboo" plugin to that server, port 9000 (default of SonarQube). So, for example, if your server containing the SonarQube instance has the IP address 192.168.15.1 in your network, you need to configure the plugin to http://192.168.15.1:9000.
I did it in my environment and it works perfectly.

Sonarqube Failed to upload report 413

I am running sonarqube using gradle command ./gradlew sonarqube -Dsonar.host.url=https://sonar-server-url.
I am getting error Failed to upload report - HTTP code 413.
Request Entity Too Large.
I am using sonarserver version : Community Edition Version 7.8.
I am running sonar report using gradle command: ./gradlew sonarqube -Dsonar.host.url=https://sonar-server-url
I am getting error Failed to upload report.
Sonarqube server is on oracle cloud (oci) node and the report file size is 10M.
413 Request Entity Too Large
I got this when I was using the Nginx server for SonarQube.
Explanation
A 413 HTTP error code occurs when the size of a client's request exceeds the server's file size limit. This typically happens when a client attempts to upload a large file to a web server, and the server responds with a 413 error to alert the client.
Solution
For Nginx servers
To allow the request size to be up to 20 megabytes, add the following line to your Nginx configuration file:
...
client_max_body_size 20M;
....
configuration files should be found in /etc/nginx/ directory
Tips
I would recommend updating the dedicated configuration file for SonarQube server placed inside /etc/nginx/sites-enabled/ folder
this property can be placed inside the server {...} , http {...} or, location{...} block of the configuration file

SonarQube stoped on loading page

I had installed the SonarQube 7.9.x LTS on a Linux virtual machine. When I start the Sonar it stop on loading page with spin load forever. Using "F12" on console tab, I got the error message:
GET http://172.29.200.143:9000/js/vendors-main.m.d184ed05.chunk.js net::ERR_ABORTED 404
Please, what should I do?
You should uncomment & modify the sonar.web.context property inside sonar
Config file : /opt/sonarqube/conf/sonar.properties
Example : sonar.web.context=/sonar
I just got this problem where the Page Load would hang forever. The solution here "Open a Firewall Port" https://community.sonarsource.com/t/sonarqube-8-9-doesnt-start-its-blocked-in-loading-page-after-login/43149/21 won't apply to me as I'm running SonarQube locally via localhost:9000
Solution
As soon as I used Chrome it worked, an old IE is probably unsupported now:

Jenkins Deploy Error Tomcat 6.x

Im trying to use jenkins to build and deploy the war file to a tomcat present in different server and im getting the following error -
Deploying /var/lib/jenkins/jobs/ura_Web/workspace/ura-1.0.war to container Tomcat 6.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/jobs/ura_Web/workspace/ura-1.0.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:195)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:905)
at hudson.FilePath.act(FilePath.java:878)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:969)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: java.io.FileNotFoundException: http://192.168.2.X/manager/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1401)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:504)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:622)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:635)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:176)
... 16 more </code>
Can anyone tell me what is wrong?
I had exactly this problem just now and still have not solved it. However, I suspect it is happening because of proxy issues.
Is it possible to try setting the manager URL to http://localhost
rather than http://192.168.2.X? This worked for me, showing that the credentials were at least correct and the module functions. When I switch the manager URL back to a remote machine or the FQDN of the local server, it again failed. This indicates to me something proxy related.
The only trouble then is configuring the proxy settings for Jenkins, especially http.nonProxyHosts. If you can do that maybe you'll have more luck than me. I cannot get the Jenkins System Information proxy values to change no matter what I do!
Also manually test from a browser on both the build server and elsewhere your access to the manager URL: http://192.168.2.X/manager/list

Resources