Sonarsource-cfamily-*.dll is being used by another process on SonarQube 9.4 DE & Azure DevOps 2019

Hello there!

We recently implemented a build pipeline with the SonarQube tasks in it. It works like a charm, most of the time. The SonarQubeAnalyze task sometimes crashes for (at least to me) arbitrary reasons. It seems a file from the task is in use. I don’t know where to start debugging to determine what is wrong. Because when I retry the build it can succeed, but can also fail again.The fix is scheduling the build again, but that seems hardly a permanent solution. Can anyone help me in the right direction to fix this?

We run a SonarQube 9.4 Developer Edition, Azure DevOps Server 2019 on a Windows Server 2016 VM, and use the Azure Pipeline Agent 2.202.1 on multiple different Windows Server 2016 VM’s.

Below you can find a snapshot of the verbose logging;

2022-08-02T11:18:05.2940579Z 13:18:05.292 DEBUG: Loading C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll
2022-08-02T11:18:05.3132282Z 13:18:05.311 INFO: ------------------------------------------------------------------------
2022-08-02T11:18:05.3133051Z 13:18:05.312 INFO: EXECUTION FAILURE
2022-08-02T11:18:05.3133576Z 13:18:05.312 INFO: ------------------------------------------------------------------------
2022-08-02T11:18:05.3137996Z 13:18:05.312 INFO: Total time: 20.596s
2022-08-02T11:18:05.3515856Z 13:18:05.350 INFO: Final Memory: 20M/74M
2022-08-02T11:18:05.3516759Z 13:18:05.350 INFO: ------------------------------------------------------------------------
2022-08-02T11:18:05.3566950Z ##[error]13:18:05.350 ERROR: Error during SonarScanner execution
2022-08-02T11:18:05.3583922Z 13:18:05.350 ERROR: Error during SonarScanner execution
2022-08-02T11:18:05.3585530Z ##[error]java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
2022-08-02T11:18:05.3586747Z java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
2022-08-02T11:18:05.3588847Z ##[error]at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:156)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.completeScannerExtensions(AbstractExtensionDictionary.java:82)
2022-08-02T11:18:05.3590462Z 	at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:156)
2022-08-02T11:18:05.3591300Z 	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.completeScannerExtensions(AbstractExtensionDictionary.java:82)
2022-08-02T11:18:05.3593968Z ##[error]at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getExtensions(AbstractExtensionDictionary.java:77)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getFilteredExtensions(AbstractExtensionDictionary.java:67)
	at org.sonar.scanner.sensor.ModuleSensorExtensionDictionary.selectSensors(ModuleSensorExtensionDictionary.java:47)
2022-08-02T11:18:05.3595835Z 	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getExtensions(AbstractExtensionDictionary.java:77)
2022-08-02T11:18:05.3596700Z 	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getFilteredExtensions(AbstractExtensionDictionary.java:67)
2022-08-02T11:18:05.3597929Z 	at org.sonar.scanner.sensor.ModuleSensorExtensionDictionary.selectSensors(ModuleSensorExtensionDictionary.java:47)
2022-08-02T11:18:05.3599828Z ##[error]at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$0(ModuleSensorsExecutor.java:52)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
2022-08-02T11:18:05.3601308Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$0(ModuleSensorsExecutor.java:52)
2022-08-02T11:18:05.3602072Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
2022-08-02T11:18:05.3603864Z ##[error]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:52)
	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81)
2022-08-02T11:18:05.3605500Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:52)
2022-08-02T11:18:05.3606248Z 	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81)
2022-08-02T11:18:05.3607577Z ##[error]at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
2022-08-02T11:18:05.3609605Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
2022-08-02T11:18:05.3612080Z ##[error]at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:392)
2022-08-02T11:18:05.3614213Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
2022-08-02T11:18:05.3614983Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:392)
2022-08-02T11:18:05.3616937Z ##[error]at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:388)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:385)
2022-08-02T11:18:05.3618605Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:388)
2022-08-02T11:18:05.3619411Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:385)
2022-08-02T11:18:05.3621316Z ##[error]at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:357)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
2022-08-02T11:18:05.3622805Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:357)
2022-08-02T11:18:05.3623578Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
2022-08-02T11:18:05.3624877Z ##[error]at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
2022-08-02T11:18:05.3626057Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
2022-08-02T11:18:05.3628621Z ##[error]at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:134)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
2022-08-02T11:18:05.3630591Z 	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:134)
2022-08-02T11:18:05.3631615Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
2022-08-02T11:18:05.3633052Z ##[error]at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
2022-08-02T11:18:05.3634416Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
2022-08-02T11:18:05.3635918Z ##[error]at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
2022-08-02T11:18:05.3637501Z 	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
2022-08-02T11:18:05.3638242Z 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
2022-08-02T11:18:05.3639941Z ##[error]at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-08-02T11:18:05.3641711Z 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2022-08-02T11:18:05.3642406Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-08-02T11:18:05.3644208Z ##[error]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-08-02T11:18:05.3646131Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2022-08-02T11:18:05.3646911Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-08-02T11:18:05.3648658Z ##[error]at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2022-08-02T11:18:05.3649929Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2022-08-02T11:18:05.3650574Z 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2022-08-02T11:18:05.3653225Z ##[error]at jdk.proxy1/jdk.proxy1.$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)
2022-08-02T11:18:05.3654933Z 	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
2022-08-02T11:18:05.3655511Z 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2022-08-02T11:18:05.3656265Z 	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2022-08-02T11:18:05.3656896Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
2022-08-02T11:18:05.3657436Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
2022-08-02T11:18:05.3660614Z ##[error]at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ClassRealm{cpp}-com.sonar.cpp.plugin.CFamilySensor': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ClassRealm{cpp}-com.sonar.cpp.plugin.AnalyzerUnpacker': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Fail
2022-08-02T11:18:05.3662795Z 	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2022-08-02T11:18:05.3666153Z ##[error]ed to instantiate [com.sonar.cpp.plugin.AnalyzerUnpacker]: Constructor threw exception; nested exception is java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
2022-08-02T11:18:05.3668970Z ed to instantiate [com.sonar.cpp.plugin.AnalyzerUnpacker]: Constructor threw exception; nested exception is java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
2022-08-02T11:18:05.3670506Z 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
2022-08-02T11:18:05.3671356Z 	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
2022-08-02T11:18:05.3673743Z ##[error]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
2022-08-02T11:18:05.3675605Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
2022-08-02T11:18:05.3676817Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
2022-08-02T11:18:05.3679262Z ##[error]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2022-08-02T11:18:05.3681082Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
2022-08-02T11:18:05.3682048Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2022-08-02T11:18:05.3684206Z ##[error]at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2022-08-02T11:18:05.3685842Z 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
2022-08-02T11:18:05.3686712Z 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2022-08-02T11:18:05.3688184Z ##[error]at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2022-08-02T11:18:05.3690013Z 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2022-08-02T11:18:05.3692167Z ##[error]at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:671)
2022-08-02T11:18:05.3693735Z 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
2022-08-02T11:18:05.3694599Z 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:671)
2022-08-02T11:18:05.3696109Z ##[error]at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:659)
2022-08-02T11:18:05.3697434Z 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:659)
2022-08-02T11:18:05.3699671Z ##[error]at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1300)
	at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:154)
2022-08-02T11:18:05.3701281Z 	at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1300)
2022-08-02T11:18:05.3702122Z 	at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:154)
2022-08-02T11:18:05.3703353Z ##[error]... 33 more
2022-08-02T11:18:05.3704081Z 	... 33 more
2022-08-02T11:18:05.3707913Z ##[error]Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ClassRealm{cpp}-com.sonar.cpp.plugin.AnalyzerUnpacker': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.sonar.cpp.plugin.AnalyzerUnpacker]: Constructor threw exception; nested exception is java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:315)
2022-08-02T11:18:05.3711515Z Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ClassRealm{cpp}-com.sonar.cpp.plugin.AnalyzerUnpacker': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.sonar.cpp.plugin.AnalyzerUnpacker]: Constructor threw exception; nested exception is java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
2022-08-02T11:18:05.3713569Z 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:315)
2022-08-02T11:18:05.3715779Z ##[error]at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:296)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
2022-08-02T11:18:05.3717452Z 	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:296)
2022-08-02T11:18:05.3718540Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
2022-08-02T11:18:05.3720956Z ##[error]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
2022-08-02T11:18:05.3722777Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
2022-08-02T11:18:05.3723763Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
2022-08-02T11:18:05.3725374Z ##[error]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2022-08-02T11:18:05.3726765Z 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2022-08-02T11:18:05.3729051Z ##[error]at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2022-08-02T11:18:05.3730855Z 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
2022-08-02T11:18:05.3731731Z 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2022-08-02T11:18:05.3733136Z ##[error]at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2022-08-02T11:18:05.3734367Z 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2022-08-02T11:18:05.3736495Z ##[error]at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
2022-08-02T11:18:05.3738127Z 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283)
2022-08-02T11:18:05.3738926Z 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
2022-08-02T11:18:05.3740319Z ##[error]at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
2022-08-02T11:18:05.3741571Z 	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
2022-08-02T11:18:05.3743747Z ##[error]at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309)
2022-08-02T11:18:05.3745676Z 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389)
2022-08-02T11:18:05.3746600Z 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309)
2022-08-02T11:18:05.3748214Z ##[error]at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
2022-08-02T11:18:05.3749548Z 	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
2022-08-02T11:18:05.3751047Z ##[error]at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
	... 46 more
2022-08-02T11:18:05.3752350Z 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
2022-08-02T11:18:05.3752908Z 	... 46 more
2022-08-02T11:18:05.3755153Z ##[error]Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.sonar.cpp.plugin.AnalyzerUnpacker]: Constructor threw exception; nested exception is java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
2022-08-02T11:18:05.3757551Z Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.sonar.cpp.plugin.AnalyzerUnpacker]: Constructor threw exception; nested exception is java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
2022-08-02T11:18:05.3760130Z ##[error]at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
2022-08-02T11:18:05.3761541Z 	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)
2022-08-02T11:18:05.3762306Z 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
2022-08-02T11:18:05.3763698Z ##[error]at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:311)
2022-08-02T11:18:05.3764916Z 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:311)
2022-08-02T11:18:05.3765737Z ##[error]... 61 more
2022-08-02T11:18:05.3766440Z 	... 61 more
2022-08-02T11:18:05.3769215Z ##[error]Caused by: java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
	at com.sonar.cpp.jni.FileSystemOperations.init(FileSystemOperations.java:99)
2022-08-02T11:18:05.3772044Z Caused by: java.lang.IllegalStateException: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
2022-08-02T11:18:05.3773349Z 	at com.sonar.cpp.jni.FileSystemOperations.init(FileSystemOperations.java:99)
2022-08-02T11:18:05.3774770Z ##[error]at com.sonar.cpp.plugin.AnalyzerUnpacker.<init>(AnalyzerUnpacker.java:45)
2022-08-02T11:18:05.3776365Z 	at com.sonar.cpp.plugin.AnalyzerUnpacker.<init>(AnalyzerUnpacker.java:45)
2022-08-02T11:18:05.3779355Z ##[error]at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
2022-08-02T11:18:05.3782148Z 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2022-08-02T11:18:05.3783420Z 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
2022-08-02T11:18:05.3785662Z ##[error]at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
2022-08-02T11:18:05.3787239Z 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2022-08-02T11:18:05.3788046Z 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
2022-08-02T11:18:05.3789173Z ##[error]at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
2022-08-02T11:18:05.3790250Z 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
2022-08-02T11:18:05.3791415Z ##[error]at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
	... 63 more
2022-08-02T11:18:05.3792515Z 	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
2022-08-02T11:18:05.3792968Z 	... 63 more
2022-08-02T11:18:05.3794398Z ##[error]Caused by: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
2022-08-02T11:18:05.3795982Z Caused by: java.nio.file.FileSystemException: C:\windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\sonarsource-cfamily-jni1173478238377879899.dll: The process cannot access the file because it is being used by another process
2022-08-02T11:18:05.3798497Z ##[error]at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
2022-08-02T11:18:05.3800166Z 	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
2022-08-02T11:18:05.3800866Z 	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
2022-08-02T11:18:05.3801557Z 	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
2022-08-02T11:18:05.3803682Z ##[error]at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:275)
	at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
	at java.base/java.nio.file.Files.deleteIfExists(Files.java:1191)
2022-08-02T11:18:05.3805277Z 	at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:275)
2022-08-02T11:18:05.3806032Z 	at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
2022-08-02T11:18:05.3806996Z 	at java.base/java.nio.file.Files.deleteIfExists(Files.java:1191)
2022-08-02T11:18:05.3807993Z ##[error]at java.base/java.nio.file.Files.copy(Files.java:3148)
2022-08-02T11:18:05.3808945Z 	at java.base/java.nio.file.Files.copy(Files.java:3148)
2022-08-02T11:18:05.3810129Z ##[error]at com.sonar.cpp.jni.FileSystemOperations.init(FileSystemOperations.java:97)
	... 70 more
2022-08-02T11:18:05.3811240Z 	at com.sonar.cpp.jni.FileSystemOperations.init(FileSystemOperations.java:97)
2022-08-02T11:18:05.3811695Z 	... 70 more
2022-08-02T11:18:05.9873854Z Process returned exit code 1
2022-08-02T11:18:05.9876973Z ##[error]The SonarScanner did not complete successfully
2022-08-02T11:18:05.9878172Z The SonarScanner did not complete successfully
2022-08-02T11:18:05.9882115Z ##[error]13:18:05.987  Post-processing failed. Exit code: 1
2022-08-02T11:18:05.9883198Z 13:18:05.987  Post-processing failed. Exit code: 1
2022-08-02T11:18:06.0082993Z ##[error]The process 'C:\agents\vsts-agent-win-x64-2.202.1\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.23.1\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
2022-08-02T11:18:06.0150015Z ##[section]Finishing: SonarQubeAnalyze

Hi @Eindbaard ,

it could be that Windows defender or any other antivirus is locking the file while we try to access it. Is Windows defender or an antivirus enabled?

Thank you for the reply, Massimo. Shame I didn’t think about that before creating this issue. Because it would make sense, yes. I’ll check with our IT guys right away and I’ll let you know.

Have a pleasant day!

Hi @Eindbaard ,

did you manage to solve the problem?

Hi Massimo,

After several attempts with our Support guys we found that you were right. It was a virus scanner that rigorously locked these files. The problem now is fixed and 100% of our builds pass. Thanks for the help!

1 Like

Hi @Eindbaard ,

thank you for coming back, I am happy you solved the issue.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.