19:45:11.007 INFO Found an active CI vendor: 'Bitbucket Pipelines'
19:45:11.172 INFO Detected project key 'foo-org_bar-repo' from 'Bitbucket Cloud Pipelines'
19:45:11.173 INFO Detected organization key 'foo-org' from 'Bitbucket Cloud Pipelines'
19:45:11.176 INFO Load project settings for component key: 'foo-org_bar-repo'
19:45:11.517 INFO Load project settings for component key: 'foo-org_bar-repo' (done) | time=341ms
Today it does not:
19:00:01.557 INFO Found an active CI vendor: 'Bitbucket Pipelines'
19:00:01.785 WARN The project has not been created on SonarCloud. Please go to https://sonarcloud.io/projects/create to set up the project.
19:00:01.788 INFO Load global settings
19:00:01.977 INFO Load global settings (done) | time=188ms
19:00:01.985 INFO Process project properties
19:00:02.026 ERROR You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.organization
19:00:02.356 INFO EXECUTION FAILURE
Somehow yesterday it was able to deduce the projectKey and organization but today it cannot.
Today we need to explicitly edit sonar-project.properties and add these lines:
Thanks for your reply. Yes, the SonarQube Cloud app is still installed in bitbucket at Log in with Atlassian account.
Since yesterday I have a new piece of information. A while back Sonar made it so unused tokens expire: Removing inactive tokens after 60 days . This caused pipelines that do not run often to start failing when they DID run. We discovered we could use one token saved to SONAR_TOKEN at the Workspace level and all jobs could successfully use that (e.g. the token does not seem to be scoped to a certain ProjectKey) after we deleted any of the SONAR_TOKEN variables set at the repo level. As I mentioned we started specifying sonar.projectKey and sonar.organization due to the error and that fixed the issue. Later in the day we decided to rotate that shared SONAR_TOKEN and that fixed the issue without specifying sonar.projectKey and sonar.organization. Any idea what is going on? Thanks!
Thatās what was odd. It stopped working from one day to the other (broke the day I posted here). I feel like the issue is more subtle because the āold tokenā once sonar.projectKey and sonar.organization were set worked. Thanks for your help.
I have the same problem using BB pipelines starting around the same date. I agree, there may be something more happening here.
In my case, the token did not expire. Some other notable items:
Only some of my repos have this problem now with no apparent commonality among failing or succeeded.
I can fork a problematic repo, bind the new repo to a new sonar project.
Run the same exact bitbucket pipeline on the same codebase.
It works just fine.
When I add sonar.organization property, I get Could not find a default branch for project with key '*****'. Make sure project exists.
When I add both sonar.organization and sonar.projectKey, success.
Hm. Back to the old project (that stopped working), do you get the same message as @act-mreeves in the scanner logs?
19:00:01.557 INFO Found an active CI vendor: 'Bitbucket Pipelines'
19:00:01.785 WARN The project has not been created on SonarCloud. Please go to https://sonarcloud.io/projects/create to set up the project.
If so⦠indeed, I see an increased error rate on GET api/alm_integration/show_project which started around September 4th.
I donāt know why yet, but something is definitely weird. Iāll flag this for the team.
I am also seeing this issue. Weird thing is not all repos are having this issue.
One that is failing started between 9/3 and 9/5:
9/3: SonarQube version: 11.19.0.895 [INFO] Detected project key '*****_app-ms' from 'Bitbucket Cloud Pipelines'
[INFO] Detected organization key '*****' from 'Bitbucket Cloud Pipelines'
9/5: SonarQube version: 11.19.0.903
[WARNING] The project has not been created on SonarCloud. Please go to https://sonarcloud.io/projects/create to set up the project.
and has continued to fail
Another repo has been through the same process and has not failed yet.
We think weāve figured it out ā a permissions check that was added on this API only checks for the project permission on Execute Analysis, and not for the same permission granted at the org-level. Itās under investigation.
Iām the one who did the change and I confirm @Colin got it right: we only check the"Execute Analysis" permission at the Project level, while it could also be set at the Organization level.
We have a bug fix in progress that will hopefully land on production before the end of the week. Iāll post an update here when it is.
Meanwhile, you can configure the permission at the project level to unstuck yourself.