Error - SonarQube Scanner execution: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?

SonarQube 6.7.6
Jenkins 2.121.3
SonarQube Scanner 2.8
sonar-maven-plugin 3.4.0.905
#bug:fault

We have a daily scheduled Jenkins Freestyle job to build a maven 3 application consisting of 20 modules. It can also be run manually.
The job takes ~ 1.75 - 2 hrs to build, then the scan occurs. The logs are 1.3M lines, so not posting it here.
There is essentially no difference bewteen a successful scan and the following failure below, which occurs regular, especially when triggered manually.
Scanner step failure can occur in as little as 3 minutes.
There are no relevant entries in the sonar server logs. There are ~ 50 successful scans per day. This has been failing consistntly for a week.

Other responses to “Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succedeed?” have not been applicable.
Where do we go from here ?

Thanks.

$ /build/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQubeRunner/bin/sonar-scanner
	-Dsonar.host.url=http://sonarqube:9000
	-Dproject.settings=/build/workspace/<job>/<path>/<module>/sonar-project.properties
	-Dsonar.projectBaseDir=/build/workspace/<job>
INFO: Scanner configuration file: /build/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQubeRunner/conf/sonar-scanner.properties
INFO: Project root configuration file: /build/workspace/<job>/<path>/<module>/sonar-project.properties
INFO: SonarQube Scanner 2.8
INFO: Java 1.8.0_221 Oracle Corporation (64-bit)
INFO: Linux 2.6.32-754.17.1.el6.x86_64 amd64
INFO: SONAR_SCANNER_OPTS=-noverify
INFO: User cache: /builds/sonar/cache
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings 
INFO: Server id: A71B7D59-17ff5f025aa1c5d
INFO: User cache: /builds/sonar/cache
INFO: Load plugins index
INFO: Load plugins index 
INFO: SonarQube server 6.7.6
INFO: Default locale: "en_CA", source code encoding: "ISO-8859-3"
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories 
INFO: Load quality profiles
INFO: Load quality profiles 
INFO: Load active rules
INFO: Load active rules 
INFO: Load metrics repository
INFO: Load metrics repository 
INFO: Project key: <project.key>

INFO: SCM Publisher is disabled
INFO: 437 files had no CPD blocks
INFO: Calculating CPD for 1698 files
INFO: CPD calculation finished
INFO: Analysis report generated in 3455ms, dir size=47 MB
INFO: Analysis reports compressed in 5134ms, zip size=15 MB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 5:23.616s
INFO: Final Memory: 98M/3047M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Fail to request http://sonarqube:9000/api/ce/submit?projectKey=<project.key>&projectName=<project.name>
	at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:190)
	at org.sonarqube.ws.client.HttpConnector.post(HttpConnector.java:155)
	at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:114)
	at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:73)
	at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:189)
	at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:135)
	at org.sonar.scanner.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:73)
	at org.sonar.scanner.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:55)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:93)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:177)
	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:291)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:286)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:264)
	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:62)
	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:110)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.net.SocketTimeoutException: timeout
	at okio.Okio$4.newTimeoutException(Okio.java:227)
	at okio.AsyncTimeout.exit(AsyncTimeout.java:284)
	at okio.AsyncTimeout$1.write(AsyncTimeout.java:183)
	at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
	at okio.RealBufferedSink.write(RealBufferedSink.java:41)
	at okhttp3.internal.http1.Http1Codec$FixedLengthSink.write(Http1Codec.java:286)
	at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
	at okio.RealBufferedSink.writeAll(RealBufferedSink.java:99)
	at okhttp3.RequestBody$3.writeTo(RequestBody.java:118)
	at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.java:171)
	at okhttp3.MultipartBody.writeTo(MultipartBody.java:113)
	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:62)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:207)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
	at okhttp3.RealCall.execute(RealCall.java:69)
	at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:188)
	... 35 more
Caused by: java.net.SocketException: Socket closed
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
	at okio.Okio$1.write(Okio.java:78)
	at okio.AsyncTimeout$1.write(AsyncTimeout.java:179)
	... 62 more
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
ERROR: SonarQube scanner exited with non-zero code: 1
`

Hi,

The warnings about being unable to locate ‘report-task.txt’ aren’t the main problem. The main problem is this:

You’re getting a timeout when the analysis report is being uploaded to the server. Typically this means you’re going through some sort of proxy or firewall that’s messing with the call. Can you check with your network folks?

 
Ann

Hi Iaw/Anyone who knows this.

How you are tracking successful scans per day. Is there any way to trcak the number of scans. be it successful or failed.

Hi @samyak,

In addition to resurrecting this old thread, you’ve also created a new one with the same question. I’ll respond there and consider this one closed.

 
Ann

Started by user Shekhar
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 41: Expected a step @ line 41, column 21.
                       scannerHome = tool name: 'SonarScanner'
                       ^

WorkflowScript: 40: Missing required parameter: "name" @ line 40, column 17.
                   environment {
                   ^

WorkflowScript: 40: Missing required parameter: "value" @ line 40, column 17.
                   environment {
                   ^

3 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1107)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox$Scope.parse(GroovySandbox.java:163)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:563)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:515)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:336)
	at hudson.model.ResourceController.execute(ResourceController.java:107)
	at hudson.model.Executor.run(Executor.java:449)
[withMaven] downstreamPipelineTr

	at hudson.model.Executor.run(Executor.java:449)
[withMaven] downstreamPipelineTriggerRunListener - Failure to introspect build steps: java.io.IOException: FEETA #31 did not yet start
[withMaven] downstreamPipelineTriggerRunListener - Failure to introspect build steps: java.io.IOException: FEETA #31 did not yet start
Finished: FAILURE

this is my jenkis file :-

 stage('SonarQube Analysis') {
           steps{
             withSonarQubeEnv('SonarScanner') {
                environment {
                    scannerHome = tool name: 'SonarScanner'
                }
                sh "${scannerHome}/bin/sonar-scanner \
                    -Dsonar.projectKey=sonarqubetest \
                    -Dsonar.projectName='My project' \
                    -Dsonar.projectVersion=1.0 \
                    -Dsonar.sources=src \
                    -Dsonar.sourceEncoding=UTF-8"
            }
        }
    }
}
type or paste code here

Hi @Shekhar_Chaugule,

Welcome to the community!

You’ve resurrected a nearly 4-year-old thread with a unrelated syntax error in your Jenkins pipeline. Please don’t do that.

For help with the syntax of your Jenkins pipeline, you should turn to Jenkins-specific resources.

 
Ann