# Reports not getting uploaded on SonarCloud after Analysis, Throws Project not found

**URL:** <https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853>\
**Category:** SonarQube Cloud\
**Created:** [June 15, 2022, 12:17pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853 "2022-06-15T12:17:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parth\_Tyagi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/parth_tyagi/32/34268_2.png) [@Parth\_Tyagi](https://community.sonarsource.com/u/Parth_Tyagi)\
**Post date:** [June 15, 2022, 12:17pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/1 "2022-06-15T12:17:20Z")

</div>

I’m trying to setup SonarCloud on my Azure Pipelines. I have added sonar-project.properties file in the root of my repository which contains the below parameters:

```auto
sonar.projectKey=xxxx_xxxxxxxxx
sonar.organization=xxxxx
sonar.projectName=xxxxxxxxx
sonar.projectVersion=1.0
sonar.sources=.
sonar.sourceEncoding=UTF-8

```

I have added a service connection as well after generating a token from SonarCloud, I’m added as member in the organization.

While running the code analysis, it analyses the code, completes the analysis and then fails with an error below:

```auto
##[error]ERROR: Error during SonarScanner execution

ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator

ERROR:

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

ERROR: Error during SonarScanner execution

ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator

ERROR:

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

```

Can someone please help me with how we can fix this ?  
[ErrorRunCodeAnalysis.txt](https://community.sonarsource.com/uploads/short-url/4cJFPTVzBk6n9oWbhqmVOF7kG6u.txt) (109.1 KB)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 15, 2022, 5:41pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/2 "2022-06-15T17:41:02Z")

</div>

Hi,

Welcome to the community!

Does the project already exist on SonarCloud?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Parth\_Tyagi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/parth_tyagi/32/34268_2.png) [@Parth\_Tyagi](https://community.sonarsource.com/u/Parth_Tyagi)\
**Post date:** [June 15, 2022, 5:49pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/3 "2022-06-15T17:49:18Z")

</div>

Hi Ann,

Thank you.  
Yes, the project exists in SonarCloud. I have followed all the steps mentioned and copied parameters from sonarcloud console while configuring analysis on this project.

Thanks,  
Parth

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 15, 2022, 5:55pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/4 "2022-06-15T17:55:07Z")

</div>

Hi Parth,

The error message lists a couple possible failure points. Paraphrasing:

> [@Parth\_Tyagi](#):
>
> ```auto
> Please check 
> * 'sonar.projectKey' 
> * 'sonar.organization' properties
> * 'SONAR_TOKEN' environment variable
> 
> ```

If you’re sure the first two are spelled correctly (no weird invisible characters anywhere in there…?) then I would look at the analysis token. Is it present? Issued by a user with permissions to analyze the project?

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![Parth\_Tyagi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/parth_tyagi/32/34268_2.png) [@Parth\_Tyagi](https://community.sonarsource.com/u/Parth_Tyagi)\
**Post date:** [June 15, 2022, 6:03pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/5 "2022-06-15T18:03:51Z")

</div>

Sure Ann,  
Couple of questions while I look at the paraphrasing.

- Does SONAR\_TOKEN(analysis token, assuming they are same) need to be a part of the sonar-project.properties file. I have used this token only to create the Service Connection as mentioned in the setup steps.

- I added SONAR\_TOKEN or analysis token as a member of the organization and not the admin, Can this be an issue ? Do we need to create token as an admin ?

Thanks,  
Parth

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 15, 2022, 6:10pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/6 "2022-06-15T18:10:23Z")

</div>

Hi Parth,

> [@Parth\_Tyagi](#):
>
> I have used this token only to create the Service Connection as mentioned in the setup steps.

I guess this is Azure? I’ll be honest & say I’m not versed in it. The error message mentions the token value being in the environment, so if you’ve done what’s necessary to put it there, then I would think that was enough.

> [@Parth\_Tyagi](#):
>
> I added SONAR\_TOKEN or analysis token as a member of the organization and not the admin,

IIRC the token owner needs both Browse and Analyze on the project in question. Can you double-check to make sure you explicitly have both permissions? (Permissions are not cumulative. E.G. If you have Admin on a project but now Browse, you won’t actually be able to see it.)

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Parth\_Tyagi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/parth_tyagi/32/34268_2.png) [@Parth\_Tyagi](https://community.sonarsource.com/u/Parth_Tyagi)\
**Post date:** [June 21, 2022, 1:20pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/7 "2022-06-21T13:20:59Z")

</div>

Resolved this, The problem was with Permissions.  
The token creator should have admin permissions to run analysis on Azure Pipelines

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [June 28, 2022, 1:21pm UTC](https://community.sonarsource.com/t/reports-not-getting-uploaded-on-sonarcloud-after-analysis-throws-project-not-found/64853/8 "2022-06-28T13:21:47Z")

</div>

Closed on June 28, 2022, 1:21pm UTC

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