Hello together,
we have a sonar-scan-job in our gitlab pipeline which sometimes crashes. I would say every twentieth job crashes with the java.nio.file.NoSuchFileException. When i retry the job 3-4 times it will somehow work.
Command: sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.login=$SONAR_LOGIN
Versions
- SonarScanner 4.6.2.2472
- Java 11.0.11 Alpine (64-bit)
- Linux 4.14.231-173.361.amzn2.x86_64 amd64
The error:
08:51:36.868 DEBUG: Adding rules for repository 'jssecurity', language: JAVASCRIPT, [class com.sonar.security.frontend.js.rules.DomOpenRedirectCheck, class com.sonar.security.frontend.js.rules.DomXssCheck, class com.sonar.security.frontend.js.rules.DynamicCodeExecutionCheck, class com.sonar.security.frontend.js.rules.FilePathInjectionCheck, class com.sonar.security.frontend.js.rules.HttpRedirectionCheck, class com.sonar.security.frontend.js.rules.NoSQLInjectionCheck, class com.sonar.security.frontend.js.rules.OSArgumentConstructionCheck, class com.sonar.security.frontend.js.rules.OSArgumentInjectionCheck, class com.sonar.security.frontend.js.rules.OSCommandInjectionCheck, class com.sonar.security.frontend.js.rules.ReflectedXssCheck, class com.sonar.security.frontend.js.rules.RegularExpressionDoSCheck, class com.sonar.security.frontend.js.rules.ServerSideRequestCheck, class com.sonar.security.frontend.js.rules.SQLInjectionCheck, class com.sonar.security.frontend.js.rules.ZipSlipCheck, class com.sonar.security.frontend.js.rules.SessionFixationCheck] from com.sonar.security.frontend.js.D
08:51:36.878 DEBUG: Adding rules for repository 'tssecurity', language: TYPESCRIPT, [class com.sonar.security.frontend.js.rules.DomOpenRedirectCheck, class com.sonar.security.frontend.js.rules.DomXssCheck, class com.sonar.security.frontend.js.rules.DynamicCodeExecutionCheck, class com.sonar.security.frontend.js.rules.FilePathInjectionCheck, class com.sonar.security.frontend.js.rules.HttpRedirectionCheck, class com.sonar.security.frontend.js.rules.NoSQLInjectionCheck, class com.sonar.security.frontend.js.rules.OSArgumentConstructionCheck, class com.sonar.security.frontend.js.rules.OSArgumentInjectionCheck, class com.sonar.security.frontend.js.rules.OSCommandInjectionCheck, class com.sonar.security.frontend.js.rules.ReflectedXssCheck, class com.sonar.security.frontend.js.rules.RegularExpressionDoSCheck, class com.sonar.security.frontend.js.rules.ServerSideRequestCheck, class com.sonar.security.frontend.js.rules.SQLInjectionCheck, class com.sonar.security.frontend.js.rules.ZipSlipCheck, class com.sonar.security.frontend.js.rules.SessionFixationCheck] from com.sonar.security.frontend.js.B
08:51:37.195 DEBUG: 'Import external issues report' skipped because one of the required properties is missing
08:51:37.197 DEBUG: 'IaC Terraform Sensor' skipped because there is no related file in current project
08:51:37.198 DEBUG: 'PL/SQL Sensor' skipped because there is no related file in current project
08:51:37.198 DEBUG: 'Scala Sensor' skipped because there is no related file in current project
08:51:37.199 DEBUG: 'Scoverage sensor for Scala coverage' skipped because there is no related file in current project
08:51:37.199 DEBUG: 'Import of Scalastyle issues' skipped because there is no related file in current project
08:51:37.200 DEBUG: 'Import of Scapegoat issues' skipped because there is no related file in current project
08:51:37.200 DEBUG: 'Import of Checkstyle issues' skipped because one of the required properties is missing
08:51:37.200 DEBUG: 'Import of PMD issues' skipped because one of the required properties is missing
08:51:37.201 DEBUG: 'Import of SpotBugs issues' skipped because one of the required properties is missing
08:51:37.201 DEBUG: 'Removed properties sensor' skipped because one of the required properties is missing
08:51:37.202 DEBUG: 'Flex' skipped because there is no related file in current project
08:51:37.202 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
08:51:37.203 DEBUG: 'Swift Code Quality and Security' skipped because there is no related file in current project
08:51:37.203 DEBUG: 'Import of SwiftLint issues' skipped because there is no related file in current project
08:51:37.204 DEBUG: 'gcov' skipped because there is no related file in current project
08:51:37.205 DEBUG: 'llvm-cov' skipped because there is no related file in current project
08:51:37.205 DEBUG: 'cppunit' skipped because there is no related file in current project
08:51:37.206 DEBUG: 'VisualStudioCoverage' skipped because there is no related file in current project
08:51:37.207 DEBUG: 'bullseye' skipped because there is no related file in current project
08:51:37.207 DEBUG: 'Python Sensor' skipped because there is no related file in current project
08:51:37.207 DEBUG: 'Cobertura Sensor for Python coverage' skipped because there is no related file in current project
08:51:37.207 DEBUG: 'PythonXUnitSensor' skipped because there is no related file in current project
08:51:37.208 DEBUG: 'Import of Pylint issues' skipped because there is no related file in current project
08:51:37.208 DEBUG: 'Import of Bandit issues' skipped because there is no related file in current project
08:51:37.208 DEBUG: 'Import of Flake8 issues' skipped because there is no related file in current project
08:51:37.209 DEBUG: 'Code Quality and Security for Go' skipped because there is no related file in current project
08:51:37.209 DEBUG: 'Go Unit Test Report' skipped because there is no related file in current project
08:51:37.209 DEBUG: 'Go Cover sensor for Go coverage' skipped because one of the required properties is missing
08:51:37.210 DEBUG: 'Import of go vet issues' skipped because there is no related file in current project
08:51:37.211 DEBUG: 'Import of Golint issues' skipped because there is no related file in current project
08:51:37.211 DEBUG: 'Import of GoMetaLinter issues' skipped because there is no related file in current project
08:51:37.211 DEBUG: 'Import of GolangCI-Lint issues' skipped because there is no related file in current project
08:51:37.211 DEBUG: 'Kotlin Sensor' skipped because there is no related file in current project
08:51:37.212 DEBUG: 'KotlinSurefireSensor' skipped because there is no related file in current project
08:51:37.212 DEBUG: 'Import of detekt issues' skipped because there is no related file in current project
08:51:37.213 DEBUG: 'Import of Android Lint issues' skipped because one of the required properties is missing
08:51:37.213 DEBUG: 'Import of ktlint issues' skipped because there is no related file in current project
08:51:37.213 DEBUG: 'T-SQL Sensor' skipped because there is no related file in current project
08:51:37.214 DEBUG: 'Import of ESLint issues' skipped because one of the required properties is missing
08:51:37.214 DEBUG: 'Import of TSLint issues' skipped because one of the required properties is missing
08:51:37.214 DEBUG: 'CSS Metrics' skipped because there is no related file in current project
08:51:37.215 DEBUG: 'Import of stylelint issues' skipped because there is no related file in current project
08:51:37.215 DEBUG: 'Ruby Sensor' skipped because there is no related file in current project
08:51:37.216 DEBUG: 'Import of RuboCop issues' skipped because there is no related file in current project
08:51:37.216 DEBUG: 'SimpleCov Sensor for Ruby coverage' skipped because there is no related file in current project
08:51:37.216 DEBUG: 'Python HTML templates processing' skipped because there is no related file in current project
08:51:37.217 DEBUG: 'PHP sensor' skipped because there is no related file in current project
08:51:37.217 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
08:51:37.218 DEBUG: 'Import of PHPStan issues' skipped because there is no related file in current project
08:51:37.218 DEBUG: 'Import of Psalm issues' skipped because there is no related file in current project
08:51:37.218 DEBUG: 'AbapSquidSensor' skipped because there is no related file in current project
08:51:37.224 DEBUG: 'CFamily' skipped because there is no related file in current project
08:51:37.225 DEBUG: Sensors : JavaSensor -> IaC CloudFormation Sensor -> C# Project Type Information -> C# Analysis Log -> C# Properties -> SurefireSensor -> JavaXmlSensor -> HTML -> XML Sensor -> VB.NET Project Type Information -> VB.NET Analysis Log -> VB.NET Properties -> JaCoCo XML Report Importer -> JavaScript analysis -> TypeScript analysis -> JavaScript/TypeScript Coverage -> CSS Rules -> ThymeLeaf template sensor -> Serverless configuration file sensor -> AWS SAM template file sensor -> Generic Test Executions Report -> JavaSecuritySensor -> CSharpSecuritySensor -> PhpSecuritySensor -> PythonSecuritySensor -> JsSecuritySensor
08:51:37.229 INFO: Sensor JavaSensor [java]
08:51:37.539 INFO: Configured Java source version (sonar.java.source): 11
08:51:37.545 INFO: JavaClasspath initialization
08:51:37.719 INFO: ------------------------------------------------------------------------
08:51:37.719 INFO: EXECUTION FAILURE
08:51:37.719 INFO: ------------------------------------------------------------------------
08:51:37.719 INFO: Total time: 9.865s
08:51:37.758 INFO: Final Memory: 24M/94M
08:51:37.758 INFO: ------------------------------------------------------------------------
08:51:37.758 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /builds/product-team/product/.git/.probe-4d302a54-1f04-47be-b561-d9e068bd85c8
at org.sonar.java.classpath.AbstractClasspath.getFilesInDir(AbstractClasspath.java:190)
at org.sonar.java.classpath.AbstractClasspath.getFilesForPattern(AbstractClasspath.java:176)
at org.sonar.java.classpath.AbstractClasspath.getFilesFromProperty(AbstractClasspath.java:126)
at org.sonar.java.classpath.ClasspathForMain.init(ClasspathForMain.java:58)
at org.sonar.java.classpath.AbstractClasspath.getElements(AbstractClasspath.java:321)
at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:183)
at org.sonar.java.JavaFrontend.<init>(JavaFrontend.java:89)
at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:108)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:79)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:384)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:380)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:349)
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:136)
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(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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: /builds/product-team/product/.git/.probe-4d302a54-1f04-47be-b561-d9e068bd85c8
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.base/java.nio.file.Files.readAttributes(Files.java:1764)
at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2761)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2797)
at org.sonar.java.classpath.AbstractClasspath$AbstractFileFinder.find(AbstractClasspath.java:284)
at org.sonar.java.classpath.AbstractClasspath.getMatchingDirs(AbstractClasspath.java:215)
at org.sonar.java.classpath.AbstractClasspath.getFilesInDir(AbstractClasspath.java:187)
... 37 more
08:51:37.760 ERROR:
08:51:37.760 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Do you have any hint for me, why this sometimes happens? A .probe-4d302a54-1f04-47be-b561-d9e068bd85c8 does not exist in the repository.