Sonar Scanner failed to load the components (local IO error)

scanner

(Shiv) #1

Hi,
I’m simply trying to scan the java codes under …/alert/src/
sonarQube server is up and java plugin I’m using is sonar-java-plugin-4.15.0.12310 with sonarqube-6.7.5 and sonar-scanner-3.2.0.1227

My folder structure is like:

V:/ClearCaseView/shiv/alert
    		|  src (have java/jar files)
    		|  sonar-project.properties
    		|
    		|

---------------- sonar-project.properties (NOT Working)------------------

sonar.host.url=http://localhost:9000/

sonar.projectKey=V:Alert
sonar.projectName=V:Alert
sonar.projectVersion=1.0

#Java
sonar.sources=src
#Classes
sonar.java.binaries=src
#Jar
sonar.java.libraries=src

sonar.language=java
sonar.projectBaseDir=V:/ClearCaseView/shiv/alert

sonar.sourceEncoding=UTF-8

above window drive V is mapped to clearcase path.
I’m starting the sonar-scanner from path V:/ClearCaseView/shiv/alert
I see .scannerwork is created fine under V:/ClearCaseView/shiv/alert so no permission issue on the project folders.
But it’s not able to load the components and throwing below errors :

14:46:47.726 INFO: ------------------------------------------------------------------------
14:46:47.726 INFO: EXECUTION FAILURE
14:46:47.726 INFO: ------------------------------------------------------------------------
14:46:47.726 INFO: Total time: 5.286s
14:46:47.773 INFO: Final Memory: 8M/102M
14:46:47.773 INFO: ------------------------------------------------------------------------
14:46:47.773 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.sensor.DefaultSensorStorage
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
        at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:265)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:175)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:291)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:286)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:264)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
        at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
        at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.issue.ModuleIssues
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
        at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
        ... 29 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.issue.IssueFilters
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
        at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
        ... 43 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.issue.ignore.EnforceIssuesFilter
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
        at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)
        at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)
        at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)
        at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)
        at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
        ... 57 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.issue.ignore.pattern.IssueInclusionPatternInitializer
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
        at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
        ... 73 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ModuleSettings
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
        at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
        ... 87 more
Caused by: java.lang.IllegalStateException: Unable to write analysis log
        at org.sonar.scanner.report.AnalysisContextReportPublisher.dumpModuleSettings(AnalysisContextReportPublisher.java:144)
        at org.sonar.scanner.scan.ModuleSettingsProvider.provide(ModuleSettingsProvider.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
        at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
        at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
        at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
        at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
        at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
        ... 101 more
Caused by: java.io.IOException: The parameter is incorrect
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.FileDispatcherImpl.write(Unknown Source)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
        at sun.nio.ch.IOUtil.write(Unknown Source)
        at sun.nio.ch.FileChannelImpl.write(Unknown Source)
        at java.nio.channels.Channels.writeFullyImpl(Unknown Source)
        at java.nio.channels.Channels.writeFully(Unknown Source)
        at java.nio.channels.Channels.access$000(Unknown Source)
        at java.nio.channels.Channels$1.write(Unknown Source)
        at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
        at sun.nio.cs.StreamEncoder.implClose(Unknown Source)
        at sun.nio.cs.StreamEncoder.close(Unknown Source)
        at java.io.OutputStreamWriter.close(Unknown Source)
        at java.io.BufferedWriter.close(Unknown Source)
        at org.sonar.scanner.report.AnalysisContextReportPublisher.dumpModuleSettings(AnalysisContextReportPublisher.java:143)
        ... 117 more

But when I copy the source base folder ‘alert’ to my local Drive D It’s working fine with below project property file.

D:/Shiv/alert
    |  src (have java/jar files)
    |  sonar-project.properties
    |
    |

---------------- Below is working fine------------------
sonar.host.url=http://localhost:9000/

sonar.projectKey=D:Alert
sonar.projectName=D:Alert
sonar.projectVersion=1.0

#Java
sonar.sources=src
#Classes
sonar.java.binaries=src
#Jar
sonar.java.libraries=src

sonar.language=java
sonar.projectBaseDir=D:/Shiv/alert

sonar.sourceEncoding=UTF-8

Reading the logs above , I’m really not sure what’s failing when it’s trying to read/load the components from drive V. But it’s just fine when I copy the source folder to drive D. Any clue to check further would be great help.

Many Thanks.

Shiv Dewangan


SonarQube 6.7.5 startup failure: Failed to connect to the Wrapper at port 0
(G Ann Campbell) #2

Hi Shiv,

Despite your assertion

I think it may actually be a permissions error. Here’s the next-to-last Caused by:

This is reinforced by the fact that analysis runs fine in another location.

BTW, I should mention a few other things:

  • There’s no need to set sonar.projectBaseDir. It defaults to the directory from which you launch analysis
  • It’s rather odd to me that you have your source files, class files, and library jars all under src. I suspect that you should actually cd src before you start analysis, and differentiate the relevant settings
  • SonarJava 4.15 has some age on it at this point. The current version is 5.6.1. You’d be well served by an upgrade.

Ann

P.S. I’ve formatted your original post for you. It’s far easier to read a stacktrace when it has been code-formatted, and thus far easier to help you.


(Shiv) #3

Hi Ann,

Thanks for reformatting my previous post. I’ll make sure proper formatting going forwards.

I had noticed this but then I see analysis.log is half written already (till it’s list out the “Global Properties:”)

but It’s failed to write the analysis file for “Settings for module:” section which I guess it read from project properties file.

Global properties:
  - sonar.core.id=BF41A1F2-AWVXHBmFaF4m_PTN-itZ
  - sonar.core.startTime=2018-08-23T10:54:36+0100
  --END OF FILE

I see below info written in analysis file when I run it from other drive.

Global properties:
      - sonar.core.id=BF41A1F2-AWVXHBmFaF4m_PTN-itZ
      - sonar.core.startTime=2018-08-22T12:33:59+0100    
Settings for module: N:Alert
      - sonar.host.url=http://localhost:9000
      - sonar.java.binaries=src
      - sonar.java.libraries=src
      - sonar.language=java
      - sonar.projectBaseDir=N:\Shiv\alert
      - sonar.projectKey=N:Alert
      - sonar.projectName=N:Alert
      - sonar.projectVersion=1.0
      - sonar.scanner.app=ScannerCli
      - sonar.scanner.appVersion=3.2.0.1227
      - sonar.sourceEncoding=UTF-8
      - sonar.sources=src
      - sonar.verbose=true
      - sonar.working.directory=N:\Shiv\alert\.scannerwork

I thought sonar-project.properties file permission issue but this file have given all permission to all users. So still not sure what could be other issues that scanner failed to write the module setting information to analysis file.

Thanks, I’ll upgrade to SonarJava 5.6.1 version.


(G Ann Campbell) #4

Hi,

Do you have a virus scanner running on the V drive/machine? Because it’s difficult to get past this Caused by line:

Especially when you factor in what comes after:

Okay, I don’t know what “The parameter is incorrect” means in this context, but the io and nio packages deal with Input/Output.

You’ve said that the analysis log starts fine, but then analysis errors out. Perhaps some other process is locking the file?

Ann


(Shiv) #5

Thanks for your Time Ann.

It doesn’t look like any virus scanner running or any other process locking it. For now I’ll copy it to my local or other drive and work. I’ll update later here If I could find out what causing this issue. Mostly seems to be network drive/machine related issues and nothing to do with Sonar.

Thanks again.