NullPointerException in sonar logs during sonar-runner analysis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

NullPointerException in sonar logs during sonar-runner analysis

Dorfman, Erik (NIH/OD) [C]
We have been using Sonar 5.1 under Java 1.7.0_76 on a Unix system for about a month now on a very large multi-project repository (mostly Java 7, JSP, JS, XML and CSS files).  We have recently noticed that Sonar Runner executions are failing in some cases.  Please see the ERROR from the SonarQube log at the bottom of this message.  Some info:

   * This is happening with different files in different projects - sometimes a .java file, sometimes a .js file -- but it seems to happen consistently with the same file on each run.
   * The file it seems to be asking for does in fact exist in our repository.  
   * All projects are being analyzed by the same user, which has "See Source Code" permission (actually, Anyone has this permission).

Can you tell us what may be causing these failures, and how we can prevent them?  Thanks!

Erik

-----------------
On the server side, in sonar.log:
-----------------

2015.05.26 02:58:56 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://sonar.era.nih.gov/api/sources/hash?key=PRACS%3Asrc%2Fjava%2Fgov%2Fnih%2Fera%2Fpracs%2Fbeans%2FUploadedDocument.java
java.lang.NullPointerException: null
                at com.google.common.io.CharStreams.copy(CharStreams.java:202) ~[guava-10.0.1.jar:na]
                at org.sonar.server.source.ws.HashAction$HashFunction.apply(HashAction.java:99) ~[sonar-server-5.1.jar:na]
                at org.sonar.server.source.ws.HashAction$HashFunction.apply(HashAction.java:84) ~[sonar-server-5.1.jar:na]
                at org.sonar.core.source.db.FileSourceDao.readLineHashesStream(FileSourceDao.java:94) ~[sonar-core-5.1.jar:na]
                at org.sonar.server.source.ws.HashAction.handle(HashAction.java:74) ~[sonar-server-5.1.jar:na]
                at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:84) ~[sonar-server-5.1.jar:na]
                at sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source) ~[na:na]
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_76]
                at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_76]
                at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:425) [jruby-complete-1.7.9.jar:na]
                at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:292) [jruby-complete-1.7.9.jar:na]
                at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:44) [jruby-complete-1.7.9.jar:na]
                at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70) [jruby-complete-1.7.9.jar:na]
                at rubyjit.Api::JavaWsController$$index_18AF0797CD66B4E310384A14E2B9EE369902E67F103261525.__file__(/home/sonarqube/apps/sonarqube/sonarqube-5.1/web/WEB-INF/app/controllers/api/java_ws_controller.rb:30) [jruby-complete-1.7.9.jar:na]
                at rubyjit.Api::JavaWsController$$index_18AF0797CD66B4E310384A14E2B9EE369902E67F103261525.__file__(/home/sonarqube/apps/sonarqube/sonarqube-5.1/web/WEB-INF/app/controllers/api/java_ws_controller.rb) [jruby-complete-1.7.9.jar:na]
                at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:161) [jruby-complete-1.7.9.jar:na]
                at org.jruby.RubyClass.finvoke(RubyClass.java:527) [jruby-complete-1.7.9.jar:na]
                at org.jruby.RubyBasicObject.send(RubyBasicObject.java:2590) [jruby-complete-1.7.9.jar:na]
                at org.jruby.RubyKernel.send(RubyKernel.java:2223) [jruby-complete-1.7.9.jar:na]
                at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen) [jruby-complete-1.7.9.jar:na]
                at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350) [jruby-complete-1.7.9.jar:na]
                at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) [jruby-complete-1.7.9.jar:na]
                at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) [jruby-complete-1.7.9.jar:na]
                at rubyjit.ActionController::Base$$perform_action_DA0FC0A901DD1257EC969DB0C482DD8514B8F04B103261525.__file__(/home/sonarqube/apps/sonarqube/sonarqube-5.1/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1333) [jruby-complete-1.7.9.jar:na]
                at rubyjit.ActionController::Base$$perform_action_DA0FC0A901DD1257EC969DB0C482DD8514B8F04B103261525.__file__(/home/sonarqube/apps/sonarqube/sonarqube-5.1/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/base.rb) [jruby-complete-1.7.9.jar:na]
                at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:141) [jruby-complete-1.7.9.jar:na]
                at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:185) [jruby-complete-1.7.9.jar:na]
                at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:56) [jruby-complete-1.7.9.jar:na]
                at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306) [jruby-complete-1.7.9.jar:na]
                at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136) [jruby-complete-1.7.9.jar:na]
                at .

-----------------
On the client-side, the resulting error has the following lines (I'll send the full thing if you need it, but it seems like the real problem was the NPE):
-----------------

[sonar-runner] INFO: EXECUTION FAILURE
[sonar-runner] INFO: ------------------------------------------------------------------------
[sonar-runner] Total time: 2:50.798s
[sonar-runner] ERROR: Error during Sonar runner execution
[sonar-runner] org.sonar.runner.impl.RunnerException: Unable to execute Sonar
[sonar-runner]     at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
.
[sonar-runner] Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File@1a89552[key=src/java/gov/nih/era/pracs/beans/UploadedDocument.java,path=src/java/gov/nih/era/pracs/beans/UploadedDocument.java,filename=UploadedDocument.java,language=Java]'
[sonar-runner]     at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:104)
.
[sonar-runner] Caused by: java.lang.IllegalStateException: Fail to execute request [code=500, url=http://sonar.era.nih.gov/api/sources/hash?key=PRACS%3Asrc%2Fjava%2Fgov%2Fnih%2Fera%2Fpracs%2Fbeans%2FUploadedDocument.java]
[sonar-runner]     at org.sonar.batch.bootstrap.ServerClient.handleHttpException(ServerClient.java:139)
.
[sonar-runner] Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://sonar.era.nih.gov/api/sources/hash?key=PRACS%3Asrc%2Fjava%2Fgov%2Fnih%2Fera%2Fpracs%2Fbeans%2FUploadedDocument.java]. Response code: 500
[sonar-runner]     at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:305)


Erik Dorfman
Architecture Team / eRA / OD
[hidden email]
301.922.9677 (cell)



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email