Analysis from Azure pipeline failed when two runs are performed concurrently

Hi,

I have an Azure Pipeline who run a SonarQube analysis (Prepare Analysis, Run Code Analysis and Publish Quality Gate Result). When I run this pipeline for different branches a few dozen seconds appart, the second run alway fail on Run Code Analysis.

Here is an excerpt from the log where the error appears (failed pipeline) :

2025-09-05T07:35:51.8951747Z INFO: Detected os: Windows Server 2022 arch: amd64 alpine: false. Platform: WIN_X64
2025-09-05T07:35:51.8958254Z INFO: Deploy location C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime, tagetRuntime: C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime\node.exe,  version: C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime\version.txt
2025-09-05T07:35:51.9039873Z WARN: Embedded Node.js failed to deploy in C:\Users\svcTFSBuildAgt\.sonar.
2025-09-05T07:35:51.9040303Z You can change the location by setting the option `sonar.userHome` or the environment variable `SONAR_USER_HOME`.
2025-09-05T07:35:51.9040946Z Otherwise, it will default to C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime.
2025-09-05T07:35:51.9041177Z Will fallback to host Node.js.
2025-09-05T07:35:51.9042171Z java.nio.file.FileSystemException: C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime\node.exe: The process cannot access the file because it is being used by another process
2025-09-05T07:35:51.9042674Z           at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
2025-09-05T07:35:51.9043044Z           at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
2025-09-05T07:35:51.9043492Z           at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
2025-09-05T07:35:51.9043919Z           at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:234)
2025-09-05T07:35:51.9044430Z           at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:482)
2025-09-05T07:35:51.9045939Z           at java.base/java.nio.file.Files.newOutputStream(Files.java:227)
2025-09-05T07:35:51.9047065Z           at org.sonar.plugins.javascript.bridge.EmbeddedNode.extract(EmbeddedNode.java:286)
2025-09-05T07:35:51.9047663Z           at org.sonar.plugins.javascript.bridge.EmbeddedNode.extractWithLocking(EmbeddedNode.java:252)
2025-09-05T07:35:51.9048362Z           at org.sonar.plugins.javascript.bridge.EmbeddedNode.deploy(EmbeddedNode.java:194)
2025-09-05T07:35:51.9048818Z           at org.sonar.plugins.javascript.bridge.BridgeServerImpl.deploy(BridgeServerImpl.java:206)
2025-09-05T07:35:51.9049230Z           at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServerLazily(BridgeServerImpl.java:337)
2025-09-05T07:35:51.9049831Z           at org.sonar.plugins.javascript.analysis.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:70)
2025-09-05T07:35:51.9050570Z           at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
2025-09-05T07:35:51.9051323Z           at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)

And here is and excerpt from the log without error (same emplacement) :

2025-09-05T07:35:46.4902048Z INFO: Detected os: Windows Server 2022 arch: amd64 alpine: false. Platform: WIN_X64
2025-09-05T07:35:46.4909823Z INFO: Deploy location C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime, tagetRuntime: C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime\node.exe,  version: C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime\version.txt
2025-09-05T07:35:50.4519194Z INFO: Using embedded Node.js runtime.
2025-09-05T07:35:50.4519851Z INFO: Using Node.js executable: 'C:\Users\svcTFSBuildAgt\.sonar\js\node-runtime\node.exe'.
2025-09-05T07:35:53.2669955Z INFO: Memory configuration: OS (49151 MB), Node.js (4144 MB).
2025-09-05T07:35:55.3612672Z WARN: Access to the multi-values/property set property 'sonar.javascript.file.suffixes' should be made using 'getStringArray' method. The SonarQube plugin using this property should be updated.
2025-09-05T07:35:55.3613506Z WARN: Access to the multi-values/property set property 'sonar.typescript.file.suffixes' should be made using 'getStringArray' method. The SonarQube plugin using this property should be updated.
2025-09-05T07:35:55.5801785Z INFO: Found 0 tsconfig.json file(s): []
2025-09-05T07:35:55.5953981Z INFO: Creating TypeScript program
2025-09-05T07:35:55.5954825Z INFO: TypeScript configuration file C:\Users\SVCTFS~1\AppData\Local\Temp\tmp-8396-CNUHlZr2tkPX
2025-09-05T07:35:55.5961936Z INFO: 10 source files to be analyzed
2025-09-05T07:35:56.0129811Z INFO: Starting analysis with current program
2025-09-05T07:35:58.8594261Z INFO: Analyzed 10 file(s) with current program
2025-09-05T07:35:58.8709362Z INFO: 10/10 source files have been analyzed
2025-09-05T07:35:58.8712590Z INFO: Hit the cache for 0 out of 10
2025-09-05T07:35:58.8720529Z INFO: Miss the cache for 10 out of 10: FILE_CHANGED [10/10]

Any idea ? The problem is always reproducible; it is not random.

Thank you

  • SonarQube server : Developer Edition v2025.1 (102418)
  • Azure OnPrem 2022.1 using SonarQube tasks v7

Hi @FrancisG,

Just a thought (former TFS admin here!)—are you running multiple build agents on this machine? If so, I’d normally expect distinct paths for each agent user account rather than all referencing C:\Users\svcTFSBuildAgt\.

In previous setups, we used separate accounts like C:\Users\svcTFSBuildAgt1\, C:\Users\svcTFSBuildAgt2\, etc., for each agent.

Alternatively, if you have to run multiple agents under a single account, you could assign a unique SONAR_USER_HOME environment variable for each agent. That should help avoid any concurrent access issues.

Hi Colin, thank you for your answer.

Yes, we have multiples builds agent on this machine and we just create separate accounts per agent and the problem is gone.

Thank you !

1 Like

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