Analysis failure

My build is failing with WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeed?

[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (SonarQube analysis)
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: Sonarqube_ACG_Prod
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] tool
[Pipeline] }
[Pipeline] // script
[Pipeline] sh
+ /apps/jws/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonarqube_ACG_Prod/bin/sonar-scanner -e -Dsonar.projectKey=DIM_120 -Dsonar.projectName=DIM_MPP -Dsonar.sources=src/main/java/ -Dsonar.language=java -Dsonar.src=./src -Dsonar.java.binaries=.
INFO: Option -e/--errors is no longer supported and will be ignored
INFO: Scanner configuration file: /apps/jws/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonarqube_ACG_Prod/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 1.8.0_322 Red Hat, Inc. (64-bit)
INFO: Linux 3.10.0-1160.53.1.el7.x86_64 amd64
INFO: User cache: /home/ad/sajenkins/.sonar/cache
INFO: Scanner configuration file: /apps/jws/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonarqube_ACG_Prod/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 7.9.6
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
WARN: SonarScanner will require Java 11 to run starting in SonarQube 8.x
INFO: Load global settings
INFO: Load global settings (done) | time=229ms
INFO: Server id: 53DD8A4F-AXrO6XfPAnLy0K6mi-i5
INFO: User cache: /home/ad/sajenkins/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=140ms
INFO: Load/download plugins (done) | time=166ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: DIM_120
INFO: Base dir: /apps/jws/workspace/IEMicroservices/MPP-Service/MPP-Service-DEV
INFO: Working dir: /apps/jws/workspace/IEMicroservices/MPP-Service/MPP-Service-DEV/.scannerwork
INFO: Load project settings for component key: 'DIM_120'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=340ms
INFO: Detected Jenkins
INFO: Load active rules
INFO: Load active rules (done) | time=2843ms
INFO: Indexing files...
INFO: Project configuration:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 9.973s
INFO: Final Memory: 10M/145M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: I/O error while indexing ignored files.
	at org.sonarsource.scm.git.GitIgnoreCommand.init(GitIgnoreCommand.java:39)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.index(ProjectFileIndexer.java:104)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:353)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	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: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: java.io.FileNotFoundException: /apps/jws/workspace/IEMicroservices/MPP-Service/MPP-Service-DEV/.gitignore (Is a directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at org.eclipse.jgit.treewalk.FileTreeIterator$FileEntry.openInputStream(FileTreeIterator.java:395)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator$PerDirectoryIgnoreNode.load(WorkingTreeIterator.java:1283)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator$RootIgnoreNode.load(WorkingTreeIterator.java:1303)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.getIgnoreNode(WorkingTreeIterator.java:751)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.isDirectoryIgnored(WorkingTreeIterator.java:1552)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.isDirectoryIgnored(WorkingTreeIterator.java:1530)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.isEntryIgnored(WorkingTreeIterator.java:733)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.isEntryIgnored(WorkingTreeIterator.java:693)
	at org.eclipse.jgit.treewalk.WorkingTreeIterator.isEntryIgnored(WorkingTreeIterator.java:680)
	at org.eclipse.jgit.treewalk.FileTreeIterator.createSubtreeIterator(FileTreeIterator.java:182)
	at org.eclipse.jgit.treewalk.AbstractTreeIterator.createSubtreeIterator(AbstractTreeIterator.java:559)
	at org.eclipse.jgit.treewalk.TreeWalk.enterSubtree(TreeWalk.java:1270)
	at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:826)
	at org.sonarsource.scm.git.IncludedFilesRepository.indexFiles(IncludedFilesRepository.java:59)
	at org.sonarsource.scm.git.IncludedFilesRepository.<init>(IncludedFilesRepository.java:40)
	at org.sonarsource.scm.git.GitIgnoreCommand.init(GitIgnoreCommand.java:37)
	... 21 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE

Hi,

Welcome to the community!

I’ve edited your post to code-format the logs and move the problem statement from the title into the body. Ideally the title is a synopsis, not a detailed problem statement.

You reported the second error in your logs, but the first one is actually what caused the job to fail:

It sounds like there’s something strange going on with your SCM configuration. You might start by cleaning out the workspace and doing a fresh checkout.

 
HTH,
Ann