sonar-golang icon indicating copy to clipboard operation
sonar-golang copied to clipboard

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

Open Subhajit-Dutta opened this issue 7 years ago • 5 comments

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 avatar May 17 '18 05:05 Subhajit-Dutta

coverage.docx

Sharing Coverage.xml for reference

Subhajit-Dutta avatar May 17 '18 05:05 Subhajit-Dutta

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

Subhajit-Dutta avatar May 17 '18 05:05 Subhajit-Dutta

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.

thibaultfalque avatar May 21 '18 09:05 thibaultfalque

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 avatar Oct 04 '18 12:10 Subhajit-Dutta

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

thibaultfalque avatar Apr 01 '19 09:04 thibaultfalque