KwaXi
KwaXi

Reputation: 149

SonarQube settings appear to be empty on reload due to reverse proxy misconfiguration

Originally it seemed that after a SonarQube Scanner for MSBuild analysis the server-side configured sonar.exclusions settings where cleared.

After some investigation it turned out that on page load of the Administration page an http 404.15 occured (in the SonarQube Web UI red alert is shown that a failed request occured which disappears quickly).

In our case we could solve the problem with adapting the configuration of the used IIS reverse proxy, specifically the request filtering module (if installed) has to allow a query string a larger than default. In our case 4096 seems to work.

Upvotes: 1

Views: 281

Answers (1)

chriswatts
chriswatts

Reputation: 31

I think how to exclude with MSBuild depends on what you are trying to exclude. I was only able to exclude an entire project by using the property group in the csproj.

  <PropertyGroup>
    <!-- Exclude this project from analysis -->
    <SonarQubeExclude>true</SonarQubeExclude>
  </PropertyGroup>

However I was able to successfully exclude files and groups of files with the sonar.exclusions settings through the SonarQube UI (project administration, analysis scope, files). The pattern that I could get to work was **/folder1/folder2/file where folder1 is the first folder inside your project root (not solution root). Adding what you are trying to exclude would help me be more specific on my answer.

Upvotes: 2

Related Questions