Sonarcloud: not authorized


(Sébastien Lepage) #1


I’m trying to execute sonarcloud through travis for the PrimeFaces organization. But if fails every time, it says: “Not authorized. Please check the properties sonar.login and sonar.password”

I created that organization so I should have enough privilieges and I encrypt the token with “travis encrypt” command line, I displayed the credentials on the output and it seems correct to me but still I’m not authorized… Here is the output of $SONARQUBE_SCANNER_PARAMS { “sonar.organization” : “primefaces”, “” : “”, “sonar.login” : “my_encrypted_token” }

Link to the project:

Thank you very much for your help

(Xavier Bourguignon) #2

Hi Sébastien,

Please check that the token you pass in sonar.login is associated with an account how has the right “Execute analysis”

(Sébastien Lepage) #3

Yup it has the correct configuration. But still not working. I guess the only clue I have is the token. I used travis encrypt -r Rapster/primefaces “encrypted_token” (or if I execute the command on the folder itself it’ll detect it). Both end up with the same result

(Xavier Bourguignon) #4

How do you set your sonarcloud token ? in .travis.yml ?
Do you use our travis add-on: ?

(Sébastien Lepage) #5

Yes I followed that tutorial…

(Xavier Bourguignon) #6

Could you launch this command to see if there’s no issue in your .travis.yml:

travis lint

(Sébastien Lepage) #7

There is no output using that command

(Xavier Bourguignon) #8

Can you share your .travis.yml ?

(Sébastien Lepage) #9

It’s right here:

(Sébastien Lepage) #10

Do you see anything wrong?

(Xavier Bourguignon) #11

Nop, everything is ok.

I suggest to re-create a token in SonarCloud, encrypt in travis and try again.

Just out of curiousity, I see there was an analysis yesterday, how do you trigger it ?

(Sébastien Lepage) #12

I re-created the token more than once… I ran the analyse from a local machine (I guess it has been updated)

(Xavier Bourguignon) #13

Ok, I think we find the problem, you encrypt on travis on your fork "Rapster/primefaces

But the build run against primefaces/primefaces

You should encrypt with:

travis encrypt -r primefaces/primefaces “encrypted_token”

(Sébastien Lepage) #14

Ah thank very much! It’s working :wink:

Thanks again for your patience