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.
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.
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 or project 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:
@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 to make sure the right permissions are being assigned not only to existing projects, but to new projects as well.