"The field 'exclusionRegex' does not exist" .. Sonar Cloud in Github actions stopped working

Hi, We’ve been running SonarCloud in Github Actions for a while now and with little issues. However now all of a sudden our Github action is breaking down.

It seems to be an issue on the SonarCloud side. Any ideas?

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonar'.
> The field 'exclusionRegex' does not exist or is not annotated with @RuleProperty in the class org.sonar.python.checks.StringLiteralDuplicationCheck

Full log:

Initialized native services in: /home/runner/.gradle/native
Initialized jansi services in: /home/runner/.gradle/native
Received JVM installation metadata from '/usr/lib/jvm/temurin-17-jdk-amd64': {JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64, JAVA_VERSION=17.0.8.1, JAVA_VENDOR=Eclipse Adoptium, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=17.0.8.1+1, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=17.0.8.1+1, VM_VENDOR=Eclipse Adoptium, OS_ARCH=amd64}
The client will now receive all logging from the daemon (pid: 2035). The daemon log file: /home/runner/.gradle/daemon/7.6/daemon-2035.out.log
Starting 2nd build in daemon [uptime: 1 mins 8.425 secs, performance: 100%, non-heap usage: 28% of 256 MiB]
Using 2 worker leases.
Closing daemon's stdin at end of input.
The daemon will no longer process any standard input.
Now considering [/home/runner/work/[ProjectName]/[ProjectName]] as hierarchies to watch
Watching the file system is configured to be enabled if available
Now considering [/home/runner/work/[ProjectName]/[ProjectName]] as hierarchies to watch
File system watching is active
Starting Build
Settings evaluated using settings file '/home/runner/work/[ProjectName]/[ProjectName]/settings.gradle'.
Projects loaded. Root project using build file '/home/runner/work/[ProjectName]/[ProjectName]/build.gradle'.
Included projects: [root project '[ProjectName]', project ':backend', project ':web']

> Configure project :
Evaluating root project '[ProjectName]' using build file '/home/runner/work/[ProjectName]/[ProjectName]/build.gradle'.

> Configure project :backend
Evaluating project ':backend' using build file '/home/runner/work/[ProjectName]/[ProjectName]/backend/build.gradle'.
Applying dependency management to configuration 'annotationProcessor' in project 'backend'
Applying dependency management to configuration 'apiElements' in project 'backend'
Applying dependency management to configuration 'archives' in project 'backend'
Applying dependency management to configuration 'bootArchives' in project 'backend'
Applying dependency management to configuration 'compileClasspath' in project 'backend'
Applying dependency management to configuration 'compileOnly' in project 'backend'
Applying dependency management to configuration 'default' in project 'backend'
Applying dependency management to configuration 'developmentOnly' in project 'backend'
Applying dependency management to configuration 'implementation' in project 'backend'
Applying dependency management to configuration 'mainSourceElements' in project 'backend'
Applying dependency management to configuration 'productionRuntimeClasspath' in project 'backend'
Applying dependency management to configuration 'runtimeClasspath' in project 'backend'
Applying dependency management to configuration 'runtimeElements' in project 'backend'
Applying dependency management to configuration 'runtimeOnly' in project 'backend'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'backend'
Applying dependency management to configuration 'testCompileClasspath' in project 'backend'
Applying dependency management to configuration 'testCompileOnly' in project 'backend'
Applying dependency management to configuration 'testImplementation' in project 'backend'
Applying dependency management to configuration 'testResultsElementsForTest' in project 'backend'
Applying dependency management to configuration 'testRuntimeClasspath' in project 'backend'
Applying dependency management to configuration 'testRuntimeOnly' in project 'backend'
Applying dependency management to configuration 'jacocoAgent' in project 'backend'
Applying dependency management to configuration 'jacocoAnt' in project 'backend'
Applying dependency management to configuration 'coverageDataElementsForTest' in project 'backend'

> Configure project :web
Evaluating project ':web' using build file '/home/runner/work/[ProjectName]/[ProjectName]/web/build.gradle'.
All projects evaluated.
Task name matched 'build'
Task name matched 'sonar'
Selected primary task 'build' from project :
Selected primary task 'sonar' from project :
Tasks to be executed: [task ':backend:compileJava', task ':backend:processResources', task ':backend:classes', task ':backend:resolveMainClassName', task ':backend:bootJar', task ':backend:jar', task ':backend:assemble', task ':backend:check', task ':backend:build', task ':backend:compileTestJava', task ':sonar']
Tasks that were excluded: [task ':backend:test']
Resolve mutations for :backend:compileJava (Thread[included builds,5,main]) started.
:backend:compileJava (Thread[included builds,5,main]) started.
destroyer locations for task group 0 (Thread[Execution worker,5,main]) started.

> Task :backend:compileJava UP-TO-DATE
Resolving global dependency management for project 'backend'
Excluding []
Excluding []
Caching disabled for task ':backend:compileJava' because:
  Build cache is disabled
Skipping task ':backend:compileJava' as it is up-to-date.
Resolve mutations for :backend:processResources (Thread[included builds,5,main]) started.
:backend:processResources (Thread[included builds,5,main]) started.

> Task :backend:processResources UP-TO-DATE
Caching disabled for task ':backend:processResources' because:
  Build cache is disabled
Skipping task ':backend:processResources' as it is up-to-date.
Resolve mutations for :backend:classes (Thread[included builds,5,main]) started.
:backend:classes (Thread[included builds,5,main]) started.

> Task :backend:classes UP-TO-DATE
Skipping task ':backend:classes' as it has no actions.
Resolve mutations for :backend:resolveMainClassName (Thread[included builds,5,main]) started.
:backend:resolveMainClassName (Thread[included builds,5,main]) started.

> Task :backend:resolveMainClassName
Watching 178 directories to track changes
Caching disabled for task ':backend:resolveMainClassName' because:
  Build cache is disabled
Task ':backend:resolveMainClassName' is not up-to-date because:
  No history is available.
Watching 177 directories to track changes
Watching 178 directories to track changes
Resolve mutations for :backend:bootJar (Thread[Execution worker,5,main]) started.
:backend:bootJar (Thread[Execution worker,5,main]) started.

> Task :backend:bootJar
Excluding []
Excluding []
Excluding []
Watching 179 directories to track changes
Watching 179 directories to track changes
Caching disabled for task ':backend:bootJar' because:
  Build cache is disabled
Task ':backend:bootJar' is not up-to-date because:
  No history is available.
Watching 179 directories to track changes
Watching 178 directories to track changes
Watching 179 directories to track changes
Resolve mutations for :backend:jar (Thread[Execution worker,5,main]) started.
producer locations for task group 0 (Thread[Execution worker,5,main]) started.
:backend:jar (Thread[included builds,5,main]) started.

> Task :backend:jar
Watching 180 directories to track changes
Watching 180 directories to track changes
Caching disabled for task ':backend:jar' because:
  Build cache is disabled
Task ':backend:jar' is not up-to-date because:
  No history is available.
Watching 180 directories to track changes
Watching 180 directories to track changes
Resolve mutations for :backend:assemble (Thread[included builds,5,main]) started.
:backend:assemble (Thread[included builds,5,main]) started.

> Task :backend:assemble
Skipping task ':backend:assemble' as it has no actions.
Resolve mutations for :backend:check (Thread[Execution worker,5,main]) started.
:backend:check (Thread[Execution worker,5,main]) started.

> Task :backend:check
Skipping task ':backend:check' as it has no actions.
Resolve mutations for :backend:build (Thread[Execution worker,5,main]) started.
:backend:build (Thread[Execution worker,5,main]) started.

> Task :backend:build
Skipping task ':backend:build' as it has no actions.
Resolve mutations for :backend:compileTestJava (Thread[Execution worker,5,main]) started.
producer locations for task group 1 (Thread[Execution worker,5,main]) started.
:backend:compileTestJava (Thread[Execution worker,5,main]) started.

> Task :backend:compileTestJava UP-TO-DATE
Excluding []
Excluding []
Caching disabled for task ':backend:compileTestJava' because:
  Build cache is disabled
Skipping task ':backend:compileTestJava' as it is up-to-date.
Resolve mutations for :sonar (Thread[included builds,5,main]) started.
:sonar (Thread[included builds,5,main]) started.

> Task :sonar
Caching disabled for task ':sonar' because:
  Build cache is disabled
Task ':sonar' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
User cache: /home/runner/.sonar/cache
Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
Load global settings
Load global settings (done) | time=399ms
Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
User cache: /home/runner/.sonar/cache
Loading required plugins
Load plugins index
Load plugins index (done) | time=392ms
Load/download plugins
Load/download plugins (done) | time=199ms
Loaded core extensions: developer-scanner
Found an active CI vendor: 'Github Actions'
Load project settings for component key: '[ProjectName]'
Load project settings for component key: '[ProjectName]' (done) | time=377ms
Process project properties
Execute project builders
Execute project builders (done) | time=1ms
Project key: [ProjectName]
Base dir: /home/runner/work/[ProjectName]/[ProjectName]
Working dir: /home/runner/work/[ProjectName]/[ProjectName]/build/sonar
Load project branches
Load project branches (done) | time=370ms
Check ALM binding of project '[ProjectName]'
Detected project binding: BOUND
Check ALM binding of project '[ProjectName]' (done) | time=358ms
Load project pull requests
Load project pull requests (done) | time=453ms
Load branch configuration
Github event: push
Auto-configuring branch master
Load branch configuration (done) | time=5ms
Load quality profiles
Load quality profiles (done) | time=413ms
Load active rules
Load active rules (done) | time=7201ms
Organization key: [organizationKey]
Branch name: master, type: long-lived
Load project repositories
Load project repositories (done) | time=389ms
Indexing files...
Project configuration:
  Excluded sources: **/build-wrapper-dump.json
Indexing files of module 'backend'
  Base dir: /home/runner/work/[ProjectName]/[ProjectName]/backend
  Source paths: src/main
  Test paths: src/test
  Excluded sources: **/build-wrapper-dump.json, src/main/resources/**
Indexing files of module 'web'
  Base dir: /home/runner/work/[ProjectName]/[ProjectName]/web
  Source paths: src
  Test paths: cypress
  Excluded sources: **/build-wrapper-dump.json, **/*.json, **/*.scss, **/*.module.ts, **/*.html
Indexing files of module '[ProjectName]'
  Base dir: /home/runner/work/[ProjectName]/[ProjectName]
  Excluded sources: **/build-wrapper-dump.json

263 files indexed

> Task :sonar
87 files ignored because of inclusion/exclusion patterns
2 files ignored because of scm ignore settings
Loading plugins for detected languages
Load/download plugins
Load/download plugins (done) | time=0ms
Quality profile for java: [Company Name]
Quality profile for json: Sonar way
Quality profile for ts: Sonar way
Quality profile for web: Sonar way
Quality profile for xml: Sonar way
------------- Run sensors on module backend
Load metrics repository
Load metrics repository (done) | time=357ms
Sensor cache enabled
Load sensor cache
Load sensor cache (401 KB) | time=1469ms


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonar'.
> The field 'exclusionRegex' does not exist or is not annotated with @RuleProperty in the class org.sonar.python.checks.StringLiteralDuplicationCheck

* Try:
> Run with --stacktrace option to get the stack trace.
> Task :sonar FAILED
7 actionable tasks: 4 executed, 3 up-to-date
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s
Error: Process completed with exit code 1.
1 Like

Having the same problem running in azure devops:
Sonarcloud analysis throws:

java.lang.IllegalStateException: The field 'exclusionRegex' does not exist or is not annotated with @RuleProperty in the class org.sonar.python.checks.StringLiteralDuplicationCheck
	at org.sonar.api.batch.rule.Checks.configureFields(Checks.java:170)
	at org.sonar.api.batch.rule.Checks.instantiate(Checks.java:154)
	at org.sonar.api.batch.rule.Checks.addAnnotatedChecks(Checks.java:128)
	at org.sonar.plugins.python.PythonChecks.addChecks(PythonChecks.java:41)
	at org.sonar.plugins.python.PythonSensor.<init>(PythonSensor.java:90)
	at org.sonar.plugins.python.PythonSensor.<init>(PythonSensor.java:79)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:606)
	at org.picocontainer.DefaultPicoContainer.getComponents(DefaultPicoContainer.java:587)
	at org.sonar.core.platform.ComponentContainer.getComponentsByType(ComponentContainer.java:282)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.completeScannerExtensions(AbstractExtensionDictionary.java:68)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getExtensions(AbstractExtensionDictionary.java:63)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getFilteredExtensions(AbstractExtensionDictionary.java:53)
	at org.sonar.scanner.sensor.ModuleSensorExtensionDictionary.selectSensors(ModuleSensorExtensionDictionary.java:39)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$0(ModuleSensorsExecutor.java:41)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:41)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

For me it failed another 2 times and now for some reason its working again… So flaky SonarCloud?

Same here. Failed twice. Now it works again.

It is failing for me using Gradle. after upgrading to the latest gradle plugin 4.4.0.3356

Hi,
we believe this was a temporary problem during a deployment.
Please let us know if you’re still experiencing this issue.

1 Like

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