# Getting Error message: Compute Engine task main component key is null

**URL:** <https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952>\
**Category:** SonarQube Cloud\
**Tags:** bitbucketcloud, scanner\
**Created:** [August 30, 2021, 8:26pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952 "2021-08-30T20:26:46Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [August 30, 2021, 8:26pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/1 "2021-08-30T20:26:46Z")

</div>

Template for a good new topic, formatted with [Markdown](https://commonmark.org/help/):

- Bitbucket Cloud

- CI system used Bitbucket Cloud,

- Scanner command used when applicable - pipe: sonarsource/sonarcloud-scan:1.2.1

- Languages of the repository PHP

- Running QualityGate with the below for a PHP application,  
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4  
gets below error message:

Error message: Compute Engine task main component key is null.

Also the number of lines scanned of the organization repos is within the subscription limit.

---

<div class="post-metadata">

**Author:** ![AlxO](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alxo/32/3225_2.png) [@AlxO](https://community.sonarsource.com/u/AlxO)\
**Post date:** [August 31, 2021, 9:34am UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/3 "2021-08-31T09:34:14Z")

</div>

Hi @sonar2 ,

Could you please provide the ID of your failed analysis so that I can have a look at it?

Thanks!

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [August 31, 2021, 1:08pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/4 "2021-08-31T13:08:00Z")

</div>

Where do I find that, this repo does not show any analysis results on SonarCloud event after setting the New Code.

---

<div class="post-metadata">

**Author:** ![AlxO](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alxo/32/3225_2.png) [@AlxO](https://community.sonarsource.com/u/AlxO)\
**Post date:** [August 31, 2021, 1:23pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/5 "2021-08-31T13:23:07Z")

</div>

Hi @sonar2 ,

From your project, click on Administration, and then Background Tasks

I invite you to get more details from: [https://sonarcloud.io/documentation/digging-deeper/background-tasks/](https://sonarcloud.io/documentation/digging-deeper/background-tasks/)

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [August 31, 2021, 1:36pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/6 "2021-08-31T13:36:56Z")

</div>

I do not see any details under the BackGround Tasks.

This repo I did some changes to make a change of the default branch from master to develop.

In between I deleted the project and added back, from there it does not show any results.

Deletion of the project did something went wrong ?

---

<div class="post-metadata">

**Author:** ![AlxO](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alxo/32/3225_2.png) [@AlxO](https://community.sonarsource.com/u/AlxO)\
**Post date:** [August 31, 2021, 2:36pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/7 "2021-08-31T14:36:23Z")

</div>

If you deleted the project, then associated tasks were deleted as well.  
You will need to re-submit an analysis to SonarCloud and then see again what the outcome was  
I hope this helps

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [August 31, 2021, 2:45pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/8 "2021-08-31T14:45:43Z")

</div>

Can you check with this:

Background task: AXucqyygLF3mVb5NTxdH  
Submission time: 2021-08-31T14:44:29+0000  
Failure time: 2021-08-31T14:44:30+0000

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [September 7, 2021, 4:36pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/11 "2021-09-07T16:36:18Z")

</div>

HI @AlxO ,

Any update with the above task details, were you able to see why it always returns the message " Compute Engine Task main component key is null"

---

<div class="post-metadata">

**Author:** ![AlxO](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/alxo/32/3225_2.png) [@AlxO](https://community.sonarsource.com/u/AlxO)\
**Post date:** [September 8, 2021, 7:19am UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/12 "2021-09-08T07:19:08Z")

</div>

Hi Dnellutla,

Apologies for not getting back to you earlier. No, I could not find the reason why you got this error. I could see there are other projects in your organization that are successful: maybe an approach would be to compare how they’re set-up on both the :sonarcloud: and Bitbucket sides?

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [November 15, 2021, 5:21pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/14 "2021-11-15T17:21:23Z")

</div>

HI @AlxO , There is no difference in the setup when compared to other projects.  
I deleted the project and added back, But there is no change in the analysis.

What are the other reasons why Sonar Cloud always returns

Compute Engine taks main component key is null.

Project: Reptrax\_US (develop)  
Background task: AX0kehCkkecGlsi8oJeP  
Submission time: 2021-11-15T16:41:59+0000  
Failure time: 2021-11-15T16:41:59+0000

Error message: Compute Engine task main component key is null.

---

<div class="post-metadata">

**Author:** ![Claire\_Villard](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/claire_villard/32/27065_2.png) [@Claire\_Villard](https://community.sonarsource.com/u/Claire_Villard)\
**Post date:** [November 23, 2021, 3:11pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/17 "2021-11-23T15:11:22Z")

</div>

Hi @sonar2 ,

Changing the project key (and then updating the pipeline to use the new key) is a workaround for that issue, as found in [this other thread](https://community.sonarsource.com/t/branch-analysis-fails-for-some-branches-succeeds-for-others-using-azure-devops/11932/7). Could you please try that? We are still investigating for the root cause.

If the problem reappears after changing the key, could you please give us:

- the full scanner log of the first time the error appears
- the new project key
- the background task ID
- the submission time
- any information of something that happened to the project or to the organization: manual deletion of a branch? of the project ? of the organization? an analysis failing for another reason just before? the time since the previous analysis of the impacted branch/ of the project ?..

Thanks a lot, and my apologies for the long time this investigation is taking.  
Claire

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 9, 2021, 9:30am UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/18 "2021-12-09T09:30:56Z")

</div>

Hey all!

In good news – we’ve finally tracked down the tricky bug that’s causing this. It could happen when a project was created, a branch analyzed (and that analysis failed), and the project gets deleted/recreated. This caused some orphan database entries that cause the “Compute Engine task main component key is null” error.

Our plan is to stop new cases from occurring, and clean up existing orphans. The work is ongoing.

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [December 9, 2021, 2:24pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/19 "2021-12-09T14:24:08Z")

</div>

Great !!! When can we expect this to be available.  
We are blocked right now every time we do an Analysis it always return " Compute Engine main Component Key is. null"

---

<div class="post-metadata">

**Author:** ![Claire\_Villard](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/claire_villard/32/27065_2.png) [@Claire\_Villard](https://community.sonarsource.com/u/Claire_Villard)\
**Post date:** [December 9, 2021, 2:35pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/20 "2021-12-09T14:35:51Z")

</div>

Hi,

Have you tried the workaround I suggested above, to unblock you?

> > Changing the project key (and then updating the pipeline to use the new key) is a workaround for that issue, as found in [this other thread](https://community.sonarsource.com/t/branch-analysis-fails-for-some-branches-succeeds-for-others-using-azure-devops/11932/7). Could you please try that? We are still investigating for the root cause.

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [December 9, 2021, 3:09pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/21 "2021-12-09T15:09:18Z")

</div>

Hi Claire,

We tried the work around steps multiple times, it did not resolve the issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 15, 2021, 4:00pm UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/22 "2021-12-15T16:00:07Z")

</div>

Hey @sonar2

This morning we deployed a cleanup which should prevent the issue from happening again, and cleanup existing orphan branches.

Can you give it a try? Has the error stopped?

---

<div class="post-metadata">

**Author:** ![sonar2](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sonar2/32/25180_2.png) [@sonar2](https://community.sonarsource.com/u/sonar2)\
**Post date:** [December 16, 2021, 3:17am UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/23 "2021-12-16T03:17:31Z")

</div>

Thanks for the update, will try this and keep you posted.

---

<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:** [January 27, 2022, 10:36am UTC](https://community.sonarsource.com/t/getting-error-message-compute-engine-task-main-component-key-is-null/48952/24 "2022-01-27T10:36:33Z")

</div>

Closed on January 27, 2022, 10:36am UTC

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