"The bridge server is unresponsive" error while scanning Typescript project

Hello Thai,

Could you try the following: disable rules S4328 and S5973 from your quality profile and run the analysis again?
We have introduced a new feature fetching info from package.json files in these rules which might be resource-heavy. If your issues disappear after this, we will have found the culprit.

Hi Illia,

Rules S4328 and S5973 are not active in my quality profile.

Best regards,
Thai Nguyen

Could you add the node_modules/ folder to sonar.exclusions?

I tried it, but the issue is still there.

Could you try to run the analysis without the node_modules/ folder, deleting it before running the analysis?

Hi Illia,

I tried to delete node_modules/ folder before running the analysis, and the issue didn’t occur.
I consider this is a workaround for this issue. Could you explain why?

Best regards,
Thai Nguyen

Hi Ilia,

The pipeline is still having the issue sometimes, it’s intermittent. After all, deleting node_modules is just a workaround, the root cause hasn’t been found and fixed.

Best regards,
Thai Nguyen

Hello Thai,

We have introduced a new feature in SonarJS 10.10.0 to gather available dependencies
and their versions to improve the behaviour of several rules. Having seen more than 2k lines such as: ... DEBUG: Found package.json ... pointing to the node_modules/ folder would suggest that our current implementation can be optimized.

I have opened an issue to track the fix.

I am also facing this problem using - pipe: sonarsource/sonarcloud-scan:2.0.0
19:41:13.531 INFO: SonarScanner 5.0.1.3006
19:41:16.733 DEBUG: SonarCloud 10.3.0.1951
and i dont have node_module in my repo, just specify directories in the “sonar-project.properties” file for analysis

Hello all,

could you please try increasing memory assigned to Node.js and let us know if that helps?

sonar.javascript.node.maxspace=8192

Cheers,
Victor

I tried this solution and it didn’t work. It keeps loading on a certain file for a long time.

Hi @Joseff361, can you send me the full debug logs, please?

Sure, @victor.diez . This took 54 minutes. I had to stop it.

I can’t share the log here on a public platform, may I have your email id?

Hello @saad_kayani,

I will write you privately. Check your PMs.

Cheers,
Victor

Hi @Joseff361,

I would need you to enable debug logs, like mentioned here:

Also, would be helpful if you can share the tsconfig.json contents.

Thanks!
Victor

I can’t share that kind of log here. Would you mind opening a personal chat instead?

I was able to find the solution with the help of a sonar member. In my case, I was using one of the default images provided by sonar called atlassian/default-image:4. The problem was related to docker image memory so I increased it to 2048, like this:

definitions:
  services:
    docker:
      memory: 8192

And now It works very well and all my files are read.

Hello, i have the same issue, i went from sonarsource/sonarcloud-scan:1.4.0 which it was working well,
to sonarsource/sonarcloud-scan:2.0.0 which is not working now.
This is my bitbutcket-pipeline

image: atlassian/default-image:3

definitions:
  caches:
    sonar: ~/.sonar/cache  # Caching SonarCloud artifacts will speed up your build
  services:
    docker:
      memory: 4096 
      type: docker
  steps:
    - step: &codeAnalysis
        name: Code Analysis
        services:
          - docker
        size: 2x
        image: node:latest
        clone:
          depth: full    # SonarCloud scanner needs the full history to assign issues properly
        caches: # Caching artifacts to speed up the buil
          - node
          - sonar
        script:
          - yarn install
          - pipe: sonarsource/sonarcloud-scan:2.0.0
            variables:
              SONAR_SCANNER_OPTS: -Xmx4096m
              EXTRA_ARGS: -Dsonar.javascript.node.maxspace=8192
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.6

pipelines:
  branches:
    develop:
      - step:
          <<: *codeAnalysis

Hi @Chernomirdin,

can you share the full debug logs, please? I can write you a PM if you prefer not to share them publicly.

Cheers,
Victor