Malformed key for Project

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) - Developer Edition 9.2
  • what are you trying to achieve - Setup SonarQube for my project
  • what have you tried so far to achieve this - Sonar setup done, trying add Azure dev repo

Hello

My existing project name is like “My Project (Beta)”, I am not able to setup Sonar repo. It says
Malformed key for Project: 'My Project (Beta)… Allowed characters are alphanumeric, ‘-’, ‘_’, ‘.’ and ‘:’, with at least one non-digit.

How Can I fix it without changing my project name. not sure how can I change repo name.

Hello @Santu1990

The restrictions on the project keys characters cannot be circumvented but this does not mean you cannot setup a project with a project name or repo that holds those disallowed characters.
You definitely don’t need to change your project name or repo to set up a SonarQube project.
The project key is a SonarQube unique identifier that is not necessarily built from the projet or repo name.

I suppose that you use the project onboarding wizard. I could reproduce your problem

This looks like a bug in the onboarding wizard. You will have to onboard your project manually:

  • In the Administration → Project management click on create project. Give it a key of your choice using only the allowed characters (like my-project-beta)
  • Navigate to the project settings → General Settings → DevOps integration and manually set the project name and repo like below

There will be no wizard for creating you basic pipeline YAML file, but you can good YAML example for the different types (CLI, Maven, Gradle, .Net) of scan at Azure DevOps Integration | SonarQube Docs

Olivier

1 Like

Thank you for your help. I will try this way. let you know if I face any issue.

Hello @Santu1990,

What you reported is confirmed to be a bug and this is tracked as [SONAR-15974] Escape special characters on DevOps Platform Project onboarding - SonarSource. You may watch this JIRA ticket to know when it will be fixed.

Regards, Olivier