Failed analysis - AW21NYZ_Vh14FScYxF-g

Hi,

Our builds stopped working a few days ago. We were reaching the maximum lines allowed by our license. I deleted some old projects from our account and confirmed in the Administration>Billing page that there is now space for more lines.

However, our builds are still failling for new pull-requests. Analysis work for existing branches/pull-requests.

We use Jenkins to trigger a Maven build (Java), with sonar-maven-plugin version 3.6.0.1398.
The repository is hosted in Bitbucket Cloud and our organisation account is linked to the Bitbucket Cloud Team.

I tried deleting the workspace in Jenkins, but the error remains.
Any idea on how to get the new pull-request into SonarCloud so the analysis does not fail?

Thanks!

This is the error we get during the build:

[INFO] ---------------------------< com.elgin:apps >---------------------------
[INFO] Building apps 3.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ apps ---
[INFO] User cache: /XXXXXXX/.sonar/cache
[INFO] SonarQube version: 8.0.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Load global settings
[INFO] Load global settings (done) | time=272ms
[INFO] Server id: 74E9293D-AWHW8ct9-T_TB3XqouNu
[INFO] User cache: /XXXXXXX/.sonar/cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=82ms
[INFO] Load/download plugins (done) | time=186ms
[INFO] Loaded core extensions: developer-scanner
[INFO] Process project properties
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=3ms
[INFO] Project key: elgindevteam_apps
[INFO] Base dir: /XXXXXXX/apps-refactoring_PR-232
[INFO] Working dir: /XXXXXX/apps-refactoring_PR-232/target/sonar
[INFO] Load project settings for component key: 'elgindevteam_apps'
[INFO] Load project settings for component key: 'elgindevteam_apps' (done) | time=72ms
[INFO] Load project branches
[INFO] Load project branches (done) | time=66ms
[INFO] Load projects for organization 'elgindevteam'
[INFO] Load projects for organization 'elgindevteam' (done) | time=294ms
[INFO] Load project pull requests
[INFO] Load project pull requests (done) | time=86ms
[INFO] Load branch configuration
[WARNING] Parameter 'sonar.pullrequest.branch' can be omitted because the project on SonarCloud is linked to the source repository.
[WARNING] Parameter 'sonar.pullrequest.base' can be omitted because the project on SonarCloud is linked to the source repository.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.856 s
[INFO] Finished at: 2019-10-10T13:00:59+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project apps: Could not find the pullrequest with key '232': Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=elgindevteam_apps&pullrequestKey=232 : {"errors":[{"msg":"Not Found"}]} -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Hi,

We are still experiencing the issue. Any idea what we can do to fix this?

Thank you!

Cheers,
Diogo

Hi Diogo and welcome to the community!

Please go to the Administration / Background Tasks page, find the line with Status “FAILED”, click on the gear icon, and Show Error Details.
Please let us know if the error message there helps you understand and resolve the issue, or if not then what it is.

Thanks a lot

Hi Vince,

As mentioned, the error is reaching the maximum lines of code.

Error Details

This analysis will make your organization 'elgindevteam' to reach the maximum allowed lines limit. 
Please contact the administrator of the organization to resolve this issue.

Which was legit, but I removed some old legacy projects that were descontinued and regained some “lines of code”, as you can see in the following screenshot of the billing page:

2019-10-22-140654_617x177_scrot

But builds still fail with the same error. Is there a limit on line codes per project?

Thanks,
Diogo

Hi @elgin-diogocosta,

Thanks for the details.
There may be the possibility that you still don’t have enough lines of code remaining.

We will improve the error message in the future to make it clearer than what it is today.

Hi Vince,

Turns out the error message is from an old build…
Analysis of new pull-requests don’t even show up in the “Background tasks” page.

The builds are failing with the following error:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project apps: 
Could not find the pullrequest with key '265': Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=elgindevteam_apps&pullrequestKey=265 
: {"errors":[{"msg":"Not Found"}]} -> [Help 1]

It looks like the integration with BitBucket Cloud is broken and pull-requests are not being synced. Is that possible?

Is there a way to reconnect BitBucket Cloud and SonarCloud?

Thanks,
Diogo

Hi,

This error should happen only if the PR specified does not exist on bitbucket.
Did the errors occurred only once or several times? Also, did you rename your project recently?

Hi,

This error should happen only if the PR specified does not exist on bitbucket.

I know for sure the pull-request exists because the build is triggered by the its creation.

Did the errors occurred only once or several times?

It is happening for all new pull-requests. Only works on branches that were analysized before.

Also, did you rename your project recently?

No, the name of the project is the same since its creation.