Unable to import GolangCI-Lint report files(s)

Hi, I am trying to integrating golangci-lint with SonarQube but getting following errors.
I have mentioned sonar.go.golangci-lint.reportPaths=report.xml in sonar.properties file.
What could be the possible reasons for these failure?

SonarQube server Version: 9.9.0.65466
SonarQubeScanner CLI Version: 4.7.0.2747
Java Version: 11.0.13 Oracle Corporation (64 bit)
Linux: 3.10.0

[2023-11-03T12:27:10.414Z] INFO: Sensor Import of GolangCI-Lint issues [go]
[2023-11-03T12:27:10.414Z] WARN: Unable to import GolangCI-Lint report file(s):
[2023-11-03T12:27:10.414Z] - /home/jenkins/agent/workspace/test-22_vishal_try-golangci-lint/test-repo/report.xml
[2023-11-03T12:27:10.414Z] The report file(s) can not be found. Check that the property ‘sonar.go.golangci-lint.reportPaths’ is correctly configured.
[2023-11-03T12:27:10.414Z] INFO: Sensor Import of GolangCI-Lint issues [go] (done) | time=5ms

Hi,

Welcome to the community!

Is report.xml located in the directory analysis is run from?

 
Ann

Hi @ganncamp,

Sorry for late reply.
No, Analysis is run in a different container created by Jenkins pipeline. We use git to stash and unstash report file generated by golangci-lint. I am assuming something is wrong with file path but that also looks good to me.

sonar.go.golangci-lint.reportPaths=report.xml

Hi,

The report path you provide to analysis (in the form of that parameter value) needs to match the paths analysis sees. What you’ve done with

is say that report.xml exists in the directory analysis is kicked off from. If it’s not, that’s what you need to fix.

 
HTH,
Ann

1 Like

Thanks @ganncamp

Issue got resolved. report.xml file was not in correct directory.

1 Like