Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failure running sonar-runner locally

I have an instance of sonar running on my local machine at localhost:9000, and I'm able to go to and use the console. When I try to run sonar-runner from the command line for a project, I get a 500 error:

Exception in thread "main" org.sonar.runner.RunnerException: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.bootstrap.DatabaseCompatibility.start()', instance 'org.sonar.batch.bootstrap.DatabaseCompatibility@3848110b, org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
    at org.sonar.runner.Runner.delegateExecution(Runner.java:288)
    at org.sonar.runner.Runner.execute(Runner.java:151)
    at org.sonar.runner.Main.execute(Main.java:84)
    at org.sonar.runner.Main.main(Main.java:56)
Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.bootstrap.DatabaseCompatibility.start()', instance 'org.sonar.batch.bootstrap.DatabaseCompatibility@3848110b, org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
    at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
...
...

But when i visit the url in my browser, I get the following xml response:

<server>
<id>20131007131041</id>
<version>3.4.1</version>
<status>UP</status>
</server>

I'm not sure where to go from here. Any advice?

like image 650
jtyler Avatar asked Oct 07 '13 18:10

jtyler


2 Answers

The current workaround is to unset GEM_PATH and GEM_HOME variables before launching the sonar webservice:

unset GEM_PATH GEM_HOME
./sonar.sh console

This doesn't have to be done for the sonar-runner environment.

The problem is caused due to conflict with Ruby local installation.

like image 135
user1401230 Avatar answered Sep 23 '22 08:09

user1401230


As per the sonar-runner documentation you need to create a sonar-project.properties in your project root and then run sonar-runner from command line

ref Sonar runner docs

In my case it worked with following workaround

1: export GEM_HOME=''

2: export GEM_PATH=''

3: restart sonar webserver

4: run sonar-runner in project path

like image 35
Nirbhay Kundan Avatar answered Sep 22 '22 08:09

Nirbhay Kundan