Unauthorized to run analysis while being admin?

Hi there :wave: !

I’m facing an issue and even if I tried to deleted and re-create from scratch my environment I’m always facing the same result “Caused by: You’re not authorized to run analysis. Please contact the project administrator.”

I was on SonarQube 8.3 with the latest SonarScanner and I faced the issue several weeks ago. Everything was fine before that.
I guessed that I changed something and tried to rollback my configuration with a previous backup and it was the same result : “No longer authorized”.

I then tried to upgrade with the latest version : 8.9 and re-install the SonarScanner and yet. The same issue came back.

I tried to change the method, using the maven plugin directly and you guess it : same result.

Today I tried to wipe everything to the ground and re build from scratch while using a Docker environment for the SonarScanner (image version : sonarsource/sonar-scanner-cli:4.6) : the idea was to avoid cache issues or missing configurations.
Again, same issue… I also tried to delete the data folder without result.

I’m a bit lost at the moment and can’t figure out what I’m missing because I gave me the “sonar-administrators” role and granted the “Execute Analysis” checkbox as well :thinking: .

For information, I’m using the GitLab OAuth2 login system with the AML Integration. I’ve tried to enable and disable it without change about my current issue.

Here is the full debug output of the SonarScanner :

20:33:09.205  + sonar-scanner -X '-Dsonar.qualitygate.wait=true' '-Dsonar.login=****' '-Dsonar.projectKey=php_core' '-Dsonar.projectName=PHP - Core'
20:33:09.205  18:33:09.070 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
20:33:09.205  18:33:09.072 INFO: Project root configuration file: /home/jenkins/agent/workspace/(sonar) php-core/sonar-project.properties
20:33:09.205  18:33:09.136 INFO: SonarScanner 4.6.2.2472
20:33:09.205  18:33:09.136 INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
20:33:09.206  18:33:09.136 INFO: Linux 4.19.0-16-amd64 amd64
20:33:09.469  18:33:09.441 DEBUG: keyStore is : 
20:33:09.470  18:33:09.441 DEBUG: keyStore type is : pkcs12
20:33:09.470  18:33:09.441 DEBUG: keyStore provider is : 
20:33:09.470  18:33:09.441 DEBUG: init keystore
20:33:09.470  18:33:09.441 DEBUG: init keymanager of type SunX509
20:33:10.056  18:33:09.754 DEBUG: Create: /opt/sonar-scanner/.sonar/cache
20:33:10.056  18:33:09.755 INFO: User cache: /opt/sonar-scanner/.sonar/cache
20:33:10.056  18:33:09.755 DEBUG: Create: /opt/sonar-scanner/.sonar/cache/_tmp
20:33:10.056  18:33:09.815 DEBUG: Extract sonar-scanner-api-batch in temp...
20:33:10.056  18:33:09.821 DEBUG: Get bootstrap index...
20:33:10.056  18:33:09.821 DEBUG: Download: https://sonar.private-domain.tld/batch/index
20:33:10.647  18:33:10.527 DEBUG: Get bootstrap completed
20:33:10.647  18:33:10.533 DEBUG: Download https://sonar.private-domain.tld/batch/file?name=sonar-scanner-engine-shaded-8.9.0.43852-all.jar to /opt/sonar-scanner/.sonar/cache/_tmp/fileCache15263814983777243189.tmp
20:33:13.230  18:33:13.165 DEBUG: Create isolated classloader...
20:33:13.230  18:33:13.173 DEBUG: Start temp cleaning...
20:33:13.230  18:33:13.177 DEBUG: Temp cleaning done
20:33:13.230  18:33:13.178 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
20:33:13.230  18:33:13.178 INFO: Project root configuration file: /home/jenkins/agent/workspace/(sonar) php-core/sonar-project.properties
20:33:13.230  18:33:13.179 DEBUG: Execution getVersion
20:33:13.230  18:33:13.223 INFO: Analyzing on SonarQube server 8.9.0
20:33:13.230  18:33:13.224 INFO: Default locale: "en_US", source code encoding: "UTF-8"
20:33:13.230  18:33:13.225 DEBUG: Work directory: /home/jenkins/agent/workspace/(sonar) php-core/.scannerwork
20:33:13.230  18:33:13.226 DEBUG: Execution execute
20:33:13.833  18:33:13.742 DEBUG: Community 8.9.0.43852
20:33:14.098  18:33:14.031 INFO: Load global settings
20:33:14.365  18:33:14.222 DEBUG: GET 200 https://sonar.private-domain.tld/api/settings/values.protobuf | time=190ms
20:33:14.365  18:33:14.256 INFO: Load global settings (done) | time=225ms
20:33:14.365  18:33:14.258 INFO: Server id: 1B645EDF-AXndEfFVuK-1u86-sDJj
20:33:14.365  18:33:14.261 DEBUG: Create : /opt/sonar-scanner/.sonar/_tmp
20:33:14.365  18:33:14.261 INFO: User cache: /opt/sonar-scanner/.sonar/cache
20:33:14.365  18:33:14.264 INFO: Load/download plugins
20:33:14.365  18:33:14.264 INFO: Load plugins index
20:33:14.365  18:33:14.273 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/installed | time=9ms
20:33:14.365  18:33:14.355 INFO: Load plugins index (done) | time=91ms
20:33:14.633  18:33:14.415 DEBUG: Download plugin 'csharp' to '/opt/sonar-scanner/.sonar/_tmp/fileCache15766904428221604196.tmp'
20:33:14.633  18:33:14.423 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=csharp&acceptCompressions=pack200 | time=8ms
20:33:15.221  18:33:14.952 DEBUG: Download plugin 'cssfamily' to '/opt/sonar-scanner/.sonar/_tmp/fileCache4494497155484093372.tmp'
20:33:15.221  18:33:14.958 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=cssfamily&acceptCompressions=pack200 | time=6ms
20:33:15.795  18:33:15.534 DEBUG: Download plugin 'flex' to '/opt/sonar-scanner/.sonar/_tmp/fileCache7646330844741381923.tmp'
20:33:15.795  18:33:15.540 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=flex&acceptCompressions=pack200 | time=6ms
20:33:15.795  18:33:15.620 DEBUG: Download plugin 'go' to '/opt/sonar-scanner/.sonar/_tmp/fileCache8550557597952853859.tmp'
20:33:15.795  18:33:15.626 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=go&acceptCompressions=pack200 | time=6ms
20:33:16.062  18:33:15.953 DEBUG: Download plugin 'web' to '/opt/sonar-scanner/.sonar/_tmp/fileCache12364835929365339686.tmp'
20:33:16.062  18:33:15.958 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=web&acceptCompressions=pack200 | time=5ms
20:33:16.062  18:33:16.023 DEBUG: Download plugin 'jacoco' to '/opt/sonar-scanner/.sonar/_tmp/fileCache10117499921676056794.tmp'
20:33:16.062  18:33:16.027 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=jacoco&acceptCompressions=pack200 | time=4ms
20:33:16.062  18:33:16.032 DEBUG: Download plugin 'java' to '/opt/sonar-scanner/.sonar/_tmp/fileCache2043219419119199133.tmp'
20:33:16.062  18:33:16.039 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=java&acceptCompressions=pack200 | time=7ms
20:33:17.019  18:33:16.752 DEBUG: Download plugin 'javascript' to '/opt/sonar-scanner/.sonar/_tmp/fileCache6490346124571858553.tmp'
20:33:17.020  18:33:16.758 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=javascript&acceptCompressions=pack200 | time=6ms
20:33:17.968  18:33:17.612 DEBUG: Download plugin 'kotlin' to '/opt/sonar-scanner/.sonar/_tmp/fileCache4914831269396871912.tmp'
20:33:17.968  18:33:17.617 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=kotlin&acceptCompressions=pack200 | time=5ms
20:33:17.968  18:33:17.886 DEBUG: Download plugin 'php' to '/opt/sonar-scanner/.sonar/_tmp/fileCache2606973299255007491.tmp'
20:33:17.968  18:33:17.891 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=php&acceptCompressions=pack200 | time=5ms
20:33:18.233  18:33:18.067 DEBUG: Download plugin 'python' to '/opt/sonar-scanner/.sonar/_tmp/fileCache9194785364525171382.tmp'
20:33:18.233  18:33:18.072 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=python&acceptCompressions=pack200 | time=5ms
20:33:18.233  18:33:18.193 DEBUG: Download plugin 'ruby' to '/opt/sonar-scanner/.sonar/_tmp/fileCache2575341478197595373.tmp'
20:33:18.233  18:33:18.198 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=ruby&acceptCompressions=pack200 | time=5ms
20:33:18.808  18:33:18.617 DEBUG: Download plugin 'sonarscala' to '/opt/sonar-scanner/.sonar/_tmp/fileCache2625299265854818521.tmp'
20:33:18.808  18:33:18.623 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=sonarscala&acceptCompressions=pack200 | time=5ms
20:33:19.086  18:33:19.063 DEBUG: Download plugin 'vbnet' to '/opt/sonar-scanner/.sonar/_tmp/fileCache1944803973974478851.tmp'
20:33:19.086  18:33:19.068 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=vbnet&acceptCompressions=pack200 | time=5ms
20:33:19.351  18:33:19.246 DEBUG: Download plugin 'xml' to '/opt/sonar-scanner/.sonar/_tmp/fileCache6556951781862037354.tmp'
20:33:19.351  18:33:19.253 DEBUG: GET 200 https://sonar.private-domain.tld/api/plugins/download?plugin=xml&acceptCompressions=pack200 | time=7ms
20:33:19.351  18:33:19.340 INFO: Load/download plugins (done) | time=5077ms
20:33:19.623  18:33:19.463 DEBUG: Plugins:
20:33:19.623  18:33:19.463 DEBUG:   * Python Code Quality and Security 3.4.1.8066 (python)
20:33:19.623  18:33:19.463 DEBUG:   * CSS Code Quality and Security 1.4.2.2002 (cssfamily)
20:33:19.623  18:33:19.463 DEBUG:   * Go Code Quality and Security 1.8.3.2219 (go)
20:33:19.623  18:33:19.463 DEBUG:   * JaCoCo 1.1.1.1157 (jacoco)
20:33:19.623  18:33:19.463 DEBUG:   * Kotlin Code Quality and Security 1.8.3.2219 (kotlin)
20:33:19.623  18:33:19.463 DEBUG:   * JavaScript/TypeScript Code Quality and Security 7.4.2.15501 (javascript)
20:33:19.623  18:33:19.463 DEBUG:   * Ruby Code Quality and Security 1.8.3.2219 (ruby)
20:33:19.623  18:33:19.463 DEBUG:   * Scala Code Quality and Security 1.8.3.2219 (sonarscala)
20:33:19.623  18:33:19.463 DEBUG:   * C# Code Quality and Security 8.22.0.31243 (csharp)
20:33:19.623  18:33:19.464 DEBUG:   * Java Code Quality and Security 6.15.1.26025 (java)
20:33:19.623  18:33:19.464 DEBUG:   * HTML Code Quality and Security 3.4.0.2754 (web)
20:33:19.623  18:33:19.464 DEBUG:   * Flex Code Quality and Security 2.6.1.2564 (flex)
20:33:19.623  18:33:19.464 DEBUG:   * XML Code Quality and Security 2.2.0.2973 (xml)
20:33:19.623  18:33:19.464 DEBUG:   * PHP Code Quality and Security 3.17.0.7439 (php)
20:33:19.623  18:33:19.464 DEBUG:   * VB.NET Code Quality and Security 8.22.0.31243 (vbnet)
20:33:20.582  18:33:20.419 INFO: Process project properties
20:33:20.582  18:33:20.429 INFO: Process project properties (done) | time=10ms
20:33:20.582  18:33:20.430 INFO: Execute project builders
20:33:20.582  18:33:20.430 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
20:33:20.582  18:33:20.431 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
20:33:20.582  18:33:20.431 INFO: Execute project builders (done) | time=1ms
20:33:20.582  18:33:20.434 INFO: Project key: php_core
20:33:20.582  18:33:20.435 INFO: Base dir: /home/jenkins/agent/workspace/(sonar) php-core
20:33:20.582  18:33:20.435 INFO: Working dir: /home/jenkins/agent/workspace/(sonar) php-core/.scannerwork
20:33:20.582  18:33:20.435 DEBUG: Project global encoding: UTF-8, default locale: en_US
20:33:20.582  18:33:20.436 DEBUG: Creating module hierarchy
20:33:20.582  18:33:20.436 DEBUG:   Init module 'PHP - Core'
20:33:20.582  18:33:20.436 DEBUG:     Base dir: /home/jenkins/agent/workspace/(sonar) php-core
20:33:20.582  18:33:20.436 DEBUG:     Working dir: /home/jenkins/agent/workspace/(sonar) php-core/.scannerwork
20:33:20.582  18:33:20.436 DEBUG:     Module global encoding: UTF-8, default locale: en_US
20:33:20.847  18:33:20.729 INFO: Load project settings for component key: 'php_core'
20:33:20.847  18:33:20.735 DEBUG: GET 404 https://sonar.private-domain.tld/api/settings/values.protobuf?component=php_core | time=6ms
20:33:20.847  18:33:20.824 DEBUG: Available languages:
20:33:20.847  18:33:20.824 DEBUG:   * Python => "py"
20:33:20.847  18:33:20.825 DEBUG:   * CSS => "css"
20:33:20.847  18:33:20.825 DEBUG:   * Go => "go"
20:33:20.847  18:33:20.825 DEBUG:   * Kotlin => "kotlin"
20:33:20.847  18:33:20.825 DEBUG:   * JavaScript => "js"
20:33:20.847  18:33:20.825 DEBUG:   * TypeScript => "ts"
20:33:20.847  18:33:20.825 DEBUG:   * Ruby => "ruby"
20:33:20.847  18:33:20.825 DEBUG:   * Scala => "scala"
20:33:20.847  18:33:20.825 DEBUG:   * C# => "cs"
20:33:20.847  18:33:20.825 DEBUG:   * Java => "java"
20:33:20.847  18:33:20.825 DEBUG:   * HTML => "web"
20:33:20.847  18:33:20.825 DEBUG:   * JSP => "jsp"
20:33:20.847  18:33:20.825 DEBUG:   * Flex => "flex"
20:33:20.847  18:33:20.825 DEBUG:   * XML => "xml"
20:33:20.847  18:33:20.825 DEBUG:   * PHP => "php"
20:33:20.847  18:33:20.825 DEBUG:   * VB.NET => "vbnet"
20:33:20.847  18:33:20.837 INFO: Auto-configuring with CI 'Jenkins'
20:33:20.847  18:33:20.838 INFO: Load quality profiles
20:33:20.847  18:33:20.843 DEBUG: GET 404 https://sonar.private-domain.tld/api/qualityprofiles/search.protobuf?project=php_core | time=5ms
20:33:21.108  18:33:20.873 DEBUG: GET 200 https://sonar.private-domain.tld/api/qualityprofiles/search.protobuf?defaults=true | time=29ms
20:33:21.108  18:33:20.926 INFO: Load quality profiles (done) | time=88ms
20:33:21.108  18:33:20.930 INFO: Auto-configuring with CI 'Jenkins'
20:33:21.108  18:33:20.933 INFO: Load active rules
20:33:21.109  18:33:20.964 DEBUG: GET 200 https://sonar.private-domain.tld/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXndEo4WuK-1u86-sGpu&ps=500&p=1 | time=29ms
20:33:21.109  18:33:21.087 DEBUG: GET 200 https://sonar.private-domain.tld/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXndEo9ouK-1u86-sGrL&ps=500&p=1 | time=25ms
20:33:21.370  18:33:21.126 DEBUG: GET 200 https://sonar.private-domain.tld/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXndEpAuuK-1u86-sGrr&ps=500&p=1 | time=32ms
20:33:21.370  18:33:21.150 DEBUG: GET 200 https://sonar.private-domain.tld/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXndEpGbuK-1u86-sGuN&ps=500&p=1 | time=23ms
20:33:21.370  18:33:21.183 DEBUG: GET 200 https://sonar.private-domain.tld/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXndEpCPuK-1u86-sGsz&ps=500&p=1 | time=26ms
20:33:21.370  18:33:21.256 DEBUG: GET 200 https://sonar.private-domain.tld/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXndEpJTuK-1u86-sGzz&ps=500&p=1 | time=67ms
20:33:21.370  18:33:21.284 DEBUG: GET 403 https://sonar.private-domain.tld/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AXndEpNJuK-1u86-sG6w&ps=500&p=1 | time=1ms
20:33:21.370  18:33:21.291 INFO: ------------------------------------------------------------------------
20:33:21.370  18:33:21.291 INFO: EXECUTION FAILURE
20:33:21.370  18:33:21.291 INFO: ------------------------------------------------------------------------
20:33:21.370  18:33:21.291 INFO: Total time: 12.229s
20:33:21.370  18:33:21.330 INFO: Final Memory: 6M/31M
20:33:21.370  18:33:21.330 INFO: ------------------------------------------------------------------------
20:33:21.370  18:33:21.330 ERROR: Error during SonarScanner execution
20:33:21.370  java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.report.ActiveRulesPublisher
20:33:21.370  	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:66)
20:33:21.370  	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
20:33:21.370  	at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)
20:33:21.370  	at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)
20:33:21.370  	at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)
20:33:21.370  	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)
20:33:21.370  	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
20:33:21.370  	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
20:33:21.370  	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
20:33:21.370  	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
20:33:21.370  	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
20:33:21.370  	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
20:33:21.370  	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
20:33:21.370  	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
20:33:21.370  	at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
20:33:21.370  	at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
20:33:21.370  	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
20:33:21.370  	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
20:33:21.370  	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
20:33:21.370  	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
20:33:21.371  	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
20:33:21.371  	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
20:33:21.371  	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
20:33:21.371  	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
20:33:21.371  	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
20:33:21.371  	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
20:33:21.371  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
20:33:21.371  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
20:33:21.371  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
20:33:21.371  	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
20:33:21.371  	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
20:33:21.371  	at com.sun.proxy.$Proxy0.execute(Unknown Source)
20:33:21.371  	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
20:33:21.371  	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
20:33:21.371  	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
20:33:21.371  	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
20:33:21.371  	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
20:33:21.371  Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.api.batch.rule.internal.DefaultActiveRules
20:33:21.371  	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:66)
20:33:21.371  	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
20:33:21.371  	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
20:33:21.371  	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
20:33:21.371  	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
20:33:21.371  	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
20:33:21.371  	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
20:33:21.371  	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
20:33:21.371  	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
20:33:21.371  	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
20:33:21.371  	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
20:33:21.371  	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
20:33:21.371  	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
20:33:21.371  	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
20:33:21.371  	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
20:33:21.371  	... 36 more
20:33:21.371  Caused by: You're not authorized to run analysis. Please contact the project administrator.

SonarQube system web page :

SonarQube ID information
Server ID: 1B645EDF-AXndEfFVuK-1u86-sDJj
Version: 8.9.0.43852
Date: 2021-06-05

Global permissions screenshot :

I tried to put the token with the admin user and regular one. Same result.
I tried to put a wrong token, it says that the login/password is incorrect.
I tried to analyse the code through Docker, Maven, on premise install (for SonarScanner) : same issue

Any help is kindly welcomed :slight_smile: !

I’ve managed to temporarily unlock the situation by using the login/password with sonar.login and sonar.password in plain text.
I did it with the admin account directly : can’t use an external account (from GitLab).

Of course, that’s not a suitable situation. It looks like my token does not match my account ? That’s weird :man_shrugging:

Hi @Rakdos ,

Happy to help you identify the cause and fix this issue. I’d like first for you to double check and share the following with me (screenshots):

  • Your user has a newly created, valid token that is not expired (share screenshot under “Administration → Security → Users → Tokens”, you may hide the token value of course)
  • You are passing the above valid token via the “sonar.login” parameter when you trigger the scan
  • Your user is part of the “Sonar-administrators” group (share screenshot under "Administration → Security → Users → and click on groups under your user)
  • Global permissions grant Execute Analysis and Project creation rights to the “sonar-administrators” group (you already shared the screenshot)
  • If the project you are analysing already exists on SonarQube (please confirm this), check your Project Permissions (share screenshot under Project → Project Settings → Permissions). The group “sonar-administrators” must be granted permission to Execute Analysis also at project level.

Can you please confirm all the above, in order?

Hello @Daniel_Meppiel !

Thanks for replying.

While I was saving some screenshot, I restarted the job and now it’s working properly, I don’t understand :man_shrugging: .
The only thing I changed is running the analysis on my computer using the sonar.login and sonar.password and waited 24 hours.

Here is the build history (juin = June and mai = May). The shown datetime are in GMT + 2.

4

As you can see in the last screenshot, it matches with my last message in the forum.

Anyway, the issue is resolved but I can’t explain why. If you need anything to deep dive into it feel free to ask. I will be glad to provide any log that you may need.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.