You're not authorized to run analysis. Please contact the project

Hello everyone,

Sonarqube version docker: 9.1

I got the error in the title: You’re not authorized to run analysis. Please contact the project administrator.

But when i look at the log i can see that the task is executed well, see the log below:

2022.09.08 08:17:46 INFO  ce[][o.s.c.t.CeWorkerImpl] Execute task | project=xxx.aut.aae:autorisations | type=REPORT | branch=develop | branchType=BRANCH | id=AYMcLSvj3ktdmADMVC-1 | submitter=sonar-analysis-jenkins
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Extract report | status=SUCCESS | time=151ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist scanner context | status=SUCCESS | time=5ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Propagate analysis warnings from scanner report | status=SUCCESS | time=2ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Generate analysis UUID | status=SUCCESS | time=0ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Load analysis metadata | status=SUCCESS | time=5ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Initialize | status=SUCCESS | time=5ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Build tree of components | components=294 | status=SUCCESS | time=14ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Validate project | status=SUCCESS | time=3ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Load quality profiles | status=SUCCESS | time=156ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Load Quality gate | status=SUCCESS | time=3ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Load new code period | status=SUCCESS | time=6ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Detect file moves | reportFiles=218 | dbFiles=218 | addedFiles=0 | status=SUCCESS | time=9ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Load duplications | duplications=51 | status=SUCCESS | time=6ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute cross project duplications | status=SUCCESS | time=0ms
2022.09.08 08:17:46 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute size measures | status=SUCCESS | time=9ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute new coverage | status=SUCCESS | time=388ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute coverage measures | status=SUCCESS | time=10ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute comment measures | status=SUCCESS | time=0ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute duplication measures | status=SUCCESS | time=0ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute size measures on new code | status=SUCCESS | time=1ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute language distribution | status=SUCCESS | time=1ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute test measures | status=SUCCESS | time=0ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute complexity measures | status=SUCCESS | time=1ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Load measure computers | status=SUCCESS | time=0ms
2022.09.08 08:17:47 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute Quality Profile status | status=SUCCESS | time=5ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Execute component visitors | status=SUCCESS | time=731ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Checks executed after computation of measures | status=SUCCESS | time=53ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute Quality Gate measures | status=SUCCESS | time=0ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Compute Quality profile measures | status=SUCCESS | time=0ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Generate Quality profile events | status=SUCCESS | time=12ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Generate Quality gate events | status=SUCCESS | time=16ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Check upgrade possibility for not analyzed code files. | status=SUCCESS | time=0ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist components | status=SUCCESS | time=14ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist analysis | status=SUCCESS | time=2ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist analysis properties | status=SUCCESS | time=3ms
2022.09.08 08:17:48 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist measures | inserts=71 | status=SUCCESS | time=67ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist live measures | insertsOrUpdates=12696 | status=SUCCESS | time=1911ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist duplication data | insertsOrUpdates=0 | status=SUCCESS | time=11ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist new ad hoc Rules | status=SUCCESS | time=0ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist issues | cacheSize=27.1 kB | inserts=0 | updates=1 | merged=0 | status=SUCCESS | time=5ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist project links | status=SUCCESS | time=0ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist events | status=SUCCESS | time=3ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist sources | status=SUCCESS | time=155ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Persist cross project duplications | status=SUCCESS | time=0ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Enable analysis | status=SUCCESS | time=4ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Update last usage date of quality profiles | status=SUCCESS | time=4ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Purge db | status=SUCCESS | time=29ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Index analysis | status=SUCCESS | time=116ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Update need issue sync for branch | status=SUCCESS | time=3ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Send issue notifications | newIssuesNotifs=0 | newIssuesDeliveries=0 | myNewIssuesNotifs=0 | myNewIssuesDeliveries=0 | changesNotifs=0 | changesDeliveries=0 | status=SUCCESS | time=4ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Publish task results | status=SUCCESS | time=0ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.s.ComputationStepExecutor] Trigger refresh of Portfolios and Applications | refreshesAPP=0 | status=SUCCESS | time=2ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Webhooks | globalWebhooks=1 | projectWebhooks=0 | status=SUCCESS | time=43ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Report branch Quality Gate status to devops platforms | status=SUCCESS | time=1ms
2022.09.08 08:17:50 INFO  ce[AYMcLSvj3ktdmADMVC-1][o.s.c.t.CeWorkerImpl] Executed task | project=xxx.aut.aae:autorisations | type=REPORT | branch=develop | branchType=BRANCH | id=AYMcLSvj3ktdmADMVC-1 | submitter=sonar-analysis-jenkins | status=SUCCESS
| time=4208ms

And you can see that the user is sonar-analysis-jenkins
When we go to the project this user got all the access needed, see the screen below :

So what’s the point here plz ?
A bug ?

Thanks for your help.
Best regards Vincent.

More log in the acces.log file:

10.240.193.3 - - [08/Sep/2022:09:51:44 +0000] “GET /api/qualitygates/project_status?analysisId=AYMcgyOU1_HY5GYAmg2c HTTP/1.1” 403 46 “-” “ScannerMaven/3.9.1.2184/3.8.5” “AYFsmRGscXpMJDtlC3Nl”

Hi,

When/where do you see the message? Can you share the relevant analysis log?

 
Ann

The complete log when

mvn -Dmaven.main.skip=true -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Dgwt.compiler.skip=true -Dsonar.qualitygate.wait=true -Pquality verify sonar:sonar
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project autorisations: You're not authorized to run analysis. Please contact the project administrator. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project autorisations: You're not authorized to run analysis. Please contact the project administrator.
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:306)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: You're not authorized to run analysis. Please contact the project administrator.
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.sonar.api.utils.MessageException: You're not authorized to run analysis. Please contact the project administrator.

Hi,

This may be the complete stacktrace, but I doubt it’s the complete log. Can I have everything from the analysis command until exit?

 
Ann

The complete log for you, thanks for your help.

log.log (64.4 KB)

Hi,

Thanks for the log. As you’ve observed, analysis succeeds:

[INFO] Analysis report generated in 375ms, dir size=1.9 MB
[INFO] Analysis report compressed in 448ms, zip size=678.8 kB
[INFO] Analysis report uploaded in 68ms

What’s failing is what comes after:

[INFO] ------------- Check Quality Gate status
[INFO] Waiting for the analysis report to be processed (max 300s)
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:51 min
[INFO] Finished at: 2022-09-08T12:27:10Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project autorisations: You're not authorized to run analysis. Please contact the project administrator. -> [Help 1]

You should look at how your pipeline is trying to get the Quality Gate status. At a guess, it’s making an API call without the requisite credentials (and getting back a confusing error message). You should look at using a webhook instead.

 
HTH,
Ann

Ann,

Thanks for your help, i will check this post.

Regards
Vincent