# SonarCloud API returns "Project doesn't exist" (404) for projects that exist in the UI

**URL:** <https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926>\
**Category:** SonarQube Cloud\
**Tags:** sonarqube-cloud\
**Created:** [June 17, 2025, 4:03pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926 "2025-06-17T16:03:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafael\_Couto](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rafael_couto/32/70122_2.png) [@Rafael\_Couto](https://community.sonarsource.com/u/Rafael_Couto)\
**Post date:** [June 17, 2025, 4:03pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926/1 "2025-06-17T16:03:40Z")

</div>

Hello everyone,

I’m experiencing an issue with the SonarCloud API when trying to access metrics for specific projects in my organization. I’m using Apache DevLake (an open-source dev data platform) to collect and analyze data from SonarCloud, but I’m encountering consistent 404 errors for certain repositories.

## Issue Details

When DevLake makes API calls to the `measures/component_tree` endpoint for a specific project, SonarCloud returns a 404 error with the message “Project doesn’t exist”, even though the project definitely exists and is accessible through the SonarCloud UI.

## API Call Details

The failing API call looks like this:

```auto
GET measures/component_tree
query: map[
 component:[organization_project-name]
 metricKeys:[duplicated_lines_density,duplicated_
blocks,duplicated_lines,duplicated_
files,complexity,cognitive_complexity,effort_to_
reach_maintainability_rating_a,lines]
 p:[1]
 ps:[100]
 qualifiers:[FIL]
]

```

## Error Response

```auto
Response: {"errors":[{"msg":"Project doesn\u0027t 
exist"}]} (404)

```

## What I’ve Checked

1. The project exists in my SonarCloud organization and is accessible through the UI
2. I can access other projects in the same organization through the API without issues
3. I’ve verified my authentication credentials are correct (other API calls work)
4. I’ve confirmed the organization key is correctly configured

## Questions

1. Is there a specific format requirement for project keys when using the API that might be different from what’s shown in the UI?
2. Could there be an issue with how project keys are constructed when making API calls?
3. Are there any known issues with the `measures/component_tree` endpoint for certain project configurations?
4. Is there a way to debug or get more detailed error information from the API?

Any guidance on resolving this issue would be greatly appreciated. I’m happy to provide additional information if needed.

Thank you!

---

<div class="post-metadata">

**Author:** ![tcs-cclaflin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tcs-cclaflin/32/70124_2.png) [@tcs-cclaflin](https://community.sonarsource.com/u/tcs-cclaflin)\
**Post date:** [June 17, 2025, 7:09pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926/2 "2025-06-17T19:09:17Z")

</div>

We started getting the “project doesn’t exist” message a few hours ago in our pipelines. They don’t show anything wrong on the status page but something had to have changed somewhere.

---

<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:** [June 17, 2025, 8:18pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926/3 "2025-06-17T20:18:55Z")

</div>

Hey there.

There’s a bit more to this story than I’m letting on right now (@tcs-cclaflin you’re right, something _did_ change).

In the meantime, please ensure that the appropriate permissions have been assigned to the relevant user(s) or group(s), either at the [global](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization-permissions/) or [project](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/setting-permissions/) level.

@Rafael_Couto: For you, ensure that the **Browse Project** permission is granted at the project level for the projects you’re querying **GET api/measures/component\_tree**

You can always double-check the API calls you’re making and compare to those being made in the UI (like when browsing the **Measures** tab of your project) using the following guide:

> [@How to reverse engineer the Sonar Web API](https://community.sonarsource.com/t/how-to-reverse-engineer-the-sonar-web-api/66810):
>
> Every action that is taken in SonarQube is driven by the Web API. There is nothing you can do in SonarQube that you cannot do using the Web API. warning We put a great deal of effort into the UI and UX of our products and sincerely think that most actions should be completed there. Especially when it comes to viewing analysis results, the UI is the best place to view up-to-date information with the right context. We think it is much better that you give access to others to view analysis data …

@tcs-cclaflin: For you, confirm that the **Execute Analysis** permission is assigned at either the org-level, or for the affected projects

You should probably focus on the **Members** group. Don’t try setting permissions for the **Anyone** group (you won’t see this group for much longer)

It might also be a good time to revisit any [permission templates](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/manage-org-projects/manage-project-permissions/templates/) to make sure the right permissions are being assigned not only to existing projects, but to new projects as well.

---

<div class="post-metadata">

**Author:** ![tcs-cclaflin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tcs-cclaflin/32/70124_2.png) [@tcs-cclaflin](https://community.sonarsource.com/u/tcs-cclaflin)\
**Post date:** [June 17, 2025, 9:59pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926/4 "2025-06-17T21:59:23Z")

</div>

that was the issue. Had to give our robot account execute analysis permissions. thank you.

---

<div class="post-metadata">

**Author:** ![Rafael\_Couto](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rafael_couto/32/70122_2.png) [@Rafael\_Couto](https://community.sonarsource.com/u/Rafael_Couto)\
**Post date:** [June 17, 2025, 10:26pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926/5 "2025-06-17T22:26:03Z")

</div>

Thanks for the reply Colin it was effectively an issue related with permissions 🙂

Thanks a lot!

---

<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:** [June 19, 2025, 3:25pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926/6 "2025-06-19T15:25:59Z")

</div>

To close the loop here:

> [@locked\_with\_key Important Security Update: Removal of the “Anyone” Group](https://community.sonarsource.com/t/important-security-update-removal-of-the-anyone-group/143104/1):
>
> Dear community, As part of our commitment to keeping your organization’s data secure, we are removing the Anyone group from SonarQube Cloud. The Anyone group was not aligned to the explicit Members group model and did not effectively communicate who was granted access when in use. The removal of the Anyone group is a proactive security measure – we’d like to assure you that we haven’t identified any exploitation of this group by malicious users. What’s changing: The Anyone group will no long…

---

<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:** [June 26, 2025, 3:26pm UTC](https://community.sonarsource.com/t/sonarcloud-api-returns-project-doesnt-exist-404-for-projects-that-exist-in-the-ui/142926/7 "2025-06-26T15:26:52Z")

</div>

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