ERROR: Not authorized. Please check the properties sonar.login and sonar.password

Performing the analyses from Travis on SonarCloud, I got the following error:

$ sonar-scanner
INFO: Scanner configuration file: /home/travis/.sonarscanner/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/travis/build/pepstock-org/Charba/sonar-project.properties
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_141 Oracle Corporation (64-bit)
INFO: Linux 4.4.0-101-generic amd64
INFO: User cache: /home/travis/.sonar/cache
INFO: SonarQube server 8.0.0
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.570s
INFO: Final Memory: 6M/121M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The command "sonar-scanner" exited with 1.

I changed the token and reassigned into a environment variable but it doesn’t work.

https://travis-ci.com/pepstock-org/Charba/jobs/293777055

https://sonarcloud.io/dashboard?id=pepstock-org_Charba

Same problem as Not authorized using travis since 1st of march. Maybe the problem is travis and not sonarcloud? Could someone of sonarCloud verify it?

I seem to be having the same problem but in TeamCity. Happened in the last 24 hours.

Hi,

I believe the issue is on Travis side.

We didn’t push any change that could explain such errors.

A workaround I found is to write the encrypted value directly in the .travis.yml file, instead of in a variable. But I can understand that it’s not really convenient.

I asked for more information on a topic on their community forum: https://travis-ci.community/t/sonarqube-plugin-failing-due-to-failed-export/7429/3.

Hope that helps,

Benoit

1 Like

Just to avoid confusion, your problem is actually different.

Thank you Benoit. I had the feeling the issue was a Travis issue but I preferred to start from the end of the chain

And I confirm that the issue is different

Hi all, I opened an issue into Travis and they provided me the solution.

The definition in Travis for Sonar addon is changed:

From:

addons:
   sonarcloud:
     organization: "pepstock-org"
     token:
       secure: ${SONAR_TOKEN}

To:

addons:
  sonarcloud:
    organization: "pepstock-org"
    token: ${SONAR_TOKEN}
5 Likes