ALM used (GitHub, Bitbucket Cloud, Azure DevOps): Azure DevOps
CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI: Azure DevOps
Languages of the repository: .NET
Issue Description:
We have created SOT and added sonarcloud projects to SOT
This SOT is setup in the service connection in Azure DevOps which would be used in our Azure DevOps pipelines to scan the code
Since from last 3-4 days, we are observing the error: ##[error]ERROR: Error retrieving entitlements, proceeding with analysis
org.sonar.api.utils.MessageException: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator to check the permissions of the user the token belongs to
This error was not there before and no changes were made to any configurations
The complete log of error is as below:
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=100ms
INFO: Sensor cache enabled
INFO: Inferred api base url ‘https://api.sonarcloud.io’ from host url ‘https://sonarcloud.io’.
INFO: Load sensor cache
INFO: Load sensor cache (76 KB) | time=515ms
INFO: Inferred api base url ‘https://api.sonarcloud.io’ from host url ‘https://sonarcloud.io’.
INFO: Inferred api base url ‘https://api.sonarcloud.io’ from host url ‘https://sonarcloud.io’.
##[error]ERROR: Error retrieving entitlements, proceeding with analysis
org.sonar.api.utils.MessageException: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator to check the permissions of the user the token belongs to
ERROR: Error retrieving entitlements, proceeding with analysis
org.sonar.api.utils.MessageException: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator to check the permissions of the user the token belongs to
INFO: Sensor C# Project Type Information [csharpenterprise]
INFO: Sensor C# Project Type Information [csharpenterprise] (done) | time=4ms
INFO: Sensor C# Analysis Log [csharpenterprise]
INFO: Roslyn version: 5.0.0.0
Could you please guide us further in resolving this issue
Thanks for confirming that. I’m glad analysis succeeds, but you shouldn’t be seeing that error. I’m going to forward this to the team for a deeper look, but with low priority.
I am not sure what an OP is. Yes I am seeing the error. I have verified that I am using the correct project and organization, as well as having recreated our sonar_token in Scoped Organization Tokens that have access to the project. I can verify that the token is being used/accessed. We are using Github actions running SonarSource/sonarqube-scan-action@v7.0.0.
Could either of you add -Dsonar.verbose=true to your analysis command line and provide the full analysis log, starting from the analysis command itself, please?
I have seen the same issue in my analysis runs. I ran with the -Dsonar.verbose=true flag set and noticed a 403 error related to fetching billing entitlements. The token has Execute Analysis permissions, but it is not given billing API access. It seems strange that the scanner is trying to access billing info for analysis tokens.
Welcome to the community and thanks for these additional details!
We’ve got some work happening right now around ADO, and this is probably a side effect. Unpleasant, but ultimately benign. Nonetheless, it is flagged for the developers.
I have news, but unfortunately it’s not good news. As you’re aware, we haven’t rolled out the fix this week like I said we would. We initially underestimated the effort here, but hope to roll out the fix late next week.