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

(Rafael Medeiros) #1

I set up Sonarcloud this morning and it was neat. Everything worked in the first try, except code coverage. I merged with other branches restarting builds and running the same pipe several times, each was a success.

Then to solve the coverage issue, I added up an extra option: javascript.lcov.reportPaths.

I got “You’re not authorized to run analysis. Please contact the project administrator.”

At first I thought that option was messed up (because I got it from Google) so I rolled back the script but the error persisted. Thinking that I might have had my token expired, I created a new token. Still I get the same error.

My script is here: https://github.com/rcmedeiros/template/blob/master/.circleci/config.yml, at line 161
The log is here: https://circleci.com/gh/rcmedeiros/template/800, at Sonarcloud Scan section.

Any lights?

1 Like
(Rafael Medeiros) #2

Bingo.

After some trial and error, I figured out that the error had nothing to do with authorization.

While the doc states that the path can be relative to the project root, I didn’t realize this root is what is defined by property sonar.sources.

My project is:

     ./
     |_src/*
     |_coverage/*
     |_
     |_

I had

sonar.sources=./src
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

I should’ve had

sonar.sources=./src
sonar.javascript.lcov.reportPaths=../coverage/lcov.info
1 Like