Skip to content

Question: "java.lang.IllegalArgumentException: expected one element but was..." #43

Closed
@mrbacus

Description

@mrbacus

Description

Hello,

I just installed sonarqube (docker) and have not analyzed any projects.
I am able to pull up sonarqube at localhost in my browser.
I can run gometalinter to generate report.xml.
I am not able to successfully run sonar-scanner (see logs below).
I am hoping somebody might be able to point me at some missing configuration/settings I need to make.

Regards,
James

Steps to Reproduce

Run the following two commands from root of project directory:

  1. gometalinter.v1 --fast --checkstyle ./... > report.xml
  2. sonar-scanner

Content of your sonar-project.properties

sonar.projectKey=NearStoreAvailability
sonar.projectName=Near Store Availability
sonar.projectVersion=1.0
sonar.golint.reportPath=report.xml
sonar.coverage.reportPath=coverage.xml
sonar.coverage.dtdVerification=false
sonar.test.reportPath=test.xml
sonar.sources=./

Log of sonar-scanner related to the plugin

INFO: Scanner configuration file: /Users/x3aw/Downloads/sonar-scanner-3.0.3.778-macosx 3/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/x3aw/source/go/src/git.nordstrom.net/cos/near-store-availability/sonar-project.properties
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Mac OS X 10.11.6 x86_64
INFO: User cache: /Users/x3aw/.sonar/cache
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=85ms
INFO: Server id: AV_0ecowXGmkGPLIqUHI
INFO: User cache: /Users/x3aw/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=50ms
INFO: SonarQube server 6.7.0
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=18ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=30ms
INFO: Load active rules
INFO: Load active rules (done) | time=1508ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=80ms
INFO: Project key: NearStoreAvailability
INFO: ------------- Scan Near Store Availability
INFO: Load server rules
INFO: Load server rules (done) | time=717ms
INFO: Base dir: /Users/x3aw/source/go/src/git.nordstrom.net/cos/near-store-availability
INFO: Working dir: /Users/x3aw/source/go/src/git.nordstrom.net/cos/near-store-availability/.scannerwork
INFO: Source paths: .
INFO: Source encoding: UTF-8, default locale: en_US
WARN: Property 'sonar.php.file.suffixes' is not declared as multi-values/property set but was read using 'getStringArray' method. The SonarQube plugin declaring this property should be updated.
INFO: Index files
INFO: 869 files indexed
INFO: Quality profile for go: Golint Rules
INFO: Quality profile for js: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: 1 source files to be analyzed
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=243ms
INFO: 1/1 source files have been analyzed
INFO: Sensor XML Sensor [xml]
INFO: Sensor XML Sensor [xml] (done) | time=566ms
INFO: Sensor GoMetaLinter issues loader sensor [golang]
INFO: Parsing the file report.xml
INFO: Parsing 'GoMetaLinter' Analysis Results
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 6.596s
INFO: Final Memory: 51M/337M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: expected one element but was: <Dockerfile, README.md, adapter/adapter.go, adapter/adapter_test.go, adapter/adapterfakes/fake_adapter.go, ...>
at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFile(DefaultFileSystem.java:135)
at fr.univartois.sonargo.core.rules.GoLintIssueLoaderSensor.getResourceAndSaveIssue(GoLintIssueLoaderSensor.java:144)
at fr.univartois.sonargo.core.rules.GoLintIssueLoaderSensor.parseAndSaveResults(GoLintIssueLoaderSensor.java:137)
at fr.univartois.sonargo.core.rules.GoLintIssueLoaderSensor.execute(GoLintIssueLoaderSensor.java:120)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
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:288)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
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.executeTask(Batch.java:111)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

Versions

Versions of your sonar installation (server, sonar-scanner), gometalinter, go and OS.
server: 6.7.0.33306
sonar-scanner: 3.0.3.778-macosx 3
gometalinter: v1
go: 1.8.3
OS: Mac OS X 10.11.6 x86_64

Additional Information

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions