Sonarscanner upload report fails with 403 error for Master branch but successful for develop branch

Must-share information (formatted with Markdown):

which versions are you using:
SonarQube : 9.9.0
Scanner : 3.1.0.1141 & 4.8.0.2856

how is SonarQube deployed: zip

what are you trying to achieve
Using gitlab pipelines to scan the code with sonarscanner cli.

what have you tried so far to achieve this
1. Tried to upgrade sonarscanner from “3.1.0.1141” to latest “4.8.0.2856”
2. Created new token
3. Triggered gitlab pipelines for multiple branches and projects
Master branch → Failed
Feature branch over master-> Success
Develop branch → Successful

Log:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:39.198s
INFO: Final Memory: 18M/79M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: You’re not authorized to run analysis. Please contact the project administrator.
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

Are these branches that are successful old branches, or brand new branches?

Hi Colin,

Both the branches “Master” & “Develop” are old branches (created more then 2years ago)
but both of them are actively used.

I suppose what I meant to ask by that question – was if it’s possible that some newer token is being referenced for your feature/develop branch that hasn’t made its way into MASTER yet.

Can you enable DEBUG Logging and post a wider range of logs? It would be interesting to see exactly which call is failing with a 403.

Hi Colin,
There is no change in the token, Same token is used for both branches

The upload report is failing with 403

09:51:19.169 DEBUG: Upload report
09:51:19.189 DEBUG: POST 403 https://son.mysonar.com/api/ce/submit?projectKey=NONPROD%3AMS | time=19ms

Debug logs are as below

$ npx sonar-scanner -Dsonar.host.url=${SONARQUBE_URL} -Dsonar.login=${SONARQUBE_TOKEN} -Dsonar.analysis.mode=publish -Dsonar.gitlab.project_id=${CI_PROJECT_PATH} -Dsonar.gitlab.commit_sha=${CI_COMMIT_SHA} -Dsonar.gitlab.ref_name=${CI_COMMIT_REF_NAME} -Dsonar.gitlab.json_mode=SAST -Dsonar.gitlab.failure_notification_mode=exit-code -Dsonar.gitlab.only_issue_from_commit_file=true -Dsonar.gitlab.disable_inline_comments=false -Dsonar.gitlab.unique_issue_per_inline=true -Dsonar.projectKey=${SONARQUBE_PROJECT_KEY} -Dsonar.verbose=true $SONAR_OPTS
INFO: Scanner configuration file: /builds/nonprod/ms/node_modules/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
09:50:16.850 INFO: SonarQube Scanner 3.1.0.1141
09:50:16.851 INFO: Java 17.0.6 Alpine (64-bit)
09:50:16.851 INFO: Linux 4.14.186-146.268.amzn2.x86_64 amd64
09:50:17.179 DEBUG: keyStore is :
09:50:17.180 DEBUG: keyStore type is : pkcs12
09:50:17.180 DEBUG: keyStore provider is :
09:50:17.180 DEBUG: init keystore
09:50:17.180 DEBUG: init keymanager of type SunX509
09:50:17.546 DEBUG: Create: /home/node/.sonar/cache
09:50:17.548 INFO: User cache: /home/node/.sonar/cache
09:50:17.548 DEBUG: Create: /home/node/.sonar/cache/_tmp
09:50:17.552 DEBUG: Extract sonar-scanner-api-batch in temp...
09:50:17.557 DEBUG: Get bootstrap index...
09:50:17.557 DEBUG: Download: https://son.mysonar.com/batch/index
09:50:18.140 DEBUG: Get bootstrap completed
09:50:18.149 DEBUG: Download https://son.mysonar.com/batch/file?name=sonar-scanner-engine-shaded-9.9.0.65466-all.jar to /home/node/.sonar/cache/_tmp/fileCache7265120756655989664.tmp
09:50:20.437 DEBUG: Create isolated classloader...
09:50:20.457 DEBUG: Start temp cleaning...
09:50:20.463 DEBUG: Temp cleaning done
09:50:20.464 DEBUG: Execution getVersion
09:50:20.479 INFO: SonarQube server 9.9.0.65466
09:50:20.479 INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
09:50:20.480 DEBUG: Work directory: /builds/nonprod/ms/.scannerwork
09:50:20.482 DEBUG: Execution execute
09:50:21.363 DEBUG: Community 9.9.0.65466
09:50:21.854 INFO: Load global settings
09:50:22.061 DEBUG: GET 200 https://son.mysonar.com/api/settings/values.protobuf | time=206ms
09:50:22.103 INFO: Load global settings (done) | time=249ms
09:50:22.105 INFO: Server id: 471D2C80-AW2DNEB6uMlEM3Nyu7BA
09:50:22.149 DEBUG: Create : /home/node/.sonar/_tmp
09:50:22.149 INFO: User cache: /home/node/.sonar/cache
09:50:22.154 INFO: Load/download plugins
09:50:22.154 INFO: Load plugins index
09:50:22.222 DEBUG: Download plugin 'csharp' to '/home/node/.sonar/_tmp/fileCache13540527584454051396.tmp'
09:50:22.242 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=csharp | time=20ms
09:50:22.667 DEBUG: Download plugin 'config' to '/home/node/.sonar/_tmp/fileCache6504831465393784671.tmp'
09:50:22.688 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=config | time=20ms
09:50:22.691 DEBUG: Download plugin 'flex' to '/home/node/.sonar/_tmp/fileCache12982905804388890317.tmp'
09:50:22.711 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=flex | time=20ms
09:50:22.766 DEBUG: Download plugin 'go' to '/home/node/.sonar/_tmp/fileCache5380597478168059260.tmp'
09:50:22.789 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=go | time=22ms
09:50:22.961 DEBUG: Download plugin 'web' to '/home/node/.sonar/_tmp/fileCache8370515421838296592.tmp'
09:50:22.975 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=web | time=14ms
09:50:22.982 DEBUG: Download plugin 'iac' to '/home/node/.sonar/_tmp/fileCache7573257927270685203.tmp'
09:50:22.994 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=iac | time=12ms
09:50:23.055 DEBUG: Download plugin 'jacoco' to '/home/node/.sonar/_tmp/fileCache15470917962417427541.tmp'
09:50:23.066 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=jacoco | time=11ms
09:50:23.069 DEBUG: Download plugin 'java' to '/home/node/.sonar/_tmp/fileCache16569216454995996999.tmp'
09:50:23.083 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=java | time=14ms
09:50:23.401 DEBUG: Download plugin 'javascript' to '/home/node/.sonar/_tmp/fileCache16589936299123460653.tmp'
09:50:23.419 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=javascript | time=17ms
09:50:23.768 DEBUG: Download plugin 'kotlin' to '/home/node/.sonar/_tmp/fileCache16838795915847822140.tmp'
09:50:23.781 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=kotlin | time=12ms
09:50:24.459 DEBUG: Download plugin 'php' to '/home/node/.sonar/_tmp/fileCache11077301855132802857.tmp'
09:50:24.472 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=php | time=13ms
09:50:24.568 DEBUG: Download plugin 'python' to '/home/node/.sonar/_tmp/fileCache593611034561607428.tmp'
09:50:24.579 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=python | time=10ms
09:50:24.686 DEBUG: Download plugin 'ruby' to '/home/node/.sonar/_tmp/fileCache14502449065405572293.tmp'
09:50:24.697 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=ruby | time=11ms
09:50:24.953 DEBUG: Download plugin 'sonarscala' to '/home/node/.sonar/_tmp/fileCache9410793765375967072.tmp'
09:50:24.966 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=sonarscala | time=13ms
09:50:25.161 DEBUG: Download plugin 'text' to '/home/node/.sonar/_tmp/fileCache13662701299608304928.tmp'
09:50:25.171 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=text | time=10ms
09:50:25.176 DEBUG: Download plugin 'vbnet' to '/home/node/.sonar/_tmp/fileCache716924973755227139.tmp'
09:50:25.188 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=vbnet | time=12ms
09:50:25.267 DEBUG: Download plugin 'xml' to '/home/node/.sonar/_tmp/fileCache15499074833959694611.tmp'
09:50:25.278 DEBUG: GET 200 https://son.mysonar.com/api/plugins/download?plugin=xml | time=11ms
09:50:25.298 INFO: Load/download plugins (done) | time=3145ms
09:50:25.572 DEBUG: Plugins:
09:50:25.572 DEBUG:   * Python Code Quality and Security 3.24.0.10784 (python)
09:50:25.572 DEBUG:   * Go Code Quality and Security 1.11.0.3905 (go)
09:50:25.572 DEBUG:   * JaCoCo 1.3.0.1538 (jacoco)
09:50:25.573 DEBUG:   * Kotlin Code Quality and Security 2.12.0.1956 (kotlin)
09:50:25.573 DEBUG:   * IaC Code Quality and Security 1.11.0.2847 (iac)
09:50:25.573 DEBUG:   * JavaScript/TypeScript/CSS Code Quality and Security 9.13.0.20537 (javascript)
09:50:25.573 DEBUG:   * Ruby Code Quality and Security 1.11.0.3905 (ruby)
09:50:25.573 DEBUG:   * Scala Code Quality and Security 1.11.0.3905 (sonarscala)
09:50:25.573 DEBUG:   * C# Code Quality and Security 8.51.0.59060 (csharp)
09:50:25.573 DEBUG:   * Java Code Quality and Security 7.16.0.30901 (java)
09:50:25.574 DEBUG:   * HTML Code Quality and Security 3.7.1.3306 (web)
09:50:25.574 DEBUG:   * Flex Code Quality and Security 2.8.0.3166 (flex)
09:50:25.574 DEBUG:   * XML Code Quality and Security 2.7.0.3820 (xml)
09:50:25.574 DEBUG:   * PHP Code Quality and Security 3.27.1.9352 (php)
09:50:25.574 DEBUG:   * Text Code Quality and Security 2.0.1.611 (text)
09:50:25.574 DEBUG:   * VB.NET Code Quality and Security 8.51.0.59060 (vbnet)
09:50:25.574 DEBUG:   * Configuration detection fot Code Quality and Security 1.2.0.267 (config)
09:50:27.097 INFO: Process project properties
09:50:27.155 INFO: Process project properties (done) | time=58ms
09:50:27.158 INFO: Execute project builders
09:50:27.158 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
09:50:27.159 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
09:50:27.160 INFO: Execute project builders (done) | time=2ms
09:50:27.165 INFO: Project key: NONPROD:MS
09:50:27.165 INFO: Base dir: /builds/nonprod/ms
09:50:27.165 INFO: Working dir: /builds/nonprod/ms/.scannerwork
09:50:27.166 DEBUG: Project global encoding: UTF-8, default locale: en_US
09:50:27.178 INFO: Load project settings for component key: 'NONPROD:MS'
09:50:27.208 DEBUG: GET 200 https://son.mysonar.com/api/settings/values.protobuf?component=NONPROD%3AMS | time=30ms
09:50:27.211 INFO: Load project settings for component key: 'NONPROD:MS' (done) | time=33ms
09:50:27.476 DEBUG: Creating module hierarchy
09:50:27.476 DEBUG:   Init module 'NONPROD:MS'
09:50:27.477 DEBUG:     Base dir: /builds/nonprod/ms
09:50:27.477 DEBUG:     Working dir: /builds/nonprod/ms/.scannerwork
09:50:27.478 DEBUG:     Module global encoding: UTF-8, default locale: en_US
09:50:27.559 DEBUG: Available languages:
09:50:27.560 DEBUG:   * Python => "py"
09:50:27.560 DEBUG:   * Go => "go"
09:50:27.561 DEBUG:   * Kotlin => "kotlin"
09:50:27.561 DEBUG:   * Terraform => "terraform"
09:50:27.561 DEBUG:   * CloudFormation => "cloudformation"
09:50:27.561 DEBUG:   * Kubernetes => "kubernetes"
09:50:27.561 DEBUG:   * Docker => "docker"
09:50:27.561 DEBUG:   * JavaScript => "js"
09:50:27.561 DEBUG:   * TypeScript => "ts"
09:50:27.561 DEBUG:   * CSS => "css"
09:50:27.562 DEBUG:   * Ruby => "ruby"
09:50:27.562 DEBUG:   * Scala => "scala"
09:50:27.562 DEBUG:   * C# => "cs"
09:50:27.562 DEBUG:   * Java => "java"
09:50:27.562 DEBUG:   * HTML => "web"
09:50:27.562 DEBUG:   * JSP => "jsp"
09:50:27.562 DEBUG:   * Flex => "flex"
09:50:27.563 DEBUG:   * XML => "xml"
09:50:27.563 DEBUG:   * PHP => "php"
09:50:27.563 DEBUG:   * Text => "text"
09:50:27.563 DEBUG:   * Secrets => "secrets"
09:50:27.563 DEBUG:   * VB.NET => "vbnet"
09:50:27.563 DEBUG:   * YAML => "yaml"
09:50:27.563 DEBUG:   * JSON => "json"
09:50:27.704 INFO: Auto-configuring with CI 'Gitlab CI'
09:50:27.707 INFO: Load quality profiles
09:50:27.787 DEBUG: GET 200 https://son.mysonar.com/api/qualityprofiles/search.protobuf?project=NONPROD%3AMS | time=42ms
09:50:27.853 INFO: Load quality profiles (done) | time=146ms
09:50:27.863 INFO: Load active rules
09:50:27.891 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxiZ4y2DOd6K5dDUY&ps=500&p=1 | time=27ms
09:50:28.246 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXnnsJ43z0FHp6WmrEG_&ps=500&p=1 | time=66ms
09:50:28.290 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNMoruMlEM3Nyu8eW&ps=500&p=1 | time=31ms
09:50:28.346 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNMv2uMlEM3Nyu8hf&ps=500&p=1 | time=45ms
09:50:28.383 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXnnsJ_gz0FHp6WmrEJ9&ps=500&p=1 | time=36ms
09:50:28.451 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXnnsJ8cz0FHp6WmrEIj&ps=500&p=1 | time=59ms
09:50:28.571 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNM37uMlEM3Nyu8ni&ps=500&p=1 | time=97ms
09:50:28.698 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNNJAuMlEM3Nyu8ug&ps=500&p=1 | time=87ms
09:50:28.757 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxjYcy2DOd6K5dDfc&ps=500&p=1 | time=32ms
09:50:28.788 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxjZ_y2DOd6K5dDf0&ps=500&p=1 | time=30ms
09:50:28.851 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXnnsKNfz0FHp6WmrEUh&ps=500&p=1 | time=61ms
09:50:28.950 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNMMuuMlEM3Nyu8Kw&ps=500&p=1 | time=94ms
09:50:29.136 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNMcquMlEM3Nyu8W2&ps=500&p=1 | time=166ms
09:50:29.201 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNMlPuMlEM3Nyu8db&ps=500&p=1 | time=35ms
09:50:29.246 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXnnsKffz0FHp6WmrEeu&ps=500&p=1 | time=43ms
09:50:29.281 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXnnsKdKz0FHp6WmrEc8&ps=500&p=1 | time=33ms
09:50:29.297 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxj5Xy2DOd6K5dDj3&ps=500&p=1 | time=14ms
09:50:29.386 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DNM9JuMlEM3Nyu8q0&ps=500&p=1 | time=88ms
09:50:29.455 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxkHCy2DOd6K5dDoX&ps=500&p=1 | time=61ms
09:50:29.480 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxkIGy2DOd6K5dDpM&ps=500&p=1 | time=23ms
09:50:29.541 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXnnsKmnz0FHp6WmrElj&ps=500&p=1 | time=60ms
09:50:29.577 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxkNwy2DOd6K5dDqd&ps=500&p=1 | time=32ms
09:50:29.649 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW2DYJpKuMlEM3Nyu85M&ps=500&p=1 | time=71ms
09:50:29.671 DEBUG: GET 200 https://son.mysonar.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AYaHxkOwy2DOd6K5dDq5&ps=500&p=1 | time=16ms
09:50:29.699 INFO: Load active rules (done) | time=1836ms
09:50:29.705 INFO: Load analysis cache
09:50:29.745 DEBUG: GET 404 https://son.mysonar.com/api/analysis_cache/get?project=NONPROD:MS | time=39ms
09:50:29.747 INFO: Load analysis cache (404) | time=42ms
09:50:29.955 INFO: Load project repositories
09:50:29.977 DEBUG: GET 200 https://son.mysonar.com/batch/project.protobuf?key=NONPROD%3AMS | time=21ms
09:50:29.986 INFO: Load project repositories (done) | time=31ms
.
.
.
.

09:51:18.678 INFO: CPD Executor CPD calculation finished (done) | time=106ms
09:51:18.686 DEBUG: SCM revision ID '91865d7655f72466f65d7314d24fcc6c682d853c'
09:51:18.954 INFO: Analysis report generated in 210ms, dir size=650.6 kB
09:51:19.169 INFO: Analysis report compressed in 214ms, zip size=340.4 kB
09:51:19.169 INFO: Analysis report generated in /builds/nonprod/ms/.scannerwork/scanner-report
09:51:19.169 DEBUG: Upload report
09:51:19.189 DEBUG: POST 403 https://son.mysonar.com/api/ce/submit?projectKey=NONPROD%3AMS | time=19ms
09:51:19.252 DEBUG: eslint-bridge server will shutdown
09:51:24.254 DEBUG: eslint-bridge server closed
09:51:25.366 INFO: ------------------------------------------------------------------------
09:51:25.366 INFO: EXECUTION FAILURE
09:51:25.366 INFO: ------------------------------------------------------------------------
09:51:25.366 INFO: Total time: 1:08.603s
09:51:25.452 ERROR: Error during SonarQube Scanner execution
09:51:25.452 ERROR: Failed to upload report: You're not authorized to run analysis. Please contact the project administrator.
09:51:25.452 ERROR: Caused by: You're not authorized to run analysis. Please contact the project administrator.
09:51:25.452 ERROR:
09:51:25.452 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
09:51:25.452 INFO: Final Memory: 18M/96M
09:51:25.452 INFO: ------------------------------------------------------------------------

I would first suggest seeing if you can find the 403 in your SonarQube server’s access logs (the access.log file in the logs folder of your SonarQube installation – sometimes a 403 can be returned by something in the middle (like a Web Application Firewall in front of your SonarQube server)

Sorry for delay.

After analysing all the rules in between the runner and sonarqube.
I dont see any which can send 403.

Also the fact that one branch is successful and another is a failure.
I dont feel that this is due to firewall or Loadbalancer.

I feel, after the upgrade of sonarqube from 8.9.10 LTS to 9.9.0 LTS there could be some issue with the project state or some internal permission.

ps:
The scan is successful If we use a new projectkey

Then I would return to this question: