Versions:
- SonarQube:
Developer Edition - Version 10.1 (build 73491)
- Scanner Starup Logs:
INFO: SonarScanner 4.7.0.2747 INFO: Java 11.0.22 Debian (64-bit) INFO: Linux 5.14.0-362.8.1.el9_3.x86_64 amd64 ... INFO: Analyzing on SonarQube server 10.1.0.73491
- SonarQube deployed:
Docker
- Plugins & Extensions:
None
Issue:
We have a rather large project in SQ.
SonarCube stopped analysing the project with the above issue shown on the project page, as well as all branches.
Our server is currently at 672'263
lines of our License (of 1M).
If I query the project for the lines of code through the WebAPI I get:
// api/measures/component?
"metric": "ncloc",
"value": "214040"
The current PR that I am looking at that fails shows the following on the code page
folder | Lines
-------------------
src/ | 465 |
test/ | 1 359 |
(I am not sure how to query the PR through the API, the PR number does not work as-is)
ps: Our project is configured to correctly disregard test/
but this PR touches a lot of test files.
My assumption is that even if the changes gets added on top of the current LOC of the project, we should still be far below the number of lines as per the License.
Technically there is still space to duplicate the full project on the server and it should still not go over the 1M lines limit.
At the end of the analysis this is found in the logs:
INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 338 (forceInclude=0,throughHeader=0)
INFO: Z3 refutation rate: 14 out of 394
INFO: SE: 338 out of 338
INFO: Subprocess(es) done in 151460ms
INFO: 7/700 files marked as unchanged
INFO: 8/144 test files marked as unchanged
INFO: Cache: 0/338 hits, 3486410 bytes
INFO: 338 compilation units analyzed
INFO: Sensor CFamily [cpp] (done) | time=158082ms
...
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 820 source files to be analyzed
INFO: SCM Publisher 820/820 source files have been analyzed (done) | time=3903ms
INFO: CPD Executor 42 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 659 files
INFO: CPD Executor CPD calculation finished (done) | time=383ms
INFO: SCM writing changed lines
INFO: Merge base sha1: 40bc012c6514b074872d9801cd9ae5e8afe49dcd
...
INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://<....>/dashboard?id=<project>&pullRequest=770
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://<...>/api/ce/task?id=AY7v9wsrLvmoOL-igLBH
INFO: Analysis total time: 6:34.148 s
The result of the report from the API is
{
"task": {
"id": "AY7v9wsrLvmoOL-igLBH",
"type": "REPORT",
"componentId": "AY7l7ICoLvmoOL-igK4y",
"componentKey": "<key>,
"componentName": "<name>",
"componentQualifier": "TRK",
"status": "FAILED",
"submittedAt": "2024-04-18T08:48:49+0200",
"submitterLogin": "<User>",
"startedAt": "2024-04-18T08:48:51+0200",
"executedAt": "2024-04-18T08:48:55+0200",
"executionTimeMs": 4026,
"errorMessage": "The last analysis failed because it would have caused your server-wide lines of code total to exceed your 1000000 limit.",
"hasScannerContext": true,
"errorType": "LICENSING_LOC",
"pullRequest": "770",
"warningCount": 2,
"warnings": [
"The property 'sonar.login' is deprecated and will be removed in the future. Please use the 'sonar.token' property instead when passing a token.",
"There are problems with file encoding in the source code. Please check the scanner logs for more details."
]
}
}
The above is just for the PR.
The MAIN branch development
also shows the error, except for the PR part
{
"task": {
"id": "AY6i8el_LvmoOL-igKOm",
"type": "REPORT",
"componentId": "AYJEZFoBYpCNgbZcu9n9",
"componentKey": "<key>,
"componentName": "<name>",
"componentQualifier": "TRK",
"status": "FAILED",
"submittedAt": "2024-04-03T09:52:27+0200",
"submitterLogin": "<user>",
"startedAt": "2024-04-03T09:52:28+0200",
"executedAt": "2024-04-03T09:52:32+0200",
"executionTimeMs": 3562,
"errorMessage": "The last analysis failed because it would have caused your server-wide lines of code total to exceed your 1000000 limit.",
"hasScannerContext": true,
"branch": "development",
"branchType": "BRANCH",
"errorType": "LICENSING_LOC",
"warningCount": 2,
"warnings": [
"The property 'sonar.login' is deprecated and will be removed in the future. Please use the 'sonar.token' property instead when passing a token.",
"There are problems with file encoding in the source code. Please check the scanner logs for more details."
]
}
}
What could be the problem and how can we get our project to analyse again?
Please let me know if there is any information that I can supply to assist with this