Sonarcloud: not authorized

Hi,

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.host.url” : “https://sonarcloud.io”, “sonar.login” : “my_encrypted_token” }

Link to the project: https://sonarcloud.io/organizations/primefaces/projects

Thank you very much for your help

Hi Sébastien,

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

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

How do you set your sonarcloud token ? in .travis.yml ?
Do you use our travis add-on: https://docs.travis-ci.com/user/sonarcloud/ ?

Yes I followed that tutorial…

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

travis lint

There is no output using that command

Can you share your .travis.yml ?

It’s right here: https://github.com/primefaces/primefaces/blob/master/.travis.yml

Do you see anything wrong?

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 ?

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

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”

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

Thanks again for your patience