Will
(WillJudd)
September 5, 2023, 10:51pm
1
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
Will
(WillJudd)
September 6, 2023, 9:43am
2
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.
Will
(WillJudd)
September 6, 2023, 10:05am
3
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
Will
(WillJudd)
September 11, 2023, 6:12am
4
Hello,
Is there any workaround or update that we can use for this?
Suggestions appreciated.
Will
Colin
(Colin)
September 29, 2023, 8:27am
10
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
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.
Will
(WillJudd)
October 4, 2023, 10:46pm
13
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
Colin
(Colin)
October 6, 2023, 7:03am
14
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
Will
(WillJudd)
October 6, 2023, 10:13pm
19
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
ganncamp
(G Ann Campbell)
October 9, 2023, 12:06pm
20
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
Will
(WillJudd)
October 12, 2023, 11:48am
23
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
Kind regards,
Will
2 Likes