I have tried to run sonar runner(npm run sonar) for my project but got this error. please support how we can fix this issue.
In sonar-project.properties:
sonar.host.url=https://sonarcloud.io
sonar.login = Encrypted Key
sonar.projectKey=myprojectKey
sonar.organization=myorganization
sonar.projectName=myprojectname
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**
sonar.tests=src
sonar.test.inclusions=**/*.spec.ts
sonar.typescript.lcov.reportPaths=coverage/lcov.info
==============
INFO: Indexing files...
INFO: Project configuration:
INFO: Load project repositories
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 16.808s
INFO: Final Memory: 19M/70M
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.
I have read this topic but it’s seem my error is different.
Make sure that the user which created the token used to run the analysis has the Execute Analysis permission.
You can see that in Your project dashboard > Administration > Permissions.
I’m new, and came here because I’m receiving this same error. I have manually adjusted my permissions to include both Execute Analysis and even Administer. The error message seems a little different now, but
I think I just figured this out. When going through the tutorial I wasn’t the one who set up the organization, so I was not familar about an existing “Update Key” setting. When I added the SonarCloud task, I entered a value similar to the one from the tutorial in the textbox, since it wasn’t a dropdown to choose from. They did not match. After I corrected the “Prepare analysis on SonarCloud” Project Key setting to match the Update Key in the SonarCloud dashboard, under Administration, the build completed successfully.