Skip to content

k8s incompability. #211

@jmormal

Description

@jmormal

Title: Crash on startup: NullPointerException in CgroupV2Subsystem (Cgroup v2 incompatibility)

Description

When deploying Mintaka (both 0.6.18 and 0.7.0) on a Kubernetes cluster with Cgroup v2 enabled, the application crashes immediately on startup due to a NullPointerException in the Java Runtime's Cgroup v2 detection logic.

This appears to be caused by the Micronaut metrics system trying to read system limits using a JDK version that has incomplete or buggy support for the host's Cgroup v2 layout.

Steps to Reproduce

  1. Deploy quay.io/fiware/mintaka:0.7.0 on a Kubernetes cluster (e.g., Minikube, K3s, or standard K8s v1.25+) running on a Linux host with Cgroup v2 enabled.
  2. Observe the pod logs.

Observed Logs

mintaka     at io.micronaut.runtime.Micronaut.run(Micronaut.java:323)
mintaka     at org.fiware.mintaka.Application.main(Application.java:29)
mintaka Caused by: java.lang.NullPointerException: Cannot invoke "jdk.internal.platform.CgroupInfo.getMountPoint()" because "anyController" is null
mintaka     at java.base/jdk.internal.platform.cgroupv2.CgroupV2Subsystem.getInstance(CgroupV2Subsystem.java:80)
mintaka     at java.base/jdk.internal.platform.CgroupSubsystemFactory.create(CgroupSubsystemFactory.java:114)
mintaka     at java.base/jdk.internal.platform.CgroupMetrics.getInstance(CgroupMetrics.java:177)
mintaka     at java.base/jdk.internal.platform.SystemMetrics.instance(SystemMetrics.java:29)
...
mintaka     at io.micrometer.core.instrument.binder.system.ProcessorMetrics.<init>(ProcessorMetrics.java:81)

Environment
Mintaka Version: 0.7.0 (and 0.6.18)

Orchestrator: Kubernetes (Cgroup v2 enabled)

Java Runtime: (As provided in the Docker image)

Workaround
Forcing the Micronaut metrics to be disabled prevents the crash:

YAML

env:

  • name: MICRONAUT_METRICS_ENABLED
    value: "false"
    Suggested Fix
    This seems to be related to an older JDK bug (e.g., JDK-8287073).

Please verify if the base Docker image can be updated to a more recent patch version of OpenJDK (JDK 17.0.5+ or JDK 21) that fully supports Cgroup v2.

Alternatively, handle the NullPointerException in the metrics initialization so the app does not crash if metrics cannot be gathered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions