Scan result shows "does not match the project or branch under which it was submitted" after upgrade from 7.x to 8.3 developer edition

Must-share information (formatted with Markdown):

  • version: sonarqube 8.3.1, maven scanner 3.7
  • Analysing typescript and javascript
  • cli: ./mvnw -B sonar:sonar -Psonar -Dsonar.branch.name=master -Dproject.sonarVersion=19.6
  • No problem analyzing PR branches

Here is json response after data submitted to sonar server

{
  "task": {
      "id":"AXPMSMgGOEOKSaR2Lqxo",
      "type":"REPORT","componentId":
      "AW6RSyg4_xZILm5A97aL",
      "componentKey": "com.emc.dpsg.ecdm.ui:brs-ui",
      "componentName":"ecdm-ui",
      "componentQualifier":"TRK",
      "status":"FAILED",
      "submittedAt":"2020-08-08T04:16:28+0000",
      "submitterLogin":"admin",
      "startedAt":"2020-08-08T04:16:29+0000",
      "executedAt":"2020-08-08T04:16:29+0000",
      "executionTimeMs":538,
      "logs":false,
      "errorMessage":"Project or branch in report (com.emc.dpsg.ecdm.ui:brs-ui) does not match the project or branch under which it was submitted (com.emc.dpsg.ecdm.ui:brs-ui:BRANCH:master)",
      "hasScannerContext":true,
      "organization":"default-organization",
      "branch":"master",
      "branchType":"BRANCH",
      "warningCount":0,"warnings":[]
  }
}

Seek help on how to troubleshoot this issue

Hi,
Was this a one time error or does it happen consistently?

Yes, it is recurring issue, and fails consistently

it happens right after we upgrade sonarQ from 7.9 to 8.3.1. We have multiple sonar projects. Only one exhibits this behavior where maven sonar:sonar at master branch fails to submit the results

After upgrade, all PRs analysis also switched to branch mode by default( we are in the process to implment new PR settings) and it has no problem submitting result to sonar server.

I am having the same issue on SonarQube 8.4.1 (build 35646), EE.
What happened in my case was it started with a project that failed consistently running the background tasks after successful analysis.
The error in that case was something like:

Project or branch in report (myProjectKey::myBranchName) does not match the project or branch under which it was submitted (myProjectKey:::BRANCH:master)

although I no longer have the exact error message because the entry no longer shows in the background tasks UI, so I may have be off by a colon or the name “master,” but that was the gist of it.
I deleted the project from the Administration UI, which succeeded.
Afterward all my scans fail with:

Compute Engine task main component key is null. Project with UUID myProjectUuid must have been deleted since report was uploaded. Can not proceed.
And now this happens consistently. Even if I delete the project (which seems to succeed as before) and rescan, it keeps happening.
What does it mean for a project to be partially deleted, and how can I fully clean it up?

Dan,
Could you please check what is the response for {server_url}/api/project_branches/list?project=com.emc.dpsg.ecdm.ui:brs-ui?

I’m guessing that the project is corrupted in the DB. I sent you a PM.

the list looks normal, here is the main branch

{
    "name":"master",
     "isMain":true,
     "type":"BRANCH",
     "status":{"qualityGateStatus":"OK"},
     "analysisDate":"2020-07-31T05:55:45+0000",
     "excludedFromPurge":true
},

The date is where we ugpraded from 7.x to 8.3.1

“i sent you a PM” = ? :slight_smile:

That was a reply to @SamerAdra

Is the project showing up in SQ normally, with everything working? Trying to figure out if there is something that might be corrupted.

I tried a few things and I was able to reproduce the problem. I think the project is corrupted in the table “components”. If you are willing to try to fix it manually (after creating a backup), I can try to assist you.

we decided to freeze the current failing sonar project and create new one ( ie different sonar ID)

so we all set. Thanks for helping

Ok, thanks for the update.

To try to understand what caused the problem, could you please tell me if the problem started right after the upgrade or did you have successful analysis of that project/branch before starting to fail?

yes wur sonar 7.x was working with no issue on all projects