# Could not find a default branch for project with key ''. Make sure project exists

**URL:** <https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071>\
**Category:** SonarQube Cloud\
**Created:** [December 14, 2023, 5:04pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071 "2023-12-14T17:04:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahee\_Rohit](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rahee_rohit/32/52647_2.png) [@Rahee\_Rohit](https://community.sonarsource.com/u/Rahee_Rohit)\
**Post date:** [December 14, 2023, 5:04pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/1 "2023-12-14T17:04:38Z")

</div>

We are facing following issue:

Could not find a default branch for project with key ‘’. Make sure project exists.

---

<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:** [December 18, 2023, 1:08pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/2 "2023-12-18T13:08:27Z")

</div>

Hey there.

Is this on a new project? An existing project? Happening all of the time? Some of the time?

More details would be appreciated.

---

<div class="post-metadata">

**Author:** ![Rahee\_Rohit](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rahee_rohit/32/52647_2.png) [@Rahee\_Rohit](https://community.sonarsource.com/u/Rahee_Rohit)\
**Post date:** [December 18, 2023, 1:33pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/3 "2023-12-18T13:33:09Z")

</div>

Hi its an existing project. It was working fine few days before but suddenly starts throwing errors.

---

<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:** [December 27, 2023, 6:50pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/4 "2023-12-27T18:50:52Z")

</div>

Sometimes, this error can occur if `SONAR_TOKEN` is expired or invalid. What CI are you using to run your analysis (GitHub Actions, Bitbucket Pipelines, Jenkins, etc…)?

---

<div class="post-metadata">

**Author:** ![Rahee\_Rohit](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rahee_rohit/32/52647_2.png) [@Rahee\_Rohit](https://community.sonarsource.com/u/Rahee_Rohit)\
**Post date:** [December 27, 2023, 7:52pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/5 "2023-12-27T19:52:42Z")

</div>

Thank you for your reply! We are using Bitbucket Pipelines

---

<div class="post-metadata">

**Author:** ![Ghazanfar\_Ali](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ghazanfar_ali/32/56082_2.png) [@Ghazanfar\_Ali](https://community.sonarsource.com/u/Ghazanfar_Ali)\
**Post date:** [March 30, 2024, 4:05pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/6 "2024-03-30T16:05:53Z")

</div>

Did you find solution? we are facing the same issue on bitbucket pipelines

---

<div class="post-metadata">

**Author:** ![Rishav\_Singh\_219](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rishav_singh_219/32/59403_2.png) [@Rishav\_Singh\_219](https://community.sonarsource.com/u/Rishav_Singh_219)\
**Post date:** [July 9, 2024, 6:19am UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/7 "2024-07-09T06:19:38Z")

</div>

Hi!, can you post the solution, we are facing the same issue, our project was getting analyzed few days ago and then it stopped and giving the same error as the author, please help

---

<div class="post-metadata">

**Author:** ![Sanu](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@Sanu](https://community.sonarsource.com/u/Sanu)\
**Post date:** [October 23, 2024, 8:34pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/8 "2024-10-23T20:34:48Z")

</div>

Hi, I’m encountering the same issue. The project was analyzed a few days ago, but then it stopped and showed the same error. Could you please share the solution for this?

---

<div class="post-metadata">

**Author:** ![are3k](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@are3k](https://community.sonarsource.com/u/are3k)\
**Post date:** [October 28, 2024, 7:43am UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/9 "2024-10-28T07:43:45Z")

</div>

As stated by Colin a year ago, one possible solution is to create a new Access token (User → My account → Security) and update the CI-system to use this new token. This solved my problem today 😀

---

<div class="post-metadata">

**Author:** ![balazs-hosszu\_adn](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/balazs-hosszu_adn/32/72869_2.png) [@balazs-hosszu\_adn](https://community.sonarsource.com/u/balazs-hosszu_adn)\
**Post date:** [November 20, 2025, 1:54pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/10 "2025-11-20T13:54:42Z")

</div>

> [@are3k](#):
>
> Security

Hey Sonar Team!

We still this issue still happening with the Scoped Org tokens. The error message can be misleading to understand what is the issue, especially with the scoped tokens having more opportunity to not be valid for a project.

Do you plan to improve this error message, stating the issue is with the token? That would be appreciated.

Thanks and cheers,  
Balazs

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [November 20, 2025, 6:57pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/11 "2025-11-20T18:57:18Z")

</div>

Hi @balazs-hosszu_adn,

You’ve resurrected a topic that’s 1 year old. Per [the FAQ](https://community.sonarsource.com/faq), please don’t do that. Please create a new thread with all your details.

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [November 20, 2025, 6:57pm UTC](https://community.sonarsource.com/t/could-not-find-a-default-branch-for-project-with-key-make-sure-project-exists/106071/12 "2025-11-20T18:57:21Z")

</div>


