SonarQube GitLab Scan Upload report 403 Forbidden

Must-share information (formatted with Markdown):

  • which versions are you using: SonarQube (Community Edition v10.5.1), Scanner Version (5.0.1)

  • how is SonarQube deployed: Helm on EKS Cluster (1.25)

  • what are you trying to achieve: I have a self managed GitLab, I need to do integration with SonarQube and enable code scanning. The SonarQube is also self managed. When scan initiates on GitLab runner, it’s able to hit SonarQube URL and initial GET calls succeeds with 200 response code. It gives 403 Forbidden while trying to upload scan results. Later it says You're not authorized to analyze this project or the project doesn't exist on SonarQube and you're not authorized to create it. Please contact an administrator.

  • what have you tried so far to achieve this: I am doing it as admin & I gave all permissions to all users reference. I tried doing it as Local Runner as well but it fails with same error. I have project created already on SonarQube. Can someone help me fixing this please, TIA.

Below are the logs:

bash-4.2$ sonar-scanner   -Dsonar.projectKey=test-project   -Dsonar.sources=. -Dsonar.host.url=http://<sonarqube-internal-url>   -Dsonar.token=sqp_87c026032672aa07b486b9375ec64b249b8e8527 -X
07:47:23.624 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
07:47:23.639 INFO: Project root configuration file: NONE
07:47:23.667 INFO: SonarScanner 5.0.1.3006
07:47:23.668 INFO: Java 17.0.7 Eclipse Adoptium (64-bit)
07:47:23.668 INFO: Linux 5.10.167-147.601.amzn2.x86_64 amd64
07:47:23.800 DEBUG: keyStore is :07:47:23.801 DEBUG: keyStore type is : pkcs12
07:47:23.801 DEBUG: keyStore provider is :
07:47:23.801 DEBUG: init keystore
07:47:23.801 DEBUG: init keymanager of type SunX509
07:47:23.898 DEBUG: Create: /home/gitlab-runner/.sonar/cache
07:47:23.899 INFO: User cache: /home/gitlab-runner/.sonar/cache
07:47:23.899 DEBUG: Create: /home/gitlab-runner/.sonar/cache/_tmp
07:47:23.901 DEBUG: Extract sonar-scanner-api-batch in temp...
07:47:23.904 DEBUG: Get bootstrap index...
07:47:23.904 DEBUG: Download: http://<sonarqube-internal-url>/batch/index
07:47:23.974 DEBUG: Get bootstrap completed
07:47:23.976 DEBUG: Create isolated classloader...
07:47:23.984 DEBUG: Start temp cleaning...
07:47:23.986 DEBUG: Temp cleaning done
07:47:23.986 DEBUG: Execution getVersion
07:47:23.999 INFO: Analyzing on SonarQube server 10.5.1.90531
07:47:23.999 INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
07:47:24.000 DEBUG: Work directory: /home/gitlab-runner/.scannerwork
07:47:24.001 DEBUG: Execution execute
07:47:24.284 DEBUG: Community 10.5.1.90531
07:47:24.488 INFO: Load global settings
07:47:24.553 DEBUG: GET 200 http://<sonarqube-internal-url>/api/settings/values.protobuf | time=63ms
07:47:24.581 INFO: Load global settings (done) | time=92ms
07:47:24.597 INFO: Server id: EA0D0566-AY52sOjAULbXXOVQlgzW
07:47:24.601 INFO: User cache: /home/gitlab-runner/.sonar/cache
07:47:24.607 INFO: Loading required plugins
07:47:24.608 INFO: Load plugins index
07:47:24.626 DEBUG: GET 200 http://<sonarqube-internal-url>/api/plugins/installed | time=18ms
07:47:24.653 INFO: Load plugins index (done) | time=45ms
07:47:24.654 INFO: Load/download plugins
07:47:24.708 INFO: Load/download plugins (done) | time=55ms
07:47:24.709 DEBUG: Plugins not loaded because they are optional: [csharp, flex, go, web, java, javascript, kotlin, php, ruby, sonarscala, vbnet]
07:47:24.725 DEBUG: Plugins loaded:
07:47:24.726 DEBUG:   * Python Code Quality and Security 4.17.0.14845 (python)
07:47:24.726 DEBUG:   * Clean as You Code 2.3.0.1782 (cayc)
07:47:24.726 DEBUG:   * XML Code Quality and Security 2.10.0.4108 (xml)
07:47:24.726 DEBUG:   * JaCoCo 1.3.0.1538 (jacoco)
07:47:24.726 DEBUG:   * IaC Code Quality and Security 1.27.0.9518 (iac)
07:47:24.726 DEBUG:   * Text Code Quality and Security 2.10.0.2188 (text)
07:47:24.870 DEBUG: register org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$300/0x0000000801264cb0@51e37590 with shutdown hook
07:47:24.996 INFO: Process project properties
07:47:25.005 INFO: Process project properties (done) | time=10ms
07:47:25.017 INFO: Project key: test-project
07:47:25.018 INFO: Base dir: /home/gitlab-runner
07:47:25.018 INFO: Working dir: /home/gitlab-runner/.scannerwork
07:47:25.018 DEBUG: Project global encoding: UTF-8, default locale: en_US
07:47:25.028 INFO: Load project settings for component key: 'test-project'
07:47:25.056 DEBUG: GET 200 http://<sonarqube-internal-url>/api/settings/values.protobuf?component=test-project | time=28ms
07:47:25.057 INFO: Load project settings for component key: 'test-project' (done) | time=29ms
07:47:25.078 DEBUG: Creating module hierarchy
07:47:25.078 DEBUG:   Init module 'test-project'
07:47:25.079 DEBUG:     Base dir: /home/gitlab-runner
07:47:25.079 DEBUG:     Working dir: /home/gitlab-runner/.scannerwork
07:47:25.079 DEBUG:     Module global encoding: UTF-8, default locale: en_US
07:47:25.089 INFO: Load quality profiles
07:47:25.165 DEBUG: GET 200 http://<sonarqube-internal-url>/api/qualityprofiles/search.protobuf?project=test-project | time=75ms
07:47:25.180 INFO: Load quality profiles (done) | time=91ms
07:47:25.211 WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
07:47:25.215 INFO: Load active rules
07:47:25.256 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=c15af6e4-5e16-41bb-8805-c3aa975403f2&ps=500&p=1 | time=40ms
07:47:25.378 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=ecad6568-2088-4fba-829a-af790a9bd5e2&ps=500&p=1 | time=37ms
07:47:25.423 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=b75252fd-3231-4a98-899e-87cc67d5ec13&ps=500&p=1 | time=37ms
07:47:25.444 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=d55e06e6-7d14-4db6-bed4-bae7c7cf5861&ps=500&p=1 | time=16ms
07:47:25.749 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=34d1f6ae-e139-4d5a-9a65-ce8f06369a6e&ps=500&p=1 | time=305ms
07:47:25.978 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=50dfcf9c-1416-41d6-baae-b385a8d585f2&ps=500&p=1 | time=198ms
07:47:26.041 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=90c41a9d-c1b7-4f68-8d82-fcd6ec912378&ps=500&p=1 | time=39ms
07:47:26.532 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=a3153b39-129a-4851-ade2-005ae53c4ee9&ps=500&p=1 | time=488ms
07:47:26.634 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=a3153b39-129a-4851-ade2-005ae53c4ee9&ps=500&p=2 | time=73ms
07:47:26.691 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=f0466586-4b70-426c-99c1-75af38ebd65c&ps=500&p=1 | time=54ms
07:47:26.744 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=ea2d46a5-1961-4468-a287-1a1fdd90e3f7&ps=500&p=1 | time=51ms
07:47:26.817 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=d4421fef-7274-46f6-9a23-0e083a122e4c&ps=500&p=1 | time=71ms
07:47:26.831 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=0ef84178-9874-49ec-a298-29caa00c5799&ps=500&p=1 | time=12ms
07:47:26.850 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=85876397-82a7-4206-927c-a18729fc2452&ps=500&p=1 | time=19ms
07:47:26.972 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=caa30143-ab7a-416c-ade3-4ab6ce7ffc48&ps=500&p=1 | time=122ms
07:47:27.023 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=09047a26-ea6a-474f-b99d-5c0676efe5f7&ps=500&p=1 | time=46ms
07:47:27.036 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=ee997ae9-4c61-47ac-8066-e73e607bbbe9&ps=500&p=1 | time=11ms
07:47:27.069 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=971bfac6-c507-4be6-918b-d9668baeb049&ps=500&p=1 | time=33ms
07:47:27.188 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=285484b1-7b8c-40e6-80f9-1446241d80b4&ps=500&p=1 | time=117ms
07:47:27.265 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=c9edad28-ae44-415e-8620-fe14fc43a76e&ps=500&p=1 | time=73ms
07:47:27.296 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=9f054845-b6d8-4fbc-bfeb-72d37066277a&ps=500&p=1 | time=28ms
07:47:27.503 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=6a69d504-bba6-40ff-8df7-ba4ca882511d&ps=500&p=1 | time=205ms
07:47:27.627 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=3e776566-53e3-425a-ae6a-6a0df7b0adf0&ps=500&p=1 | time=117ms
07:47:27.686 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=b367d13c-0d0a-4b08-8984-8d643548d4ff&ps=500&p=1 | time=54ms
07:47:27.722 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=962ab368-2772-494b-8fed-a478746b805d&ps=500&p=1 | time=34ms
07:47:27.973 DEBUG: GET 200 http://<sonarqube-internal-url>/api/rules/list.protobuf?qprofile=65f65a56-02b5-41cf-b77c-d311e7a07061&ps=500&p=1 | time=250ms
07:47:27.992 INFO: Load active rules (done) | time=2777ms
07:47:27.998 INFO: Load analysis cache
07:47:28.011 DEBUG: GET 404 http://<sonarqube-internal-url>/api/analysis_cache/get?project=test-project | time=13ms
07:47:28.012 INFO: Load analysis cache (404) | time=14ms
07:47:28.055 DEBUG: GET 200 http://<sonarqube-internal-url>/api/languages/list | time=18ms
07:47:28.085 DEBUG: Declared patterns of language Kubernetes were converted to sonar.lang.patterns.kubernetes :
07:47:28.086 DEBUG: Declared patterns of language CSS were converted to sonar.lang.patterns.css : **/*.css,**/*.less,**/*.scss,**/*.sass
07:47:28.086 DEBUG: Declared patterns of language Scala were converted to sonar.lang.patterns.scala : **/*.scala
07:47:28.087 DEBUG: Declared patterns of language JSP were converted to sonar.lang.patterns.jsp : **/*.jsp,**/*.jspf,**/*.jspx
07:47:28.087 DEBUG: Declared patterns of language JavaScript were converted to sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.cjs,**/*.mjs,**/*.vue
07:47:28.087 DEBUG: Declared patterns of language Python were converted to sonar.lang.patterns.py : **/*.py
07:47:28.088 DEBUG: Declared patterns of language Docker were converted to sonar.lang.patterns.docker : **/Dockerfile,**/*.dockerfile
07:47:28.088 DEBUG: Declared patterns of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
07:47:28.088 DEBUG: Declared patterns of language HTML were converted to sonar.lang.patterns.web : **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml,**/*.cmp,**/*.twig
07:47:28.089 DEBUG: Declared patterns of language Flex were converted to sonar.lang.patterns.flex : **/*.as
07:47:28.089 DEBUG: Declared patterns of language XML were converted to sonar.lang.patterns.xml : **/*.xml,**/*.xsd,**/*.xsl,**/*.config
07:47:28.089 DEBUG: Declared patterns of language JSON were converted to sonar.lang.patterns.json : **/*.json
07:47:28.089 DEBUG: Declared patterns of language Text were converted to sonar.lang.patterns.text :
07:47:28.090 DEBUG: Declared patterns of language VB.NET were converted to sonar.lang.patterns.vbnet : **/*.vb
07:47:28.090 DEBUG: Declared patterns of language CloudFormation were converted to sonar.lang.patterns.cloudformation :
07:47:28.090 DEBUG: Declared patterns of language YAML were converted to sonar.lang.patterns.yaml : **/*.yaml,**/*.yml
07:47:28.090 DEBUG: Declared patterns of language Go were converted to sonar.lang.patterns.go : **/*.go
07:47:28.091 DEBUG: Declared patterns of language Kotlin were converted to sonar.lang.patterns.kotlin : **/*.kt,**/*.kts
07:47:28.091 DEBUG: Declared patterns of language Secrets were converted to sonar.lang.patterns.secrets :
07:47:28.091 DEBUG: Declared patterns of language Ruby were converted to sonar.lang.patterns.ruby : **/*.rb
07:47:28.091 DEBUG: Declared patterns of language C# were converted to sonar.lang.patterns.cs : **/*.cs,**/*.razor
07:47:28.092 DEBUG: Declared patterns of language PHP were converted to sonar.lang.patterns.php : **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
07:47:28.092 DEBUG: Declared patterns of language Terraform were converted to sonar.lang.patterns.terraform : **/*.tf
07:47:28.092 DEBUG: Declared patterns of language AzureResourceManager were converted to sonar.lang.patterns.azureresourcemanager : **/*.bicep
07:47:28.093 DEBUG: Declared patterns of language TypeScript were converted to sonar.lang.patterns.ts : **/*.ts,**/*.tsx,**/*.cts,**/*.mts
07:47:28.111 INFO: Preprocessing files...
07:47:28.145 INFO: 1 language detected in 10 preprocessed files
07:47:28.147 INFO: Loading plugins for detected languages
07:47:28.148 DEBUG: Detected languages: [py]
07:47:28.148 INFO: Load/download plugins
07:47:28.148 INFO: Load/download plugins (done) | time=0ms
07:47:28.149 DEBUG: Optional language-specific plugins not loaded: [csharp, flex, go, web, java, javascript, kotlin, php, ruby, sonarscala, vbnet]
07:47:28.150 DEBUG: No plugins loaded
07:47:28.184 INFO: Inconsistent constructor declaration on bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@32d2fa64-org.sonar.scanner.issue.IssueFilters': single autowire-marked constructor flagged as optional - this constructor is effectively required since there is no default constructor to fall back to: public org.sonar.scanner.issue.IssueFilters(org.sonar.api.batch.fs.internal.DefaultInputProject)
07:47:28.201 INFO: Load project repositories
07:47:28.218 DEBUG: GET 200 http://<sonarqube-internal-url>/batch/project.protobuf?key=test-project | time=16ms
07:47:28.223 INFO: Load project repositories (done) | time=22ms
07:47:28.236 DEBUG: Available languages:
07:47:28.237 DEBUG:   * Python => "py"
07:47:28.237 DEBUG:   * XML => "xml"
07:47:28.237 DEBUG:   * Terraform => "terraform"
07:47:28.237 DEBUG:   * CloudFormation => "cloudformation"
07:47:28.237 DEBUG:   * Kubernetes => "kubernetes"
07:47:28.237 DEBUG:   * Docker => "docker"
07:47:28.237 DEBUG:   * AzureResourceManager => "azureresourcemanager"
07:47:28.237 DEBUG:   * YAML => "yaml"
07:47:28.238 DEBUG:   * JSON => "json"
07:47:28.238 DEBUG:   * Text => "text"
07:47:28.238 DEBUG:   * Secrets => "secrets"
07:47:28.239 INFO: Indexing files...
07:47:28.239 INFO: Project configuration:
07:47:28.246 DEBUG: 'builds/Bms6RUHh/0/cicd-internal/cicd-naming-convention.tmp/git-template/config' indexed with no language
07:47:28.251 DEBUG: 'builds/Bms6RUHh/0/cicd-internal/cicd-naming-convention/README.md' indexed with no language
07:47:28.252 DEBUG: 'builds/Bms6RUHh/0/cicd-internal/cicd-naming-convention/image.png' indexed with no language
07:47:28.253 DEBUG: 'builds/Bms6RUHh/0/cicd-internal/cicd-naming-convention/scripts/gl_naming_convention.py' indexed with language 'py'
07:47:28.254 DEBUG: 'builds/Bms6RUHh/0/sonarqube-test-group/sonarqube-test-project.tmp/git-template/config' indexed with no language
07:47:28.255 DEBUG: 'builds/Bms6RUHh/0/sonarqube-test-group/sonarqube-test-project/README.md' indexed with no language
07:47:28.256 DEBUG: 'builds/Bms6RUHh/0/sonarqube-test-group/sonarqube-test-project/entrypoint.sh' indexed with no language
07:47:28.257 DEBUG: 'builds/Bms6RUHh/0/sonarqube-test-group/sonarqube-test-project/sonar-project.properties' indexed with no language
07:47:28.258 DEBUG: 'sonar-test-project/sonar_logs.txt' indexed with no language
07:47:28.258 DEBUG: 'sonar_logs.txt' indexed with no language
07:47:28.260 INFO: 10 files indexed
07:47:28.261 INFO: Quality profile for py: Sonar way
07:47:28.261 INFO: ------------- Run sensors on module test-project
07:47:28.306 INFO: Load metrics repository
07:47:28.321 DEBUG: GET 200 http://<sonarqube-internal-url>/api/metrics/search?ps=500&p=1 | time=14ms
07:47:28.330 INFO: Load metrics repository (done) | time=24ms
07:47:28.759 DEBUG: 'Import external issues report' skipped because one of the required properties is missing
07:47:28.761 DEBUG: 'Import of Pylint issues' skipped because one of the required properties is missing
07:47:28.761 DEBUG: 'Import of Bandit issues' skipped because one of the required properties is missing
07:47:28.761 DEBUG: 'Import of Flake8 issues' skipped because one of the required properties is missing
07:47:28.762 DEBUG: 'Import of Mypy issues' skipped because one of the required properties is missing
07:47:28.762 DEBUG: 'Import of Ruff issues' skipped because one of the required properties is missing
07:47:28.762 DEBUG: 'XML Sensor' skipped because there is no related file in current project
07:47:28.763 DEBUG: 'IaC Terraform Sensor' skipped because there is no related file in current project
07:47:28.763 DEBUG: 'IaC CloudFormation Sensor' skipped because there is no related file in current project
07:47:28.763 DEBUG: 'IaC Kubernetes Sensor' skipped because there is no related file in current project
07:47:28.764 DEBUG: 'IaC AzureResourceManager Sensor' skipped because there is no related file in current project
07:47:28.765 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
07:47:28.766 DEBUG: Sensors : Python Sensor -> Cobertura Sensor for Python coverage -> PythonXUnitSensor -> JaCoCo XML Report Importer -> IaC Docker Sensor -> TextAndSecretsSensor
07:47:28.767 INFO: Sensor Python Sensor [python]
07:47:28.771 WARN: Your code is analyzed as compatible with all Python 3 versions by default. You can get a more precise analysis by setting the exact Python version in your configuration via the parameter "sonar.python.version"
07:47:28.784 DEBUG: Input files for indexing: [builds/Bms6RUHh/0/cicd-internal/cicd-naming-convention/scripts/gl_naming_convention.py]
07:47:28.786 INFO: Starting global symbols computation
07:47:28.791 INFO: 1 source file to be analyzed
07:47:28.809 DEBUG: 'builds/Bms6RUHh/0/cicd-internal/cicd-naming-convention/scripts/gl_naming_convention.py' generated metadata with charset 'UTF-8'
07:47:29.291 DEBUG: Symbol _Never has conflicting fully qualified names:typing.Never,typing_extensions.Never
07:47:29.291 DEBUG: It has been disambiguated with its latest Python version available symbol.
07:47:29.346 INFO: 1/1 source file has been analyzed
07:47:29.377 INFO: Starting rules execution
07:47:29.377 INFO: 1 source file to be analyzed
07:47:29.926 INFO: 1/1 source file has been analyzed
07:47:29.927 INFO: The Python analyzer was able to leverage cached data from previous analyses for 0 out of 1 files. These files were not parsed.
07:47:29.927 INFO: Sensor Python Sensor [python] (done) | time=1161ms
07:47:29.927 INFO: Sensor Cobertura Sensor for Python coverage [python]
07:47:29.927 DEBUG: Using pattern 'coverage-reports/*coverage-*.xml' to find reports
07:47:29.948 DEBUG: No report was found for sonar.python.coverage.reportPaths using default pattern coverage-reports/*coverage-*.xml
07:47:29.948 INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=21ms
07:47:29.949 INFO: Sensor PythonXUnitSensor [python]
07:47:29.949 DEBUG: Using pattern 'xunit-reports/xunit-result-*.xml' to find reports
07:47:29.971 DEBUG: No report was found for sonar.python.xunit.reportPath using default pattern xunit-reports/xunit-result-*.xml
07:47:29.971 INFO: Sensor PythonXUnitSensor [python] (done) | time=22ms
07:47:29.971 INFO: Sensor JaCoCo XML Report Importer [jacoco]
07:47:29.973 INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
07:47:29.973 INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
07:47:29.973 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
07:47:29.974 INFO: Sensor IaC Docker Sensor [iac]
07:47:29.977 INFO: 0 source files to be analyzed
07:47:30.043 INFO: 0/0 source files have been analyzed
07:47:30.043 INFO: Sensor IaC Docker Sensor [iac] (done) | time=69ms
07:47:30.043 INFO: Sensor TextAndSecretsSensor [text]
07:47:30.044 INFO: Available processors: 4
07:47:30.044 INFO: Using 4 threads for analysis.
07:47:30.433 DEBUG: Analyzing only language associated files, "sonar.text.inclusions.activate" property is deactivated
07:47:30.442 INFO: 1 source file to be analyzed
07:47:30.567 INFO: 1/1 source file has been analyzed
07:47:30.568 INFO: Sensor TextAndSecretsSensor [text] (done) | time=525ms
07:47:30.573 INFO: ------------- Run sensors on project
07:47:30.605 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
07:47:30.605 DEBUG: 'Import external issues report from SARIF file.' skipped because one of the required properties is missing
07:47:30.605 DEBUG: 'Java CPD Block Indexer' skipped because there is no related file in current project
07:47:30.606 DEBUG: Sensors : Zero Coverage Sensor
07:47:30.606 INFO: Sensor Zero Coverage Sensor
07:47:30.615 INFO: Sensor Zero Coverage Sensor (done) | time=9ms
07:47:30.616 INFO: SCM Publisher No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
07:47:30.621 INFO: CPD Executor Calculating CPD for 1 file
07:47:30.622 DEBUG: Detection of duplications for /home/gitlab-runner/builds/Bms6RUHh/0/cicd-internal/cicd-naming-convention/scripts/gl_naming_convention.py
07:47:30.631 INFO: CPD Executor CPD calculation finished (done) | time=8ms
07:47:30.716 INFO: Analysis report generated in 76ms, dir size=231.5 kB
07:47:30.735 INFO: Analysis report compressed in 18ms, zip size=40.0 kB
07:47:30.735 INFO: Analysis report generated in /home/gitlab-runner/.scannerwork/scanner-report
07:47:30.735 DEBUG: Upload report
07:47:30.746 DEBUG: POST 403 http://<sonarqube-internal-url>/api/ce/submit?projectKey=test-project | time=10ms
07:47:30.747 DEBUG: Error response content: <html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
</body>
</html>
, headers: {connection=[keep-alive], content-length=[118], content-type=[text/html], date=[Tue, 14 May 2024 07:47:30 GMT], server=[awselb/2.0]}
07:47:30.752 INFO: ------------------------------------------------------------------------
07:47:30.752 INFO: EXECUTION FAILURE
07:47:30.753 INFO: ------------------------------------------------------------------------
07:47:30.753 INFO: Total time: 7.139s
07:47:30.827 INFO: Final Memory: 21M/94M
07:47:30.827 INFO: ------------------------------------------------------------------------
07:47:30.827 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Failed to upload report: You're not authorized to analyze this project or the project doesn't exist on SonarQube and you're not authorized to create it. Please contact an administrator.

        at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:239)
        at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:163)
        at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:181)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
        at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:351)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
        at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:138)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
        at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: You're not authorized to analyze this project or the project doesn't exist on SonarQube and you're not authorized to create it. Please contact an administrator.
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:145)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:424)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:386)
        at ch.qos.logback.classic.Logger.error(Logger.java:543)
        at org.eclipse.jgit.internal.util.ShutdownHook.cleanup(ShutdownHook.java:87)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
        at java.base/java.net.URLClassLoader.findClass(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 6 more

Hi,

Welcome to the community!

This part of your log is hinky:

SonarQube doesn’t return HTML errors at that stage in analysis (it is possible to get an HTML response at the very beginning of analysis if the sonar.host.url is off).

I suspect what’s happening is that something “helpful” on the network has blocked the POST submission of the analysis report and responded with the HTML and a 403 response code, which the scanner then interprets as

You should talk to your network folks.

 
Ann