Search code examples
sonarqubesonar-runner

Sonar Runner 404 localhost


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.


Solution

  • 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"