I’m an administrator for several SonarCloud organizations. One of our customers stated than they can’t perform analysis on a new project over Azure DevOps:
2024-09-19T13:47:48.4505378Z ##[error]13:47:48.440 ERROR Could not find a default branch for project with key '{project-key}'. Make sure project exists.
They have been performing analysis flawlessly, but over projects previously created. We have tried creating this particular project with the UI, and it has worked just right.
I deleted this project and made a test over my machine with the same result:
I have tried the original token and one token of mine. I also tried with another organization. I am, as I said, an administrator and owner of both, with Create permissions.
So going back to your initial report, are you saying that the initial analysis / project creation is what’s failing? Or is the project created via analysis and your clients subsequently can’t (re)analyze?
And are you able to pinpoint approximately when this failure started happening?
18:14:16.862 ERROR Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
18:12:20.584 ERROR main component does not belong to specified organization
Please take note that in the first test I used master and the output is like “main component” and in the second one I used main and the output is the same (Timestamp changes, ovbiously)
At as now, SonarCloud does not provision projects upon first analysis. Therefore, currently, you have to create the project before you run the first analysis.