[project version] is not a valid project version. The maximum length is 100 characters

node sonar-project.js (npm run sonar) running in bitbucket pipelines
Fails with error:

INFO: Project root configuration file: NONE
INFO: SonarScanner
INFO: Java 17.0.7 Eclipse Adoptium (64-bit)
INFO: Linux 5.15.0-1056-aws amd64
INFO: Bitbucket Cloud Pipelines detected, no host variable set. Defaulting to sonarcloud.io.
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.269s
INFO: Final Memory: 6M/30M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: "[Redacted long branch name]" is not a valid project version. The maximum length is 100 characters.
    err = new Error(msg);
Error: Command failed: /root/.sonar/native-sonar-scanner/sonar-scanner- --from=ScannerNpm/3.3.0
    at checkExecSyncError (node:child_process:828:11)
    at execFileSync (node:child_process:866:15)
    at scan (/opt/atlassian/pipelines/agent/build/node_modules/sonarqube-scanner/src/index.js:40:3)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  status: 2,
  signal: null,
  output: [ null, null, null ],
  pid: 136,
  stdout: null,
  stderr: null

Our project names consist of the name of the branch + the release version and so can often exceed 100 characters, we would like to increase this limit. Is this possible?
Thanks :slight_smile:


This is not about your project name, it’s about the string you pass in to sonar.projectVersion. Do you really need your long branch name in the version? I suggest just using the release version here.