Analysis stuck on "INFO: files indexed..."

Hello,

SonarQube 9.9 Enterprise installed to Windows Server
SonarScanner for MSBuild 5.12

Analysis for a large .NET web project is becoming stuck for an hour on this message:

[4440] - 23:34:37.413 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4441] - 23:34:47.413 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4442] - 23:34:57.429 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4443] - 23:35:07.429 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4444] - 23:35:17.429 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)

and still going over an hour later

[4872] - 00:46:40.976 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4873] - 00:46:50.991 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4874] - 00:47:01.007 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4875] - 00:47:11.007 INFO: 173 files indexed...  (last one was src/Feature/Claim/code/js/member-care/3rdpartylicenses.txt)
[4876] - 00:47:20.944 DEBUG: 'src/Feature/Claim/code/js/member-care/main.js' generated metadata with charset 'UTF-8'

Adding the following file exclusion has not helped.
**/3rdpartylicenses.txt

What could be the cause and how can this be resolved?

Will

Today we have updated to the latest MSBuild Scanner 5.13.1, retested, but the problem remains. The only difference is the file reported:

[4439] - 02:29:29.630 INFO: 172 files indexed...  (last one was src/Feature/Claim/code/Services/SymptomsService.cs)
[4440] - 02:29:39.630 INFO: 172 files indexed...  (last one was src/Feature/Claim/code/Services/SymptomsService.cs)
[4441] - 02:29:49.645 INFO: 172 files indexed...  (last one was src/Feature/Claim/code/Services/SymptomsService.cs)
[4442] - 02:29:59.661 INFO: 172 files indexed...  (last one was src/Feature/Claim/code/Services/SymptomsService.cs)

We then reverted to version 5.5.3, which was our previous version, retested and the problem remains.

Studying GitHub, this message seems to be from sonarlint-core rather than from the Scanners. We are on build 69595 (9.9.1) - is there either an update that fixes this or a workaround?

With thanks,

Will

Hello,

Is there any workaround or update that we can use for this?

Suggestions appreciated.

Will

Hey @Will

Sorry this got missed. To be honest – when you respond to your own post multiple times, it can fall off our list of “posts that need attention”, because we prioritize posts with 0 responses.

Can you share the verbose Scanner for .NET logs?

Share the Scanner for .NET verbose logs

  • Add /d:"sonar.verbose=true" to the…
    • SonarScanner.MSBuild.exe or dotnet sonarscanner begin command to get more detailed logs
      • For example: SonarScanner.MSBuild.exe begin /k:"MyProject" /d:"sonar.verbose=true"
    • “SonarQubePrepare” or “SonarCloudPrepare” task’s extraProperties argument if you are using Azure DevOps
      • For example:
        - task: SonarCloudPrepare@1
            inputs:
              SonarCloud: 'sonarcloud'
              organization: 'foo'
              scannerMode: 'MSBuild'
              projectKey: 'foo_sonar-scanning-someconsoleapp'
              projectName: 'sonar-scanning-someconsoleapp'
              extraProperties: |
                sonar.verbose=true
        
  • The important logs are in the END step (i.e. SonarQubeAnalyze / SonarCloudAnalyze / “Run Code Analysis”)

I can also open a private message to share these logs.

Hi Colin,

Thanks. Yes, seems impossible to edit a posting to add more details so I had to reply.

We produce verbose logs automatically so will send them if you can open a private message.

Thanks,

Will

To come back on this thread: the issue was solved by excluding a large javascript file that was emitting log messages like this:

01:24:34.0511151 - [4907] - 01:24:34.049 DEBUG: Average line length for example.js is 843736

Excluding this file stopped indexing from stalling.

It wouldn’t surprise me if AverageLineLengthCalculator is resource intensive.

I’ll flag this for attention from our developers.

1 Like

Thanks for your help Colin it was appreciated.

Is there a file naming convention that is automatically excluded for minified files, such as the typical *.min.js or *.min.css?

Will

Hi Will,

There are some default exclusions, but they seem to be based more on directory than file name.

 
HTH,
Ann

Hi @Will,

there is already a minified file exclusion, as you can see here.

That one is one of the 4 filters that the JS/TS analyzer has to exclude files based on some conventions.

So yes, naming your generated code *.min.js will make the analyzer skip the file.

Cheers,
Victor

1 Like

Thanks @ganncamp and @victor.diez,

The advice to use the .min. pattern in generated files has been passed on… so it should be plain sailing from here :slight_smile:

Kind regards,

Will

2 Likes