# ERROR: File src/API/.dockerignore can't be indexed twice. Please check that inclusion/exclusion patt

**URL:** <https://community.sonarsource.com/t/error-file-src-api-dockerignore-cant-be-indexed-twice-please-check-that-inclusion-exclusion-patt/143197>\
**Category:** SonarQube Server / Community Build\
**Tags:** scanner\
**Created:** [June 22, 2025, 11:33pm UTC](https://community.sonarsource.com/t/error-file-src-api-dockerignore-cant-be-indexed-twice-please-check-that-inclusion-exclusion-patt/143197 "2025-06-22T23:33:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![toyin5](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@toyin5](https://community.sonarsource.com/u/toyin5)\
**Post date:** [June 22, 2025, 11:33pm UTC](https://community.sonarsource.com/t/error-file-src-api-dockerignore-cant-be-indexed-twice-please-check-that-inclusion-exclusion-patt/143197/1 "2025-06-22T23:33:05Z")

</div>

Hello guys,

I’m trying to run some analysis on my local machine. So I installed the sonarscanner tool from `dotnet tool install`. I also set up the sonarqube server where I created a project and generated a token.

This is my project structure:

```bash
$ ls
Application.UnitTests/ azure-pipelines-pullrequest.yml README.md src/
azure-pipelines-deps.yml Flowmono.ProcessService.sln ReventEmailTemplate/
azure-pipelines-main.yml helm/ ReventInject/

```

The src directory contains:

```bash
$ ls src/
API/ Application/ Domain/ Infrastructure/

```

The API is the entrypoint to the project.

The test directory is inside the root directory. The `Application.UnitTests`.

Trying to run the sonarscanner using this command:

```bash
> dotnet sonarscanner begin /k:"flowmono-process" /d:sonar.host.url="http://localhost:9009" /d:sonar.token="squ_3bb4f7891a87a1891cef0ce93ba7bef95c70727e"

```

Which I get this

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/c/a/cac0483b89a9e902282447c221a49a5a34cb8523.png)

Then I run `dotnet build` which was successful. Then I run the end command:

```bash
> dotnet sonarscanner end /d:sonar.token="squ_3bb4f7891a87a1891cef0ce93ba7bef95c70727e"

```

Which gave me this error:

```bash
INFO: Indexing files...
INFO: Project configuration:
INFO: Indexing files of module 'Application.UnitTests'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService\Application.UnitTests
INFO: Test paths: obj/Application.UnitTests.csproj.nuget.dgspec.json, obj/Process...
INFO: Indexing files of module 'ReventInject'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService\ReventInject
INFO: Source paths: App.config, packages.config, obj/project.assets.json, obj/Rev...
INFO: Indexing files of module 'Domain'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService\src\Domain
INFO: Source paths: obj/Domain.csproj.nuget.dgspec.json, obj/project.assets.json,...
INFO: Indexing files of module 'Infrastructure'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService\src\Infrastructure
INFO: Source paths: obj/Infrastructure.csproj.nuget.dgspec.json, obj/project.asse...
INFO: Indexing files of module 'Application'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService\src\Application
INFO: Source paths: obj/Application.csproj.nuget.dgspec.json, obj/project.assets....
INFO: Indexing files of module 'ReventEmailTemplate'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService\ReventEmailTemplate
INFO: Source paths: DependencyInjection.cs, Models/EmailTemplate.cs, Program.cs, ...
INFO: Indexing files of module 'API'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService\src\API
INFO: Source paths: appsettings.Development.json, appsettings.json, Dockerfile, D...
INFO: Indexing files of module 'flowmono-process'
INFO: Base dir: C:\Users\Toyin Muhammed\Desktop\Flowmono\Flowmono.ProcessService
INFO: Source paths: src
INFO: Test paths: Application.UnitTests
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 17.129s
INFO: Final Memory: 10M/37M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: File src/API/.dockerignore can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
ERROR:
The SonarScanner did not complete successfully
00:30:23.902 Post-processing failed. Exit code: 1

```

I’ve tried specifying the sonar.sources and sonar.test but they are getting ignored due to the version that I’m on.

How do I resolve this

---

<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 24, 2025, 12:12pm UTC](https://community.sonarsource.com/t/error-file-src-api-dockerignore-cant-be-indexed-twice-please-check-that-inclusion-exclusion-patt/143197/2 "2025-06-24T12:12:04Z")

</div>

Hi,

Welcome to the community!

First, I hope you’ve already revoked that token. 😅

Regarding the problem, can you check to see if you have any inclusions / exclusions set in the UI?

&nbsp;  
Ann
