Analysis on main branch failing due to exceeded number of lines

  • ALM used: Github
  • CI system used: Github Actions
  • Scanner command used when applicable: SonarSource/sonarqube-scan-action on Github
  • Languages of the repository: Swift
  • Private repo
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting): “Number of lines exceeded”, even though when checking in the organization settings we’re under the maximum limit. I got the following `analysis_id`: `ce5a652c-0e15-47df-b400-9d9b00b55541`.
  • Steps to reproduce: Try to run an analysis on main branch and get the exceeded number error.
  • Potential workaround: I do not get the error when trying to perform an analysis on non-main branches, when doing PRs.

More details:

This is the error I get on the project on SonarQube Cloud interface:

This is what I can see from the admin panel regarding the amount of number limit:

And when looking at the details of “16 projects”, I can see the project I’m trying to analyze is well included:

Noticeably, the analyses I’m running on branches other than the main one do not fail (see the icon on the left of the rows): Imgur: The magic of the Internet (using Imgur since I’m running on the 3 media limit for new users).

Thank you for help!

Hi,

The message you’re seeing in the UI shouldn’t be using present tense, but subjunctive.

You’re not over your line limit yet. Your CI successfully submitted an analysis report to SonarQube Cloud. That’s the ‘analysis successful’ message you’ll see if you look at your analysis logs. The message you got about the main branch analysis is telling you that if that particular analysis were processed, you would be over your license limit. So to keep from basically locking you out, the analysis report is discarded rather than being processed.

At a guess, something in the relevant project changed to

  • add libraries
  • add generated files
  • update configuration to analyze previously ignored files

so that suddenly analysis is finding a lot more lines than it should.

Unfortunately there aren’t a lot of tools to help you figure this out except to set sonar.verbose=true in your analysis parameters and check your analysis log for the files being indexed.

 
HTH,
Ann