Running against master, but getting ERROR: "A regular analysis is required before branch analysis"

I am attempting my first SonarCloud scan as part of an Azure DevOps pipeline.

I am running the analysis against the master branch.
However, I am getting an error saying that “A regular analysis is required before a branch analysis”

I figured running against the default, master branch would be enough to indicate this. Seems like a bug, unless there is there some setting I’m missing somewhere??

Hi,

Can you make sure that on SonarCloud’s side, the default branch is master as well ? And that the long-living branch pattern doesn’t include master ?

Thanks.

Mickaël

The project was not on the SonarCloud side when I first posted this. It was a “new” project.

However, I have figured out the underlying issue - even though my new project had a new project-key assigned, the “name” was the same as an older, previously deleted project in my SonarCloud project. I was able to get a work-around by upping the project version.

Steps to reproduce (generic data but gives you the idea):

  1. Create a project for SonarCloud analysis
  • project-name = Project
  • project-key = myunique-projectkey
  • version = 1.0
  1. Run an analysis

  2. Delete project in Sonarcloud

  3. Configure a new project analysis with the following values

  • project-name = Project
  • project-key = myunique-projectkey-2
  • version = 1.0
  1. Run analysis

  2. Observe the error “A regular analysis is required before branch analysis”, which is confusing to this context.

If I up the version to 2.0, analysis happens with no issues. So it seems like there is some checking on project-name + version that is causing issues.