# Last analysis failed Analysis ID "AYsTYnmNNXFJNM1ID3pa"

**URL:** <https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216>\
**Category:** SonarQube Cloud\
**Tags:** autoscan\
**Created:** [October 9, 2023, 7:56am UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216 "2023-10-09T07:56:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgusev-dodo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dgusev-dodo/32/50183_2.png) [@dgusev-dodo](https://community.sonarsource.com/u/dgusev-dodo)\
**Post date:** [October 9, 2023, 7:56am UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/1 "2023-10-09T07:56:57Z")

</div>

Hi,

I have added the ‘.sonarcloud.properties’ to the repository and scanned the pull request. The only following lines have values:

sonar.sources=src/Application/,src/Infrastructure/  
sonar.tests=src/Tests/  
sonar.sourceEncoding=UTF-8

All other ones from the example of the “supported optional settings” are left commented.

Please, explain what might be wrong with the ‘.sonarcloud.properties’ file.

Thanks,  
Dmitry

---

<div class="post-metadata">

**Author:** ![ismail.cherri](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ismail.cherri/32/39688_2.png) [@ismail.cherri](https://community.sonarsource.com/u/ismail.cherri)\
**Post date:** [October 10, 2023, 7:21am UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/4 "2023-10-10T07:21:39Z")

</div>

Hi @dgusev-dodo

Welcome to Sonar Community!

I checked the logs for this specific analysis, and I got the following error:

```auto
ERROR: File src/Tests/Dodo.Cdp.Contract.Tests/MissionsControllerTests.cs can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

```

It seems that you have some configuration issues.  
Please check the [Automatic Analysis documentation](https://docs.sonarcloud.io/advanced-setup/automatic-analysis/#prerequisites) for more information.

Regards,  
Ismail

---

<div class="post-metadata">

**Author:** ![dgusev-dodo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dgusev-dodo/32/50183_2.png) [@dgusev-dodo](https://community.sonarsource.com/u/dgusev-dodo)\
**Post date:** [October 10, 2023, 3:53pm UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/5 "2023-10-10T15:53:12Z")

</div>

Hi Ismail,

I tried the different variations of inclusions/exclusions but with no luck. For example, the following SonarCloud config file ‘.sonarcloud.properties’ resulted in the error with the analysis id “AYsaID5tifp0njjVd9u2”:

```auto
sonar.sources=.
sonar.inclusions= **/src/Application/** /*, **/src/Infrastructure/** /*, **/src/Jobs/** /*
sonar.tests=.
sonar.test.inclusions= **/src/Tests/** /*

```

The Analysis Method is set to the recommended ‘Automatic’.

Could you, please, tell what is in the logs for the mentioned analysis id?

Thanks,  
Dmitry

---

<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:** [October 10, 2023, 4:04pm UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/6 "2023-10-10T16:04:03Z")

</div>

Hi Dimitry,

What’s the actual structure of your project? Do you actually have multiple directories named `src`?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![dgusev-dodo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dgusev-dodo/32/50183_2.png) [@dgusev-dodo](https://community.sonarsource.com/u/dgusev-dodo)\
**Post date:** [October 11, 2023, 8:35am UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/7 "2023-10-11T08:35:19Z")

</div>

Hi,

No, we have only one ‘src’ folder. The actual structure is the following:

```auto
<solution root folder> (file '.sonarcloud.properties' is here)
    |
    –– src
        |
        –– Application
        | |
        | –– ...
        |
        –– Infrastructure
        | |
        | –– ...
        |
        –– Jobs
        | |
        | –– ...
        |
        –– Tests
               |
               –– ...

```

My last attempt was with the following contents of the ‘.sonarcloud.properties’ file:

```auto
sonar.sources=src/
sonar.inclusions= **/Application/** /*, **/Infrastructure/** /*, **/Jobs/** /*
sonar.tests=src/
sonar.test.inclusions= **/Tests/** /*

```

The analysis failed and the ID is “AYsd2UjHw\_JyBggBRx3j”.

---

<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:** [October 11, 2023, 12:16pm UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/8 "2023-10-11T12:16:42Z")

</div>

Hi,

Thanks for the detail. This is helpful and means your config can be simplified. First, `sonar.sources` takes a comma-delimited list of directories, so:

```auto
sonar.sources=src/Application,src/Infrastructure,src/Jobs

```

That automatically omits the `src/Tests` directory from your source file specification, leaving you to set tests like so:

```auto
sonar.tests=src/Tests

```

And those two properties, together, should be all you need.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![dgusev-dodo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dgusev-dodo/32/50183_2.png) [@dgusev-dodo](https://community.sonarsource.com/u/dgusev-dodo)\
**Post date:** [October 11, 2023, 1:04pm UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/9 "2023-10-11T13:04:32Z")

</div>

OK, I have tried the following ‘.sonarcloud.properties’ file contents:

```auto
# Path to sources
sonar.sources=src/Application,src/Infrastructure,src/Jobs
# Path to tests
sonar.tests=src/Tests

```

The analysis starts, works for some time and then fails.  
The Analysis ID “AYsevK39315j01d39xET”.  
Do you see something unusual in the logs?

---

<div class="post-metadata">

**Author:** ![ismail.cherri](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ismail.cherri/32/39688_2.png) [@ismail.cherri](https://community.sonarsource.com/u/ismail.cherri)\
**Post date:** [October 12, 2023, 7:14am UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/11 "2023-10-12T07:14:54Z")

</div>

> [@dgusev-dodo](#):
>
> AYsevK39315j01d39xET

For the quotes analysis ID, the error is still the same:

```auto
ERROR: File src/Tests/Dodo.Cdp.Unit.Tests/ImportMailingsFromMindboxJob/TryGetStartEndTimeTests.cs can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

```

I need to check with my team regarding the current values you have in the `.sonarcoud.properties` file and I’ll get back to you.

Meanwhile, did the project was ever analyzed successfully before? Also, can you try without the properties file?

Regards,  
Ismail

---

<div class="post-metadata">

**Author:** ![dgusev-dodo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dgusev-dodo/32/50183_2.png) [@dgusev-dodo](https://community.sonarsource.com/u/dgusev-dodo)\
**Post date:** [October 12, 2023, 10:12am UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/12 "2023-10-12T10:12:15Z")

</div>

Hi Ismail,

Yes, this project can be successfully analyzed without the ‘.sonarcloud.properties’ file but there is no coverage and unit-tests statistics information in the report. All previous pull requests have the SonarCloud analysis succeeded.

Our current task is to setup the unit tests analysis and then tests coverage. So, I am creating pull requests with the different ‘.sonarcloud.properties’ file and want to find their analysis report in SonarCloud but the report is not generated because of the mentioned errors.

Thanks,  
Dmitry

---

<div class="post-metadata">

**Author:** ![ismail.cherri](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ismail.cherri/32/39688_2.png) [@ismail.cherri](https://community.sonarsource.com/u/ismail.cherri)\
**Post date:** [October 12, 2023, 12:47pm UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/13 "2023-10-12T12:47:19Z")

</div>

Hi @dgusev-dodo,

After checking with my team, I have this suggestion:

```auto
sonar.sources=src
sonar.tests=src
sonar.test.inclusions=src/ **/Tests/**
sonar.exclusions=src/ **/Tests/**

```

The idea is to “include” the tests under `test` but “exclude” them from “sources”.  
And no need to add separate “inclusions” after this.

Let me know if this works for you.

Regards,  
Ismail

---

<div class="post-metadata">

**Author:** ![dgusev-dodo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dgusev-dodo/32/50183_2.png) [@dgusev-dodo](https://community.sonarsource.com/u/dgusev-dodo)\
**Post date:** [October 13, 2023, 12:08pm UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/20 "2023-10-13T12:08:19Z")

</div>

Hi Ismail,

I tried the 3 variants of the ‘.sonarcloud.properties’ file with different asterisk placement but none of them was working:

```auto
# Path to sources
sonar.sources=src
sonar.exclusions=src/Tests/**
# Path to tests
sonar.tests=src
sonar.test.inclusions=src/Tests/**

```

Then another one:

```auto
# Path to sources
sonar.sources=src
sonar.exclusions=src/Tests/**/*
# Path to tests
sonar.tests=src
sonar.test.inclusions=src/Tests/**/*

```

The Analysis ID “AYsl6G\_5nndIN11d\_81x”

And the last one:

```auto
# Path to sources
sonar.sources=src
sonar.exclusions=src/ **/Tests/** /*
# Path to tests
sonar.tests=src
sonar.test.inclusions=src/ **/Tests/** /*

```

The Analysis ID “AYsl9WkeuWFg2q-76Zky”

After that I re-read the documentation about the ‘Automatic Analysis’: [Automatic Analysis | SonarCloud Docs](https://docs.sonarcloud.io/advanced-setup/automatic-analysis/) and noticed a paragraph about not supported Code coverage information.

The Code coverage is our final goal, so we will switch to the CI-based analysis.

Thank you for the support!  
Dmitry

---

<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:** [October 13, 2023, 1:34pm UTC](https://community.sonarsource.com/t/last-analysis-failed-analysis-id-aystynmnnxfjnm1id3pa/102216/21 "2023-10-13T13:34:58Z")

</div>

Hi Dmitry,

I would be really interested to understand what patterns finally work in your CI-based analysis. I believe the patterns I gave you should have worked and I’m wondering if there’s something going on in automatic analysis.

&nbsp;  
Thx,  
Ann
