Error during SonarScanner execution Failed to index files NoSuchFileException

I’m getting below errors in jenkins console. could anyone help me on this?
Exception
Caused by: java.nio.file.NoSuchFileException: D:\Git\ProcessAppServer\cafet_rsiWebProcess423_bridge\simWebProcess_git\cd …
Not sure why it is looking for cd…

Stack trace

15:09:36.497 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Failed to index files
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.indexFiles(ProjectFileIndexer.java:204)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.index(ProjectFileIndexer.java:159)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.indexModulesRecursively(ProjectFileIndexer.java:138)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.index(ProjectFileIndexer.java:105)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:353)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	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: java.nio.file.NoSuchFileException: D:\Git\ProcessAppServer\cafet_rsiWebProcess423_bridge\simWebProcess_git\cd ..
	at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.isHidden(Unknown Source)
	at java.base/java.nio.file.Files.isHidden(Unknown Source)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer$IndexFileVisitor.visitFile(ProjectFileIndexer.java:242)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer$IndexFileVisitor.visitFile(ProjectFileIndexer.java:215)
	at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.indexDirectory(ProjectFileIndexer.java:211)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.indexFiles(ProjectFileIndexer.java:197)
	... 23 more

PFB content of sonar-scanner.properties
sonar.host.url=http://PUNVMWINSIM14:9000
sonar.sourceEncoding=UTF-8

Hi,

Welcome to the community!

Does the file actually exist? And if so, is there one or more symlinks in the path the analyzer cited?

 
Ann

Thank you Ann.

No path does not exists.
“D:\Git\ProcessAppServer\cafet_rsiWebProcess423_bridge\simWebProcess_git\cd …”
“cd…” is explicitly added by tool while indexing files.

I was trying to invoke sonar-scanner.bat from jenkins and ended up with this issue.
Now I am trying to use sonarqube plugin for jenkins.

Hi,

Okay! I formatted your post for you (badly, as it turns out) and then missed your commentary on that & thought that the odd cd .. was some strange redaction on your part.

I’ve referred this internally to the experts. In the meantime, can you provide some context information. From the path I assume you’re on windows. Which scanner are you using? And what properties are you passing into analysis, either on the command line or via a properties file?

 
Ann

Hi Ann,

Sorry for late reply.
I am using * Community Edition* Version 8.6.1 (build 40680) on windows os.
command is sonar-scanner -D"sonar.projectKey=SimProcessApps" -D"sonar.sources=."
For now, I have integrated sonarqube with GitLab pipeline and it worked fine.
So we can close this issue.

1 Like