Error: Not Authorized (was: Successful travis build, but no results in sonarcloud)

  • Travis build information: Travis CI - Test and Deploy with Confidence
  • Everything appeared to be working until about a year ago, then the sonarcloud interface no longer updated with successful travis builds. I re-followed the tutorial (re-set-up the sonar secret with the travis encrypt command and added the extra options to the sonar-scanner), but the results still aren’t updating.

Any pointers of what I’m doing wrong?

Project: GitHub - squinky86/STIGQter: Open Source STIG Viewer Reimplementation

Hello Jon!

Welcome to the SonarSource community forum!

I had a quick look at your Travis CI logs and could see this under the sonar-scanner logs:

So it would seem like your are missing the SONAR_TOKEN in your configuration or the one you are using is not valid anymore. Or the one you use doesn’t have the correct permission to send analysis report on the SC project.

1 Like

Thanks for replying!

  1. I followed the instructions under “administration” → “analysis method” → “Travis-CI”. This led me to running “travis encrypt” against a key, and the results were placed into .travis.yml. I then clicked on “C++” as my project type and followed those instructions, making sure the .travis.yml file builds the project properly. was also updated.
  2. I went to my repository settings and verified that there are no secrets set (SONAR_TOKEN is unset in the repository).

I’m assuming that SONAR_TOKEN should remain unset as the authentication method is using the secure token provided in .travis.yml. Otherwise, the implementation guide should have told me to set it. Do I need to set this?

EDIT: I just went through the setup documentation as above once again and update .travis.yml. The issue continues to occur.
EDIT2: I just added the SONAR_TOKEN to the travis environment variables, and it is still giving the same error.
EDIT3: I recreated a new token, submitted it, and made sure my user account has explicit “Execute Analysis” permission. The scan still fails with the unauthorized error, regardless of if the SONAR_TOKEN is set in the travis settings. I have been fiddling with this for the better part of a year now, so there’s no telling what settings I’ve botched up with this.

It’s been a few days. I’m bumping this for visibility. I have done the following:

  1. Contacted sales and asked to pay for support. They requested my company information 2+ days ago and haven’t replied back. They stated that their basic pay plan does not include support, so I’m assuming they’re figuring out how much to charge.
  2. Upgraded to Focal from Bionic on the travis-ci image
  3. Gone through the tutorial a half dozen times
  4. Reached out to everyone I know who uses sonarcloud for recommendations

I feel like there’s a setting somewhere I’m missing - one of those stupid little “duh” things that just hasn’t clicked. I’d really appreciate some help!

Resolution: I gave up on travis-ci and switched to github actions. It appears to be working fine there.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.