Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute paths break the scanner. #42

Closed
pms1969 opened this issue Nov 23, 2017 · 9 comments
Closed

Absolute paths break the scanner. #42

pms1969 opened this issue Nov 23, 2017 · 9 comments
Assignees
Labels

Comments

@pms1969
Copy link

pms1969 commented Nov 23, 2017

Description

I have a project that I'm trying to analyse. When I run gometalinter I get the following report.xml file
report.zip

I'm running the scanner inside a custom build docker container based on golang:1.9-alpine. I run gometalinter and the other commands, then run sonar-scanner. This results in the error outlined later.

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Content of your sonar-project.properties

sonar.projectKey=test:master
sonar.projectName=test
sonar.golint.reportPath=report.xml
sonar.coverage.reportPath=coverage.xml
sonar.coverage.dtdVerification=false
sonar.test.reportPath=test.xml
sonar.sources=/go/src/test
sonar.exclusions="vendor"

Log of sonar-scanner related to the plugin

.
.
.
INFO: Sensor GoMetaLinter issues loader sensor [golang]                                                                                                                                                   
INFO: Parsing the file report.xml                                                                                                                                                                         
INFO: Parsing 'GoMetaLinter' Analysis Results                                                                                                                                                             
INFO: Load /key.properties                                                                                                                                                                                
INFO: loaded 49                                                                                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go                                                                                                                           
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go     
.
.
.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 8.691s
INFO: Final Memory: 45M/321M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
        at java.io.File.<init>(File.java:277)
        at org.sonar.api.batch.fs.internal.AbsolutePathPredicate.get(AbsolutePathPredicate.java:52)
        at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFiles(DefaultFileSystem.java:149)
        at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFile(DefaultFileSystem.java:115)
        at fr.univartois.sonargo.gotest.GoTestReportSaver.save(GoTestReportSaver.java:47)
        at fr.univartois.sonargo.gotest.GoTestSensor.execute(GoTestSensor.java:66)
        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

Sonar: Version 6.7 (build 33306)
Go-Plugin: 1.2.11-rc3

thibaultfalque pushed a commit that referenced this issue Nov 24, 2017
thibaultfalque pushed a commit that referenced this issue Nov 24, 2017
@thibaultfalque
Copy link
Collaborator

Hi,
Please test the new release rc5.

@thibaultfalque thibaultfalque self-assigned this Nov 28, 2017
@thibaultfalque
Copy link
Collaborator

@pms1969 can you close the issue if it's ok ?

thibaultfalque pushed a commit that referenced this issue Nov 30, 2017
@thibaultfalque
Copy link
Collaborator

thibaultfalque commented Nov 30, 2017

@pms1969 can you test the rc7 version.

@pms1969
Copy link
Author

pms1969 commented Dec 13, 2017

Sorry, I'm away until the new year. Will test then.

@thibaultfalque
Copy link
Collaborator

Please check release 1.2.11-RC8.

@thibaultfalque
Copy link
Collaborator

@pms1969 could you check with the last release and close the issue if the problem is resolved ?

@thibaultfalque
Copy link
Collaborator

@pms1969 could you check with the last release and close the issue if the problem is resolved ?

@psandhu79
Copy link

Is this fixed i am getting simiar error to this
ERROR: Not able to find a InputFile with .//usr/local/go/src/net/lookup_unix.go the file does exist here
/usr/local/go/src/net/lookup_unix.go
i am not sure if the .// has any significance

@pms1969
Copy link
Author

pms1969 commented Apr 12, 2018

My apologies for the delay. I can confirm that in 1.2.11, the issue no longer exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants