Skip to content

PREQ-4234 Propagate -XX:-UseContainerSupport to SonarQube child process JVMs#218

Closed
SamirM-BE wants to merge 1 commit intomasterfrom
feat/smarini/PREQ-4234/config-maven-sonar-child-jvm-opts
Closed

PREQ-4234 Propagate -XX:-UseContainerSupport to SonarQube child process JVMs#218
SamirM-BE wants to merge 1 commit intomasterfrom
feat/smarini/PREQ-4234/config-maven-sonar-child-jvm-opts

Conversation

@SamirM-BE
Copy link
Contributor

Summary

On GitHub-hosted Ubuntu runners, config-maven already sets JAVA_TOOL_OPTIONS=-XX:-UseContainerSupport to work around a Java cgroup detection bug triggered by recent kernel upgrades (6.12+). However, SonarQube's App process explicitly strips JAVA_TOOL_OPTIONS before spawning its child processes (Elasticsearch, Web Server, Compute Engine), making the workaround ineffective for Orchestrator-managed SonarQube instances in integration tests.

This results in the following NPE when Elasticsearch starts:

Caused by: java.lang.NullPointerException: Cannot invoke "jdk.internal.platform.CgroupInfo.getMountPoint()" because "anyController" is null
    at jdk.internal.platform.cgroupv2.CgroupV2Subsystem.getInstance(CgroupV2Subsystem.java:81)

SonarQube logs the root cause explicitly:

JAVA_TOOL_OPTIONS is defined but will be ignored. Use properties sonar.*.javaOpts and/or sonar.*.javaAdditionalOpts

Change

Alongside the existing JAVA_TOOL_OPTIONS line, also set the SonarQube-specific env vars that SonarQube does forward to each child JVM:

  • SONAR_SEARCH_JAVAADDITIONALOPTS → Elasticsearch JVM
  • SONAR_WEB_JAVAADDITIONALOPTS → Web Server JVM
  • SONAR_CE_JAVAADDITIONALOPTS → Compute Engine JVM

All three use the same ${VAR:=default} pattern so they don't override values already set by the caller.

Related

  • PREQ-4234
  • Reproducer: sonarlint-core QA job SQLts99 on runner image ubuntu24/20260209.23.1 (kernel 6.14)

Test plan

  • Verify QA (SQLts99) passes on a repo using config-maven@v1 after this is released

Made with Cursor

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Feb 18, 2026

PREQ-4234

Co-authored-by: Cursor <cursoragent@cursor.com>
@SamirM-BE SamirM-BE force-pushed the feat/smarini/PREQ-4234/config-maven-sonar-child-jvm-opts branch from 98df0e7 to 96ddad0 Compare February 18, 2026 16:33
@SamirM-BE SamirM-BE closed this Feb 18, 2026
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant