"Could not find project with name" error in Project Settings

Hello there Sonar Community.

I am fairly new to this Sonar world, both me and my company, and we are experiencing some issues that we can’t really crack. We are using SonarQube Enterprise with Azure DevOps repos and pipelines.

So far, we’ve connected the server with ADO successfully, and we are able to create projects in SonarQube, we do see a full list of all of our repos, nested under the many different projects. Just so you can see:

We managed to also add tasks to our PR pipelines, and they work fine, whenever we have a PR, code gets analyzed and published in Sonarqube for us to review and see.

However, we are encountering this issue:

When checking it out we get this; as you can see, it says that the project can’t be found, but it was clearly there when we created the project with Sonarqube’s own UI. We tried changing names and with other projects and we get the same issues on all of them.

Does anyone know what causes this and how we could fix it? Due to this, we can’t get our pipelines PR decorations, and hence enforce the quality gates of Sonarqube.

Thank you kindly in advance.

Hey there.

Consider the URL when you view a repository in Azure DevOps:

https://dev.azure.com/colinmueller/ColinMuellerSonarSource/_git/newrepo

here ColinMuellerSonarSource is my project name, and newrepo is my repository name.

Hello there Colin,

thank you for your reply. :smiley: However, that is precisely the configuration i have.

That being said, I went to check now, and without doing anything the error has gone away for one of my many projects, and now that one project is correctly connected.

Weird, but hey, I won’t complain! Still, the other repositories, who are direct siblings of that one project that does work, still present the same issues.

Any idea why? We renamed our repositories before creating new Projects in SonarQube, but the previous ones still exist somewhere, could that be affecting this?

Thank you for your time.

I have the exact same issue. My build pipeline works fine and I get the analysis, just my decorations do not work. I cannot stop the pull request.

Hello there Jeff.

I figured it out a few days ago. All the configuration was fine, but the reason as to why the error “You have the following Errors in your configuration: Could not find project with name [Project] under [organization]” was because apparently we had to add a service user account to our Azure DevOps Project.

Without that service user, there is no actual connection to the repo and its PRs. It’s very not intuitive given that you connect everything with tokens and Service Connections, that you need to add a user on top of it was very confusing, and I didn’t saw it documented anywhere. Maybe I’m totally wrong though, about it not being documented I mean.

But try that, if your organization has a Service Account user for Sonarqube, adding it to your project will give the necessary access to decorate your PRs (Since it is that user that will do such a thing).

It is truly cool when everything works!