"Not authorized. Please check the properties sonar.login and sonar.password." for PR automated pipelines

Hi everyone,

Recently, I have noticed a strange issue that only happens to PR automated pipelines (I’m using Azure DevOps).

In the SonarCloudAnalyze task, it throws:

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

The thing is I use service connection and I have double-checked, it’s still working.
When I run the pipeline specifically and manually on the branch, it still runs perfectly fine. The tasks and configs are the same.

Have anyone run into this strange issue recently?

1 Like

Hi @lamle

Can you make sure that in your service connection, you have “Grant access permission to all pipelines” checked ?

Or at least that there are no policy preventing service connection to be used from Pull Request builds ?

Mickaël

I did grant access permission to all pipelines.

Anyway, I found out the problem.

I go to https://sonarcloud.io/organizations/{my_company}/edit and see that my Personal Access Token (under the section Azure DevOps connectivity management) is outdated.
Update it with a new one and now the PR-automated pipelines start working again.

This is somewhat strange from my point of view because CI-triggered pipelines (triggered from new commits to branches like ‘main’ or ‘master’) are still working fine, only PR-automated pipelines fail.

1 Like

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