Sonar Lint Connected Mode failed with "Error while fetching new code definition'

If your question is about SonarLint in the IntelliJ Platform, VS Code, Visual Studio, or Eclipse, please post it in that sub-category.

Otherwise, please provide:

  • Operating system: Linux
  • IDE name and flavor/env: Eclipse 2023-12 (4.30.0)

And a thorough description of the problem / question:
I am trying to use Sonar Lint first time and already performed steps as per the documentation.

On binding the project, getting below logs

SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@4d0f2471
Starting SonarLint for Eclipse 10.0.1.81733
Started embedded server on port 64120
Downloaded plugin list in 430ms
[SYNC] Synchronizing analyzer configuration for project XXXXXXX
Downloaded settings in 305ms
[SYNC] Active rules for 'abap' are up-to-date
[SYNC] Active rules for 'css' are up-to-date
[SYNC] Active rules for 'java' are up-to-date
[SYNC] Active rules for 'js' are up-to-date
[SYNC] Active rules for 'jsp' are up-to-date
[SYNC] Active rules for 'kotlin' are up-to-date
[SYNC] Active rules for 'php' are up-to-date
[SYNC] Active rules for 'plsql' are up-to-date
[SYNC] Active rules for 'py' are up-to-date
[SYNC] Active rules for 'ruby' are up-to-date
[SYNC] Active rules for 'scala' are up-to-date
[SYNC] Active rules for 'secrets' are up-to-date
[SYNC] Active rules for 'ts' are up-to-date
[SYNC] Active rules for 'tsql' are up-to-date
[SYNC] Active rules for 'web' are up-to-date
[SYNC] Active rules for 'xml' are up-to-date
Error while fetching new code definition
.
.
Error running task 'Synchronizing projects...'

Hey @Bhargav_Trivedi,

thank you for reaching out to us. Could you please provide us the full logs as described HERE?

Could you also please provide the information on your connected SonarQube version (or if you use it, SonarCloud)?
Are you perhaps located behind a proxy?

Best,
Tobias

Hi Tobias,

Thanks for quick response.
Here is the connected Sonarqube version: Developer Edition - Version 9.9.3 (build 79811)

The logs are displayed file names and repo list, so avoiding them to share it here.
While checking some of the documentation, found THIS

which shows

  • The new code definition must be defined in SonarQube or SonarCloud using a Previous version, Number of days, or Specific analysis; the Reference branch new code definition is not supported. Please check the documentation in SonarQube or on SonarCloud to properly set your new code definition.

We are using " Reference branch" as new code definition. Do you think that can cause this failure?

Hi @Bhargav_Trivedi,

I fully understand that you don’t want to share the logs in public, I will PM you regarding that so you can share them privately.
Yes, the “Reference branch” might be the case in the situation, but I have to check (also with the team if we maybe already have something in stock here, like either supporting it or providing a correct error message with more information).

Best,
Tobias

Hi @Bhargav_Trivedi,

I investigated and debriefed internally. Yes, we don’t support the “Reference Branch” for the New Code definition in SonarLint. This might change in the future, but we don’t have any concrete plans yet :frowning_face:
Currently, there is no other solution for you to switch the New Code definition on SonarQube (either this can be done by you; otherwise, reach out to the specific team).

The configuration done locally on SonarLint for Eclipse (New Code vs. Overall code) only affects what is shown to you in order to give you the option to filter issues, but it doesn’t affect the New Code definition (it uses the one from SonarQube).

I’m sorry if that leaves you with an unsatisfying feeling for now.

Best,
Tobias

Hi @Bhargav_Trivedi,

we just released SonarLint for Eclipse 10.1.0.81817. It still doesn’t support the reference branch as a new code period, but it would be great if you could give it a try to create error logs that we need on our side to move forward with that topic.
Can you do this for us, please?

Best,
Tobias