We have trouble running a task on SonarCloud through our GitLab CI. Apparantly, we are hitting the max LoC, but this seems wrong. Our plan includes 200k LoC, our two projects have a total of slightly more than 100k LoC.
As a temporary fix, we just upgraded our plan to 300k LoC. The upgrade will end after a month and we have set it back to the original limit of 200k LoC.
The task fails with the following error message:
“This analysis will make your organization ‘org’ to reach the maximum allowed lines limit (having 200531 lines). \nPlease contact the administrator of the organization to resolve this issue.”
This error indicates that the most recent analysis found more code that apparently you were expecting. It’s unfortunate that there’s not much information to help you diagnose this. At a guess, you’ve accidentally included a new library or generated code in your analysis. You may get a few clues from your analysis logs as to what’s being wrongly included in analysis. If not, take a close look at sonar.sources and any inclusions / exclusions.
We use once /d:sonar.scanner.scanAll=false for a project where we have 41k LoC. This was also during the time of issue not larger.
For the second repo we actually have an exclusion rule like -Dsonar.exclusions=libs/frontend/org/api/**that is the same since a year. The files under this path were not moved.
If you like, I could share the specific sonar cloud task ID of a failing request.
What is interesting, the screenshots above are after increasing the max LoC. So, technically 200k should have been enough from the start, but it was not.
Let me know, if we can provide any other information.
I’m not sure what to tell you. The error is clear.
Your initial message mentioned one repo. Now you’re talking about two. Are both repos failing analysis with the same message or just one? And if so, which one?
To be very honest, I have not a full and clear understanding of your billing setup.
Our situation: as an organization, we have 2 projects. Both failed with the exact same message as mentioned above. The billing is configured for the whole organization.
I share the believe, that the error is clear. However, I also believe that my messages are showing clearly, that we do not have more than 200k LoC in our organization. This is why I am even posting here.
Please let me know, what kind of information I should provide to you. Our billing will be reset to 200k LoC in a week. We fear, that the same error pops up, since we haven’t changed anything in our codebase to get rid of the error, but only increased the LoC to 300k. Since we valued the analysis performed, these are blocking quality gates in our pipeline and when failing, disrupt our teams workflow.
Thanks for your reply. I have to apologize, the error only concerned the project with 41k LoC. This is indeed a .NET project. The failed tasks have IDs such as: AZqlMcsl7HeA0p2Ay6ha or AZqiQg9z0URUPU5yuDrk.
The associated code changes are relatively small. A few code additions only, no files moved nor dependencies introduced or updated.
I will keep your suggestion for the second repository in mind, in case that we have another issue anytime soon.
Hi Ann. Thanks for the detailed instructions. We will follow the steps described, once our billing is reset. Then we’ll share the logs with you. We expect this to be on Dec 15.
we do not see the issue right now. As stated at the very beginning:
As a temporary fix, we just upgraded our plan to 300k LoC. The upgrade will end after a month and we have set it back to the original limit of 200k LoC.
However, since I can still share the log, let me do that:
So you’re saying you’re not currently blocked? This makes it so much easier!
Okay, before upgrading your license, analysis of the .NET project was failing with ‘too many LOC’. Then you upgraded your license and now analysis succeeds, right? So when you look at that .NET project in SonarQube Cloud… how many LOC do you see when you look at the branch that was previously failing?
Please go to the measures tab, expand the Size section and tell me how many LoC you see there.
Then go to Code and browse what shows up there. You’re looking for the files / directories you aren’t expecting to see. This will help you craft your exclusions to get your analysis back under control.
Based on all your (combined) screenshots, it looks like you’re good to go right now. Your latest analysis found 41k LOC in that problematic project and your current license uses is just over 100k, as described in the first post.
I can only guess that a library was accidentally added to analysis and then removed.
If you run into this again, turn on debug analysis logging (/d:sonar.verbose=true on the begin command line) to get an exhaustive (truly ) list of the files indexed by analysis to see what extra files are being picked up that shouldn’t be.
Right, I should have mentioned that . We’ll be doing a downgrade to 200k LOC on December 14 and hope that the issue won’t reappear. If it does, we’ll reach out again.
Thanks a lot for your support and for the tip about the debug analysis logging!