Hi, it looks like someone has delete one of our projects. Is there anyway in SonarCube cloud (Team plan) to see any logs to confirm this and who / when or a way to recover a deleted project?
Thanks
Hi, it looks like someone has delete one of our projects. Is there anyway in SonarCube cloud (Team plan) to see any logs to confirm this and who / when or a way to recover a deleted project?
Thanks
Hey James,
These logs are not available, and deleted projects cannot be recovered.
The other possibility may be that somebody changed the project permissions and you can no longer see the project. Do you know the project key? As an organization admin you might be able to try and add permissions back (see my post here: Cannot access newly created project / error creating project - #2 by Colin)
Thanks for coming back to me. I am an org. Admin and tried to do the permissions reset via API as mentioned. From what I see it failed, assuming it couldn’t find the project key as deleted.
It seems quite a big miss not having any logging / auditing or support beyond this forum on a professional tool.
It is on our roadmap!
I have been trying to reset the permissions via the API as suggested with no luck. I don’t seem to get any definitive confirmation that the project has or hasn’t been deleted just a success message and then I still cant see the project.
Next step was to assume it has been deleted and re-add it. This also fails as when I try to ‘Analyze new project’ I can see the missing one is still showing as ‘Already Imported’ from ADO and if I try and add I get the message ’ The requested project does not exist, or you have not been granted access.’
How do I delete a deleted project so I can re-import it?
Thanks, any help appreciated!?!?!
Hey James.
Indeed it might be easier to just delete it rather than fiddle with permissions.
curl -i --header 'Authorization: Bearer TOKEN' -X POST 'https://sonarcloud.io/api/projects/delete?project=PROJECT_ID'
I added -i
to the command so you get some more verbose logging. If your account has the Administer Organization permission you should be able to delete the project.
All of this assumes that this project really does still exist in your organization. There are some scenarios where a repository was imported while the another organization was bound to your GitHub Org / BitBucket workspace… whatever it is you’re using.
You can confirm the project you’re trying to operate on actually exists in your org by just calling https://sonarcloud.io/api/projects/search?organization=ORG_KEY
in your browser.
If it doesn’t exist in your org, then things get more complicated. Please have a look.
Just ran your URL and it did find it and it still seems to be analysing?:
“organization”: " XXXXXX ",
“key”: " XXXXXX ",
“name”: “XXXXXX”,
“qualifier”: “TRK”,
“visibility”: “private”,
“lastAnalysisDate”: “2025-01-08T00:25:08+0100”,
“revision”: “22870e2632c4c38da3356d5f16e78385ce3aa8c1”
no idea why we cant see in the UI, we did run the curl to set admin role again
You will also need to add the “user” permission via API.
It is possible in SonarQube Cloud to have admin permissions on a project, but not permissions to browse it. These are distinct permissions, and not roles.
So just to summarize:
admin
, you can use to add user
, as mentioned the post I linked earlierThis would restore browse permissions on the project, on top of the admin permissions you’ve already added.
Or, if you’re still stuck,
Delete the project with POST api/projects/delete so that you can recreate it.
I assure you, I want us to get to a better state than blind API calls to restore access! I’m not being quiet about it.
That got it, thanks……
I think I assumed getting the admin permission would allow you to view as well and I hadn’t added the user role………
Really appreciate the assistance!
It’s an easy assumption to make, I’ve been guilty of it many times!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.