Synchronizing projects / Matching Sonar project branch

Hi

I’m trying to use the SonarLint plugin for IntelliJ IDEA. It “kind of” works: The connection to the SonarQube server is established, but it is constantly (for hours) “Synchronizing projects” (background task). In the tab “Log” of the SonarLint view, I see the output “Matching Sonar project branch” over and over again.

I’m using SonarLint plugin version 10.4.1.77998 and SonarQube Community Edition, Version 9.9.3 with added branch support.

Thank you for any guidance

Hi @Beat and welcome to the Sonar Community :sonar:

To help us investigate the issue, could you please enable verbose logging and provide us with logs prior to the “Matching Sonar project branch” being logged over and over again?

Thanks.

Vojtech form :sonarlint:

Hi. Thank you for the response. I enabled verbose logging.

When I start IntelliJ IDEA there is “Matching” output for some minutes:

(...)
Matching Sonar project branch
Matched Sonar project branch for configuration scope '2d20...' changed from 'null' to 'default'
Matching Sonar project branch
Matched Sonar project branch for configuration scope '8f71...' changed from 'null' to 'default'
Matching Sonar project branch
Matched Sonar project branch for configuration scope '04d5...' changed from 'null' to 'default'
Matching Sonar project branch
Matched Sonar project branch for configuration scope '14c8...' changed from 'null' to 'r66/integration'
Matching Sonar project branch
Matched Sonar project branch for configuration scope 'c685...' changed from 'null' to 'r66/integration'
Matching Sonar project branch
Matched Sonar project branch for configuration scope 'd022...' changed from 'null' to 'default'
Matching Sonar project branch
Matched Sonar project branch for configuration scope 'fe81...' changed from 'null' to 'default'
(...)

Surprisingly I only see two branch names: default and r66/integration (apart from r66/integration we have a lot of other branches in SonarQube).

Later, only “Matching”, without “Matched” is visible:

Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
Matching Sonar project branch
(...)

Eventually the “Matching” log stops, and I see “Computing paths translation” output, like this:

Computing paths translation for config scope '75f8...'...
GET 200 https://.../api/components/tree.protobuf?qualifiers=FIL,UTS&component=...&ps=500&p=1 | response time=1639ms
Page downloaded in 1639ms
GET 200 https://.../api/components/tree.protobuf?qualifiers=FIL,UTS&component=...&ps=500&p=2 | response time=1528ms
Page downloaded in 1529ms
GET 200 https://.../api/components/tree.protobuf?qualifiers=FIL,UTS&component=...&ps=500&p=3 | response time=1083ms
Page downloaded in 1084ms

(… and additional GETs until p=26, then:)

Starting matching paths for config scope '75f8...'...
No client files for config scope '75f8...'. Skipping path matching.

Then the same for another id:

Computing paths translation for config scope '0dc6...'...
GET 200 https://.../api/components/tree.protobuf?qualifiers=FIL,UTS&component=...&ps=500&p=1 | response time=1007ms
Page downloaded in 1008ms
GET 200 https://.../api/components/tree.protobuf?qualifiers=FIL,UTS&component=...&ps=500&p=2 | response time=1033ms
Page downloaded in 1033ms
GET 200 https://.../api/components/tree.protobuf?qualifiers=FIL,UTS&component=...&ps=500&p=3 | response time=1171ms
Page downloaded in 1172ms

(… and so on)

It looks like it’s always the same pattern:

  • Computing paths translation for config scope ‘a’…
  • 26 times: GET 200 … and Paged downloaded
  • Starting matching paths for config scope ‘a’…
  • No client files for config scope ‘a’. Skipping path matching.
  • Then the same for config scope ‘b’, …

(It’s always the same URL and the same component.) Today I let it run for 4 hours. It didn’t stop.

Is this a incompatibility between the SonarLint plugin in IntelliJ IDEA and our SonarQube server (Community Edition with added branch support)?

Thanks again
Beat

Hi @Beat ,

Thank you for providing the SonarLint output. By reading through them I can’t point at anything obvious that would be wrong and it’s strange the logs are still going after 4 hours.

I assume there are no errors/warnings in the logs?

Do you have a module level binding set up for your project? Also, could I ask how many modules are in your project and whether you could share a bit about your project structure?

Many thanks!

Vojtech

Thank you for looking through the logs.

I don’t see any errors or warnings.

There are no per-module binding overrides. The project is quite big, around 1 million lines of code, 206 modules (when starting IntelliJ, I see 206 lines of “Creating container for module xyz” logs).

What confuses me, is that it looks like it’s always downloading the same stuff:

GET 200 https://…/api/components/tree.protobuf?qualifiers=FIL,UTS&component=…&ps=500&p=1 | response time=806ms
Page downloaded in 806ms

From p=1 to p=26, then start again with 1. Is this normal?

Hi @Beat,

What confuses me, is that it looks like it’s always downloading the same stuff:

GET 200 https://…/api/components/tree.protobuf?qualifiers=FIL,UTS&component=…&ps=500&p=1 | response time=806ms
Page downloaded in 806ms

There is indeed an issue that we run synchronization tasks for different configuration scopes (modules in this case) even though they all have the same binding - We have created a SLCORE-753 ticket on our side and (at the time of writing :)) we plan to include the fix in the next release (you can track the progress in the ticket).

Sorry for the inconvenience.

Best,

Vojtech from :sonarlint:

A post was split to a new topic: Unending sync 10.4.2