# Renaming the MAIN BRANCH is throwing errors during SonarCloud analysis

**URL:** <https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986>\
**Category:** SonarQube Cloud\
**Tags:** sonarqube-cloud\
**Created:** [February 9, 2022, 3:22pm UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986 "2022-02-09T15:22:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![geojakes](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/geojakes/32/20121_2.png) [@geojakes](https://community.sonarsource.com/u/geojakes)\
**Post date:** [February 9, 2022, 3:22pm UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/1 "2022-02-09T15:22:00Z")

</div>

We’ve recently moved the main branch of our repository from ‘master’ to ‘main’. As part of the process, I deleted the short-lived branch that was called ‘main’ and then renamed ‘master’ to ‘main’ as recommended [here](https://community.sonarsource.com/t/how-to-change-main-branch/1167). Once this change was made, I noticed the following issue on SonarCloud’s analysis page

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/3/c/3ca0d3d83cd3026f45f54b234aaf938803ad98aa.png)

---

<div class="post-metadata">

**Author:** ![geojakes](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/geojakes/32/20121_2.png) [@geojakes](https://community.sonarsource.com/u/geojakes)\
**Post date:** [February 9, 2022, 5:16pm UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/2 "2022-02-09T17:16:28Z")

</div>

Currently this is showing the following error:

`Project or branch in report (project_name) does not match the project or branch under which it was submitted (project_name:BRANCH:main)`

---

<div class="post-metadata">

**Author:** ![geojakes](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/geojakes/32/20121_2.png) [@geojakes](https://community.sonarsource.com/u/geojakes)\
**Post date:** [February 9, 2022, 5:23pm UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/3 "2022-02-09T17:23:32Z")

</div>

I have an `analysisID` that I could share via DM if that would help

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [February 14, 2022, 1:03pm UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/4 "2022-02-14T13:03:03Z")

</div>

Hey @geojakes

The analysis UUID is just that… a random ID. It’s not considered sensitive information. Could you share it here?

---

<div class="post-metadata">

**Author:** ![geojakes](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/geojakes/32/20121_2.png) [@geojakes](https://community.sonarsource.com/u/geojakes)\
**Post date:** [February 14, 2022, 2:31pm UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/5 "2022-02-14T14:31:31Z")

</div>

AX7fygUE8gklgpch0OnR

---

<div class="post-metadata">

**Author:** ![Alexandre\_Holzhey](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alexandre_holzhey/32/74760_2.png) [@Alexandre\_Holzhey](https://community.sonarsource.com/u/Alexandre_Holzhey)\
**Post date:** [February 25, 2022, 11:15am UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/7 "2022-02-25T11:15:03Z")

</div>

Hi @geojakes , i see your analysis run in a CI environment. Could you tell me if you updated the CI config as well to match the MAIN branch configuration? If yes, could you share with us the scanner logs (i can start a private message for you to share this information, just let me know).

---

<div class="post-metadata">

**Author:** ![geojakes](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/geojakes/32/20121_2.png) [@geojakes](https://community.sonarsource.com/u/geojakes)\
**Post date:** [March 10, 2022, 9:54pm UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/9 "2022-03-10T21:54:25Z")

</div>

Removing `-Dsonar.branch.name=main` in the gradle call fixed the issue, though this used to be working just fine before.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [April 4, 2022, 7:28am UTC](https://community.sonarsource.com/t/renaming-the-main-branch-is-throwing-errors-during-sonarcloud-analysis/57986/11 "2022-04-04T07:28:38Z")

</div>

Closed on April 4, 2022, 7:28am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
