# Maven Plugin fails with exception when trying to run on SonarCloud

**URL:** <https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060>\
**Category:** SonarQube Cloud\
**Created:** [February 28, 2022, 9:55am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060 "2022-02-28T09:55:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![voelda](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/voelda/32/17239_2.png) [@voelda](https://community.sonarsource.com/u/voelda)\
**Post date:** [February 28, 2022, 9:55am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/1 "2022-02-28T09:55:38Z")

</div>

Our internal customer is running is a Gitlab Server Pipeline (Maven build) connecting to sonarcloud and experiences the following error:

The following error occurs:  
`Caused by: org.sonar.api.utils.MessageException: Failed to get CE Task status - No activity found for task 'abcdexyz'`

Pipeline output:  
`Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project xxx: Failed to get CE Task status - No activity found for task 'abcdexyz'`

Is this known behaviour? Retries seem to remedy it for the customer.  
What can be done to prevent this error?

Edit: this also happens for gradle pipelines

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:** [February 28, 2022, 7:24pm UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/2 "2022-02-28T19:24:35Z")

</div>

Hey @voelda

- What does their _.gitlab-ci.yml_ file look like?
- Can you confirm they are actually using Gitlab Server, as opposed to [Gitlab.com](http://Gitlab.com)?

---

<div class="post-metadata">

**Author:** ![voelda](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/voelda/32/17239_2.png) [@voelda](https://community.sonarsource.com/u/voelda)\
**Post date:** [March 3, 2022, 7:23am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/3 "2022-03-03T07:23:30Z")

</div>

Hi Colin,

I can confirm they are on Gitlab Server. This is a setup that is intentional, even though we know that most teams use sonarcloud and [Gitlab.com](http://Gitlab.com).

This is the relevant part from their .gitlab-ci.yml:

```auto
.sonarcloud:
  <<: *tags
  image: registry.gitlab-server/sam/docker/maven-jdk15-node:latest
  script:
    - mvn $MAVEN_CLI_OPTS sonar:sonar -P sonar -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME $ADDITIONAL_PARAMS
  variables:
    GIT_DEPTH: 0
  cache:
    policy: pull
    paths:
      - .m2/repository
  except:
    - schedules

```

---

<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:** [March 9, 2022, 5:26pm UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/4 "2022-03-09T17:26:20Z")

</div>

Hey @voelda

> [@voelda](#):
>
> I can confirm they are on Gitlab Server. This is a setup that is intentional, even though we know that most teams use sonarcloud and [Gitlab.com](http://Gitlab.com).

Thanks for confirming. It’s a shame that your users won’t benefit from features like Merge Request Decoration. ☹

In any case, the error is strange. The next time this happens, try querying [https://sonarcloud.io/api/qualitygates/project\_status?analysisId=abcdexyz](https://sonarcloud.io/api/qualitygates/project_status?analysisId=abcdexyz) (using whatever ID is returned in the logs for the `analysisId`) and see if it returns any information. This is the same URL the scanner is calling. Let us know what happens.

It will be interesting to know if the analysis is actually making its way to SonarCloud and starting to be processed.

---

<div class="post-metadata">

**Author:** ![mekya](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mekya/32/15095_2.png) [@mekya](https://community.sonarsource.com/u/mekya)\
**Post date:** [March 13, 2022, 10:32am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/5 "2022-03-13T10:32:41Z")

</div>

Hi Colin,

Thank you for the info. I’m getting the same problem for the last two days.

> Failed to get CE Task status - No activity found for task ‘AX-Cvmk1Lj\_oMlsUjiI\_’ → [Help 1]

When I visit this address “[https://sonarcloud.io/api/qualitygates/project\_status?analysisId=AX-Cvmk1Lj\_oMlsUjiI\_](https://sonarcloud.io/api/qualitygates/project_status?analysisId=AX-Cvmk1Lj_oMlsUjiI_)”  
it says

> {“errors”:[{“msg”:“Analysis with id \u0027AX-Cvmk1Lj\_oMlsUjiI\_\u0027 is not found”}]}

FYI

---

<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:** [March 14, 2022, 10:17am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/6 "2022-03-14T10:17:58Z")

</div>

That’s interesting. It means we probably aren’t running into some race condition where the analysis report hasn’t started to be processed by SonarCloud…

Is this UUID the same as the one that’s reported at the end of the `mvn sonar:sonar` step?

```auto
[**INFO**] ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=testmaven
[**INFO**] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[**INFO**] More about the report processing at https://sonarcloud.io/api/ce/task?id=AX-HpkG_H2h4zpgubz7O

```

---

<div class="post-metadata">

**Author:** ![paulhobbel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/paulhobbel/32/31614_2.png) [@paulhobbel](https://community.sonarsource.com/u/paulhobbel)\
**Post date:** [March 21, 2022, 9:01am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/7 "2022-03-21T09:01:18Z")

</div>

We recently started having the same issue. Sometimes it works and sometimes we get the `No activity found for task` error. This is now happening for a month if I am correct.

---

<div class="post-metadata">

**Author:** ![Laksuh](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/laksuh/32/31701_2.png) [@Laksuh](https://community.sonarsource.com/u/Laksuh)\
**Post date:** [March 23, 2022, 9:03am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/8 "2022-03-23T09:03:54Z")

</div>

We are running into the same issue. `Failed to get CE Task status - No activity found for task ...`. We figured out that ce-task which cannot be found is returning the needed information, when calling it manually: `https://sonarcloud.io/api/ce/task?id=<ID-WHICH-CANNOT-BE-FOUND>`  
So we are guessing that the call is made before the information is provided sometimes.  
We tried downgrading back to the previous version `3.9.0.2155` but without success.

---

<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:** [March 23, 2022, 4:08pm UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/9 "2022-03-23T16:08:50Z")

</div>

Hey @paulhobbel / @Laksuh

Do you mind confirming what CI you’re using here (the original post was with GitLab CI) and DevOps Platform (the original post relates to GitLab Server). Understanding if there’s a pattern (or not) is really useful here.

---

<div class="post-metadata">

**Author:** ![Laksuh](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/laksuh/32/31701_2.png) [@Laksuh](https://community.sonarsource.com/u/Laksuh)\
**Post date:** [March 24, 2022, 12:13pm UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/10 "2022-03-24T12:13:34Z")

</div>

Ofcourse, we are using GitLab CI as well on a self hosted GitLab Server.

---

<div class="post-metadata">

**Author:** ![imantaba](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/imantaba/32/31815_2.png) [@imantaba](https://community.sonarsource.com/u/imantaba)\
**Post date:** [March 27, 2022, 5:19am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/11 "2022-03-27T05:19:21Z")

</div>

We have same error in our Gitlab CI .

---

<div class="post-metadata">

**Author:** ![gmikky](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/gmikky/32/31708_2.png) [@gmikky](https://community.sonarsource.com/u/gmikky)\
**Post date:** [March 29, 2022, 10:39am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/12 "2022-03-29T10:39:59Z")

</div>

Looks like we have the similar issue: [Quality Gate fails with ‘GET 404 https://sonarcloud.io/api/ce/task?id=AX-yXUIpYZn01BNPA1FR’ - Report a bug - Sonar Community (sonarsource.com)](https://community.sonarsource.com/t/quality-gate-fails-with-get-404-https-sonarcloud-io-api-ce-task-id-ax-yxuipyzn01bnpa1fr/60389)

---

<div class="post-metadata">

**Author:** ![voelda](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/voelda/32/17239_2.png) [@voelda](https://community.sonarsource.com/u/voelda)\
**Post date:** [April 4, 2022, 7:10am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/14 "2022-04-04T07:10:33Z")

</div>

Hi @Colin,

is there something we can do to get more attention on this issue?  
We will gladly provide more information if needed/available.

---

<div class="post-metadata">

**Author:** ![gmikky](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/gmikky/32/31708_2.png) [@gmikky](https://community.sonarsource.com/u/gmikky)\
**Post date:** [March 23, 2022, 10:12am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/15 "2022-03-23T10:12:41Z")

</div>

- SonarCloud, SonarScanner for MSBuild 5.5.3

```auto
16:02:10.694 DEBUG: Report metadata written to /builds/dev-uk/micro-space/application-container/.sonarqube/out/.sonar/report-task.txt
16:02:10.694 INFO: ------------- Check Quality Gate status
16:02:10.694 INFO: Waiting for the analysis report to be processed (max 300s)
16:02:10.705 DEBUG: GET 404 https://sonarcloud.io/api/ce/task?id=AX-yXUIpYZn01BNPA1FR | time=11ms
16:02:10.710 DEBUG: eslint-bridge server will shutdown
16:02:16.090 INFO: ------------------------------------------------------------------------
16:02:16.090 INFO: EXECUTION FAILURE
16:02:16.090 INFO: ------------------------------------------------------------------------
16:02:16.090 INFO: Total time: 1:10.743s
16:02:16.149 INFO: Final Memory: 38M/137M
16:02:16.149 INFO: ------------------------------------------------------------------------
16:02:16.149 ERROR: Error during SonarScanner execution
Failed to get CE Task status - No activity found for task 'AX-yXUIpYZn01BNPA1FR'
Process returned exit code 2
The SonarScanner did not complete successfully

```

Appears randomly, sometimes helps restarts, sometimes restart works from 2,3,4 try.  
This is how we run it:

```auto
 dotnet sonarscanner begin /o:XXX /k:$SONAR_CLOUD_PROJECT /d:sonar.host.url=https://sonarcloud.io /d:sonar.login=$SONAR_TOKEN /d:sonar.qualitygate.wait=true /d:sonar.cs.opencover.reportsPaths= **/coverage.opencover.xml /d:sonar.javascript.lcov.reportPaths=** /lcov.info /d:sonar.exclusions=$SONAR_EXCLUSIONS /d:sonar.cpd.exclusions=$SONAR_EXCLUSIONS_DUPLICATION /d:sonar.coverage.exclusions=$SONAR_EXCLUSIONS_COVERAGE /v:$VERSION
    dotnet build
    dotnet sonarscanner end /d:sonar.login=$SONAR_TOKEN

```

Analysis run in container, so no leftovers should be anywhere.

```auto
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine
ENV PATH "$PATH:/root/.dotnet/tools"
RUN apk update && apk add openjdk11 nodejs npm bash git openssh
RUN wget https://dot.net/v1/dotnet-install.sh
RUN chmod +x dotnet-install.sh
RUN ./dotnet-install.sh -c 5.0 --install-dir /usr/share/dotnet
RUN dotnet tool install --global dotnet-sonarscanner

```

---

<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:** [April 4, 2022, 1:00pm UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/16 "2022-04-04T13:00:00Z")

</div>

Hey all. This thread has been flagged for attention by our internal development team.

---

<div class="post-metadata">

**Author:** ![paulhobbel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/paulhobbel/32/31614_2.png) [@paulhobbel](https://community.sonarsource.com/u/paulhobbel)\
**Post date:** [April 5, 2022, 7:33am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/17 "2022-04-05T07:33:44Z")

</div>

We are also using GitLab CI, not sure if it’s a pattern

---

<div class="post-metadata">

**Author:** ![Matti\_van\_Aert](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/matti_van_aert/32/32280_2.png) [@Matti\_van\_Aert](https://community.sonarsource.com/u/Matti_van_Aert)\
**Post date:** [April 8, 2022, 11:54am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/18 "2022-04-08T11:54:51Z")

</div>

Hi @Colin

Could you give a suggestion for a workaround?

---

<div class="post-metadata">

**Author:** ![MoritzH](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/moritzh/32/32315_2.png) [@MoritzH](https://community.sonarsource.com/u/MoritzH)\
**Post date:** [April 11, 2022, 8:32am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/19 "2022-04-11T08:32:37Z")

</div>

Hello @Matti_van_Aert ,

not Colin, but my team currently uses `retry: 1` for our sonarcloud step in our pipeline. Very unpleasant as pipelines take a little longer, but a lot less manual overhead for retrying such failed steps. At least for now automatically created pipelines (e.g. by renovate) tend to fail less often.

Hope this helps. A non-flaky fix / workaround would be preferable though.

---

<div class="post-metadata">

**Author:** ![sehsanm](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sehsanm/32/32707_2.png) [@sehsanm](https://community.sonarsource.com/u/sehsanm)\
**Post date:** [April 25, 2022, 7:42am UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/20 "2022-04-25T07:42:25Z")

</div>

Hi @Colin,  
Is there a ticket or issue id to indicate if it is being worked on or not?

---

<div class="post-metadata">

**Author:** ![Samuel\_Loury](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/samuel_loury/32/32719_2.png) [@Samuel\_Loury](https://community.sonarsource.com/u/Samuel_Loury)\
**Post date:** [April 25, 2022, 12:40pm UTC](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060/21 "2022-04-25T12:40:27Z")

</div>

I’m having the same issue with a sonar-scanner call.  
Our gitlab job looks like this

```auto
sonarcloud-check:
  stage: sonar
  image:
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
  script:
    - sonar-scanner

```

And from time to time, it fails with

```auto
INFO: Analysis report generated in 193ms, dir size=310 KB
INFO: Analysis report compressed in 177ms, zip size=179 KB
INFO: Analysis report uploaded in 195ms
INFO: ------------- Check Quality Gate status
INFO: Waiting for the analysis report to be processed (max 300s)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 31.787s
INFO: Final Memory: 60M/143M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Failed to get CE Task status - No activity found for task 'XXXXXXXXXX'

```

[Next page](https://community.sonarsource.com/t/maven-plugin-fails-with-exception-when-trying-to-run-on-sonarcloud/59060.md?page=2)
