Invalid project key with Jenkins

ERROR: Validation of project reactor failed:
o “PROJECT_NAME:bugfix/fix_code” is not a valid project or module key. Allowed characters are alphanumeric, ‘-’, ‘_’, ‘.’ and ‘:’, with at least one non-digit.

SonarScanner and SonarQube failed because of “/” slash between bugfix and fix_code

Hi @Yusuf_Kartal,

I’ve tested with a branch name with a “/” in the name and the pipeline passed : https://bitbucket.org/globalbbcteam/angularexample/addon/pipelines/home#!/results/28

Maybe it’s more the “:” in your branch that makes the pipeline fails. During my test, I created a branch directly on BitBucketCloud with the name “PROJECT_NAME:bugfix/fix_code”, and BBC removed the “:”.
Can you try without the “:” ?

HIH

Cheers

Hi @aurelie,
Thanks,
BRANCH_NAME is “bugfix/fixcode”
jenkins merge project name and branch_name as PROJECT_NAME:BRANCH_NAME so I have created a branch without / and it is working.
Maybe it is about sonarscanner/sonarqube versions. sonarqube server 7.7.0.23042 and sonarqube scanner 3.3.0.1492
We are using server versions of all applications.

Hi,

I realized I did not understand the problem. I thought it was related to BitBuckectCloud and BitBucketPipelines because you posted under the topic related to them.

Anyway, I’ve moved your topic to SonarQube, and the scanner does not accept the “/” character indeed.

If you still have issues and if you need help, I invite you to detail how you configure your analyses on Jenkins so we can help further.

Cheers,

Hi,

Sorry for wrong topic.
I have seen " Slash in branch name in PR causing an error in a BitBucket pipeline" title and replied under it. And Yes, it is the problem indeed which I met.
Branch name with slashes is not accepted by sonarscanner and sonarqube but bitbucket’s default naming model has template like “feature/…” or “bugfix/…” etc. So I think problem is not about jenkins. It is about sonarscanner and sonarqube

Thanks for your patience.

Hi @Yusuf_Kartal,

What edition of SonarQube are you using? The community or the developer (or above)?

Cheers,

  • Community Edition
  • Version 7.7 (build 23042)

Analyse of branches is available on Developer Edition or above, that’s why the scanner fails.

HIH,
Cheers