Javascript sensor taking too long at "Deploying the bridge server"

Hello. I’m using sonarcloud with self hosted Azure DevOps pipelines agents on Windows Server 2016 x64 and Sensor JavaScript/TypeScript analysis [javascript] is taking from 5 to 10 minutes at the step “Deploying the bridge server into C:\Windows\temp.sonartmp\bridge-bundle”

Any ideas how could I solve that?

Thanks

Hi,

Welcome to the community!

Could we have the full analysis log, copy/pasted in text form, please?

 
Thx,
Ann

Sure. Here it goes.

11.log (922.3 KB)

Thanks

1 Like

Hi,

Thanks. Nothing jumps out at me in your log (I didn’t honestly expect anything to, but I had to check). So I’ve flagged this for the language experts.

 
Ann

1 Like

Hello Thiago,
In this step, the scanner loads the JS analyzer, which is written mainly in JS. It is unpacking it and its dependencies which is a lot of files. It can sometimes be slow as it is in your case.
Could you somehow upgrade your environment resources like disk speed or RAM?

Best,
Ilia

Hello, Ilia.

Thanks for the answer. Is there any kind of configuration to keep the JS analyzer or its dependencies pre installed in the server or in local cache to avoid that behavior of loading and unpacking all the files everytime we run an analysis? It would save much time as we scan many pull requests from many projects a day.

Hello Thiago,

We currently have not configuration to cache the extracted files between scans. I can recommend upgrading your infrastructure to use an SSD for example.

We have already attempted to fix this issue by bundling all the JS files into 1, but it has proven difficult due to the usage of TS aliases and it being NodeJS, but the adoption of ES modules could provide a solution for this.

You can track this issue here: Avoid long unpacking of `eslint-bridge` on Windows during the Visual Studio SonarLint installation and update · Issue #3319 · SonarSource/SonarJS · GitHub

Is this problem resolved. Please provide me the solution. I am also struggling with the same issue.
llia, Can u help in how to adopt ES modules to resolve this issue

Hi @Vibhu_Gupta, we have improved the JavaScript/TypeScript/CSS analyzer deployment speed which was released in the SonarQube Server 10.8 release and available in SonarQube Cloud and SonarQube IDE.

Thanks llia, I will try with SonarQube Server 10.8 and share input with you if it really optimizes

1 Like

Hi, I was having the same issues and in my case the problem was Windows Defender. Just like in the first post, “Deploying bridge server” took over a minute for each JS/TS project. I could reproduce the issue both on my local pc and remote Jenkins host (both Windows).

The problem from what I gathered is that Sonar is unpacking a large bundle and Windows tries analyzing 14k files or something.

I fixed it by excluding the folders Sonar runs in (development repos on my PC, workspace folders on the Jenkins host) from Windows Defender Virus & Threat Protection. Now the server starts up in a few seconds

1 Like