ERROR: Error when executing SVN Blame

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server (Version - 9.9.7.96285)/ Community Build, Scanner - 4.7.0.2747, SVN)
  • how is SonarQube deployed: zip
  • what are you trying to achieve: Trying to run sonar scan
  • what have you tried so far to achieve this
    Tried to remove the source code directory and did a fresh checkout to see if it can resolve the issue.
    I tried to run the “svn blame” command manually on that file. No issues found to run that.
    Seems like sonar-scanner command internally runs that svn blame command to get blame information from all the files it scans. No problem found for that file or any other files before. Now also this issue is not there for any other files except this. Every nightly scheduled scans we scan all the projects in which some new code has been checked in. None of them are giving me this issue.
    Not sure what is wrong. Even the DEBUG mode also did not provide more details. No difference in the logs.
    Please advice.
Executing of 
/var/lib/jenkins/sonarScanner/sonar-scanner-4.7.0.2747-linux/bin/sonar-scanner -Dsonar.login=squ_xxxxxxxxxxxxxxxxxxxxxxxxxxxx -Dsonar.projectName=V12/AP -Dsonar.projectKey=V12_AP -Dsonar.projectVersion=12.03.2025 -Dsonar.sources=. -Dsonar.java.binaries=. -Dsonar.projectBaseDir=/var/lib/jenkins/workspace/SonarScannerERP/V12/AP -Dsonar.exclusions=**/*.jsp.......
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Error when executing blame for file PB/apchqprt.pb
	at org.sonar.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:93)
	at org.sonar.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:60)
	at org.sonar.scanner.scm.ScmPublisher.publish(ScmPublisher.java:87)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:373)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	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:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: Connection reset
svn: E175002: REPORT request failed on '/erp/!svn/bc/203082/R12/Development/Trunk/V12/AP/PB/apchqprt.pb'
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:112)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:96)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:816)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:403)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:391)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:914)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:364)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:354)
	at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getFileRevisionsImpl(DAVRepository.java:936)
	at org.tmatesoft.svn.core.io.SVNRepository.getFileRevisions(SVNRepository.java:763)
	at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:109)
	at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:30)
	at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
	at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1239)
	at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
	at org.tmatesoft.svn.core.wc.SVNLogClient.doAnnotate(SVNLogClient.java:295)
	at org.sonar.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:86)
	... 22 more
Caused by: java.net.SocketException: Connection reset
	at java.base/java.net.SocketInputStream.read(Unknown Source)
	at java.base/java.net.SocketInputStream.read(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.readFully(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.decodeInputRecord(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)
	at java.base/java.io.BufferedInputStream.fill(Unknown Source)
	at java.base/java.io.BufferedInputStream.read(Unknown Source)
	at org.tmatesoft.svn.core.internal.util.ChunkedInputStream.getChunkSizeFromInputStream(ChunkedInputStream.java:111)
	at org.tmatesoft.svn.core.internal.util.ChunkedInputStream.nextChunk(ChunkedInputStream.java:97)
	at org.tmatesoft.svn.core.internal.util.ChunkedInputStream.read(ChunkedInputStream.java:69)
	at java.base/sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
	at java.base/sun.nio.cs.StreamDecoder.implRead(Unknown Source)
	at java.base/sun.nio.cs.StreamDecoder.read(Unknown Source)
	at java.base/java.io.InputStreamReader.read(Unknown Source)
	at org.tmatesoft.svn.core.internal.io.dav.http.XMLReader.read(XMLReader.java:39)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:949)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:914)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:220)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:502)
	... 36 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
INFO: Scanner configuration file: /var/lib/jenkins/sonarScanner/sonar-scanner-4.7.0.2747-linux/conf/sonar-scanner.properties

INFO: Project root configuration file: NONE

INFO: SonarScanner 4.7.0.2747

INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)

INFO: Linux 5.4.17-2136.339.5.el8uek.x86_64 amd64

INFO: User cache: /var/lib/jenkins/.sonar/cache

INFO: Scanner configuration file: /var/lib/jenkins/sonarScanner/sonar-scanner-4.7.0.2747-linux/conf/sonar-scanner.properties

INFO: Project root configuration file: NONE

INFO: Analyzing on SonarQube server 9.9.7.96285

INFO: Default locale: "en_US", source code encoding: "UTF-8"

INFO: Load global settings

INFO: Load global settings (done) | time=136ms

INFO: Server id: DE64F22A-AYHZCfRhfwZj5m2ivfhu

INFO: User cache: /var/lib/jenkins/.sonar/cache

INFO: Load/download plugins

INFO: Load plugins index

INFO: Load plugins index (done) | time=43ms

INFO: Load/download plugins (done) | time=126ms

INFO: Process project properties

INFO: Process project properties (done) | time=10ms

INFO: Execute project builders

INFO: Execute project builders (done) | time=1ms

INFO: Project key: V12_AP

INFO: Base dir: /var/lib/jenkins/workspace/SonarScannerERP/V12/AP

INFO: Working dir: /var/lib/jenkins/workspace/SonarScannerERP/V12/AP/.scannerwork

INFO: Load project settings for component key: 'V12_AP'

INFO: Load project settings for component key: 'V12_AP' (done) | time=19ms

INFO: Auto-configuring with CI 'Jenkins'

INFO: Load quality profiles

INFO: Load quality profiles (done) | time=43ms

INFO: Load active rules

INFO: Load active rules (done) | time=1544ms

INFO: Load analysis cache

INFO: Load analysis cache (404) | time=8ms

INFO: Load project repositories

INFO: Load project repositories (done) | time=60ms

INFO: Indexing files...

INFO: Project configuration:

INFO:   Excluded sources: .ali, .bat, .bmp, .cst, .csv, .cxt, .dll, .drop, .exe, .fmb, .gif, .jar, .jnlp, .license, .mmb, .olb, .p12, .par, .pcx, .pll, .pm, .png, .pro, .rdf, .sh, .template, .ttf, .upd, .zip, .cmd, .rtf, .txt, .cab, .res, .cov, .doc, .docx, .dot, .ico, .pal, .dmp, .dat, **/*.g.dart, **/*.gr.dart, **/*.config.dart, **/*.freezed.dart, **/*.jsp

INFO: 521 files indexed

INFO: 0 files ignored because of inclusion/exclusion patterns

INFO: Quality profile for plsqlopen: Custom PLSQL

INFO: ------------- Run sensors on module V12/AP

INFO: Load metrics repository

INFO: Load metrics repository (done) | time=19ms

INFO: Sensor Z PL/SQL Analyzer [plsqlopen]

INFO: 521 source files to be analyzed

INFO: Concurrent mode enabled

INFO: 373/521 files analyzed, current file: VW/ap#ctrl.vw

INFO: Sensor Z PL/SQL Analyzer [plsqlopen] (done) | time=17248ms

INFO: 521/521 source files have been analyzed

INFO: Sensor C# Project Type Information [csharp]

INFO: Sensor C# Project Type Information [csharp] (done) | time=2ms

INFO: Sensor C# Analysis Log [csharp]

INFO: Sensor C# Analysis Log [csharp] (done) | time=15ms

INFO: Sensor C# Properties [csharp]

INFO: Sensor C# Properties [csharp] (done) | time=0ms

INFO: Sensor HTML [web]

INFO: Sensor HTML [web] (done) | time=5ms

INFO: Sensor TextAndSecretsSensor [text]

INFO: 521 source files to be analyzed

INFO: 521/521 source files have been analyzed

INFO: Sensor TextAndSecretsSensor [text] (done) | time=3131ms

INFO: Sensor VB.NET Project Type Information [vbnet]

INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms

INFO: Sensor VB.NET Analysis Log [vbnet]

INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=39ms

INFO: Sensor VB.NET Properties [vbnet]

INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms

INFO: Sensor JaCoCo XML Report Importer [jacoco]

INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml

INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer

INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms

INFO: Sensor CSS Rules [javascript]

INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.

INFO: Sensor CSS Rules [javascript] (done) | time=2ms

INFO: Sensor IaC Docker Sensor [iac]

INFO: 0 source files to be analyzed

INFO: 0/0 source files have been analyzed

INFO: Sensor IaC Docker Sensor [iac] (done) | time=66ms

INFO: ------------- Run sensors on project

INFO: Sensor Analysis Warnings import [csharp]

INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms

INFO: Sensor Zero Coverage Sensor

INFO: Sensor Zero Coverage Sensor (done) | time=411ms

INFO: SCM Publisher SCM provider for this project is: svn

INFO: SCM Publisher 7 source files to be analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: 3/7 source files have been analyzed

INFO: SCM Publisher 3/7 source files have been analyzed (done) | time=436215ms

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

INFO: Total time: 7:43.332s

INFO: Final Memory: 20M/80M

INFO: ------------------------------------------------------------------------

Not sure what is changed. It is giving us this issue from the 2-3 days only. It was working fine before. Nothing is changed from our end.

Any response to understand OR resolve this would be much appreciated.

Thanks
vsk

Hey there.

It seems likely that the SVN server itself is timing out. Have you checked to make sure everything is all right on that end, and have you manually tried to blame this file? (for example, by executing svn blame against /erp/!svn/bc/203082/R12/Development/Trunk/V12/AP/PB/apchqprt.pb)

Your upgrade path is:

9.9.7 → 25.3

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Hi,

Are you saying, this problem would be resolved with an upgrade from 9.9.7 —> 25.3? Is this a known error in 9.9.7?

I haven’t tried the exact command. But i tried manually “svn blame /exact/path/to/the/file/apchqprt.pb” and alo “svn blame /filepath/to/svn/url/onRepo”. No error found.

I have also tried by increasing the timeout using sonar.scm.timeout argument. But, when there is no timeout OR blame error in running command manually, how come it is throwing error when that command is executed internally as part of sonar-scanner execution?

Based on the output I shared, did you find anything/root cause for the problem?

Thanks
vsk

sonar.scm.timeout is not a valid analysis parameter – so I’m not surprised it’s having no effect!

I think you should try that exact file since you’re receiving a timeout on it.

No known errors – but if we’re going to spend time troubleshooting SonarQube, you should be using a supported version!

I ran the svn blame command on the exact same file

svn blame which is checked out
svn blame /var/lib/jenkins/workspace/SonarScannerERP/V12/AP/PB/apchqprt.pb

and also tried using the actual svn repo url
svn blame https://xxxxxx.ca/erp/R12/Development/Trunk/V12/AP/PB/apchqprt.pb

No problems found during manual execution of svn blame.

Could you please share the exact command which is being executed as part of svn blame?
Upgrading to a new version won’t be immediately happening right. We would have to plan it properly as it is a production instance.

Also could you please provide the exact svn timeout argument to increase the time.

Thanks
vsk

Digging into it a bit more, SonarQube is using svnkit to blame the files, rather than using svn directly.

FWIW, SonarQube updates regularly include updates to dependencies such as svnkit which can improve stability / performance.

There is no parameter to adjust the timeout.

What I would suggest right now is to see if you can isolate the problem to a single file that SonarQube is trying to blame. For example, if you set sonar.exclusions=**/*apchqprt.pb to exclude that file from analysis, is the analysis successful, or does it fail on another file?

If it’s all too much trouble, and you don’t use any features from the SCM integration (like automatic issue assignment) you can also configure sonar.scm.disabled=true which will turn off the blaming.

I would still encourage you to check your SVN server and any associated logs to understand why the timeout occurs.

It appears there is limited documentation on how to pass SVN credentials specifically to svnkit, which is internally invoked by the sonar-scanner command during SCM blame analysis.

Could you please advise where the configuration for svnkit is controlled or how it receives authentication details during the scan? Specifically, we are curious if credentials provided via **sonar.scm.username** and **sonar.scm.password** are indeed used directly by svnkit or if there is another method recommended.

Additionally, from our observations and based on HTTPD logs on our SVN server, it appears that svnkit is triggering a REPORT request directly to the SVN server to fetch blame information, instead of utilizing the locally checked-out working copy on the Jenkins node where sonar-scanner is being executed.

Could you confirm if this is indeed how the workflow operates?

Context of the problem:

We are encountering errors like the below during the SonarScanner run:

svn: E175002: REPORT request failed on '<svn-url>'
svn: E175002: Processing REPORT request response failed: XML document structures must start and end within the same entity.

We found some community threads like this one on Jenkins JIRA (JENKINS-1260) where a suggested fix is enabling spooling mode via the JVM argument:

-Dhudson.spool-svn=true

Since svnkit is the common factor here, I am trying to explore whether spooling mode can also resolve the malformed XML issues during SonarScanner blame steps.

Questions:

  1. If we apply -Dsvnkit.spool=true to the Jenkins environment, will that also apply to svnkit calls made internally by sonar-scanner, or does SonarScanner run in a separate JVM context?
  2. If it is a separate context, how can we correctly pass this JVM option (-Dsvnkit.spool=true) directly to sonar-scanner so that it applies to its embedded svnkit?

We would greatly appreciate your guidance on both understanding the flow and on the recommended approach to applying this fix correctly.

Thank you,
vsk