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

Sonar Scanner is failing saying XML file is not correctly formatted for golang plugin and not displaying results in sonarqube #70

Open
Subhajit-Dutta opened this issue May 17, 2018 · 5 comments

Comments

@Subhajit-Dutta
Copy link

Description

I am getting below error

NFO: Analyse for /home/dca-cm/coverage.xml
[Fatal Error] coverage-04.dtd:1:3: The markup declarations contained or pointed to by the document type declaration must be well-formed.
ERROR: Exception:
org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.

I have verified coverage.xml in https://www.xmlvalidation.com and found no issue

sonar-golang-plugin-1.2.11----------> Golang plugin
sonarqube-6.3.1-----------------------> Sonarqube server

@Subhajit-Dutta
Copy link
Author

Subhajit-Dutta commented May 17, 2018

coverage.docx

Sharing Coverage.xml for reference

@Subhajit-Dutta
Copy link
Author

error-golang.txt
Here is the log of sonar scanner

@thibaultfalque
Copy link
Collaborator

Hi,
It's very strange what is this file coverage.docx ? It is not the coverage report ? There are HTML and Go code.
Could you share the report generate by gocov test ./... | gocov-xml > coverage.xml ?
See this part of readme for more details.

@Subhajit-Dutta
Copy link
Author

Subhajit-Dutta commented Oct 4, 2018

reports.zip
I had shared the coverage.xml and test .xml
Surprising if i delete below lines the above error got vanished


this is my sonar-project.properties file

sonar.projectKey=xxxx
sonar.projectName=xxxx
sonar.projectVersion=1.0

GoLint report path, default value is report.xml

sonar.golint.reportPath=report.xml

Cobertura like coverage report path, default value is coverage.xml

sonar.coverage.reportPath=coverage.xml

if you want disabled the DTD verification for a proxy problem for example, true by default

sonar.coverage.dtdVerification=false

JUnit like test report, default value is test.xml

sonar.test.reportPath=test.xml
sonar.sources=./
sonar.tests=./
sonar.test.inclusions=/_test.go
sonar.sources.inclusions=/.go
sonar.highlighting=false
sonar.showProfiling=true
sonar.log.level=DEBUG
sonar.exclusions=vendor/,proto/,proto_python/,.git/, **/test.go, **/.xml, /*.py, testutils/, **/*.js


I can't see any errors in my log but neither coverage report nor unit test case reports getting displayed

@Subhajit-Dutta Subhajit-Dutta changed the title Sonar Scanner is failing saying XML file is not correctly formatted for golang plugin Sonar Scanner is failing saying XML file is not correctly formatted for golang plugin and not displaying results in sonarqube Oct 4, 2018
@Subhajit-Dutta Subhajit-Dutta reopened this Oct 4, 2018
@thibaultfalque
Copy link
Collaborator

Hello @Subhajit-Dutta,
Could you try disabling the DTD check?

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

No branches or pull requests

2 participants