SonarQube PR failures on two projects (LOC limit?)

Hello,

We use SonarQube Cloud across 30+ projects, and I recently noticed that analysis checks are being canceled on new pull requests for two of our projects. We run these checks via GitHub Actions.

The error we’re seeing is:

Your analysis failed because the total number of lines of code in your organization exceeds your current subscription limit.

Please ask an Organization Administrator to review your usage and if necessary upgrade your plan.

While it’s possible that we’ve hit our subscription limit, it seems unusual that this issue is only affecting two specific projects.

One difference I’ve noticed is that these two projects show two branches in SonarQube (e.g., both main and master), whereas our other projects only show a single branch. The main branch is the correct one—we no longer use master.

Failing projects:

Other projects:

Could this somehow be causing the issue?

Any insights would be appreciated. Thank you!

Hi,

You’re right; this is strange. There are supposed to be guards in place to keep you from going over your limit. Since you’re only seeing this on two projects, let’s proceed under the assumption that you’re getting the wrong error message. (:confused:)

After reading your title, the error I expected to see when I opened the thread was something like “this analysis would have caused you to go over the License LOC.” This is the guiderail that’s supposed to be in place: an analysis report that would push you over your license limit is rejected. This gives you the opportunity to clean up your analysis scope for the project, because when you’re over your license limit, all analyses are rejected - even the one that would bring you back under the limit. Since you’re not having all your analyses rejected, let’s proceed under the assumption that the error I expected is the one you should have gotten.

So in that case, the best thing to do is add -Dsonar.verbose=true to turn on debug logging so you can see the full list of files being indexed for the analysis. Probably a library or some generated code has accidentally been added to the analysis scope.

This won’t be (shouldn’t be) having an impact. On a side note, you mention you’ve moved on from master to main. Unfortunately main has been analyzed as a short-lived branch in your screenshot and branch type is immutable once established. Nor can you switch which branch is treated by SonarQube Cloud as the main one. To straighten this out, your options are

  • delete the project and start over. :frowning:
  • through the UI, delete main and then rename master to main. Your next analysis of main will hit what SonarQube Cloud treats as your main branch. (Confused yet? :sweat_smile:) This will screw up your branch history, but fix your naming.

 
HTH,
Ann

1 Like

Thank you so much for your quick response. I’m new to Sonar. Where would I add -Dsonar.verbose=true ? To our sonar-project.properties file? And after adding that, where would the debug logs be shown? Thank you!

Hi,

Sorry, I should have included that in my first response. With the -D it goes on the analysis command line. Alternately, you can add it to your properties file without the -D.

 
Ann

1 Like