elastic/elasticsearch · error · IllegalStateException
Elasticsearch could not determine the origin of JVM option [
Error message
Elasticsearch could not determine the origin of JVM option [%s]. This indicates that it is running in an unsupported configuration.
What it means
Thrown by the JvmOption constructor when the origin argument is null. Every JVM option must be attributable to a source (jvm.options file, ES_JAVA_OPTS, vendor defaults, etc.); a null origin indicates the option came from an unknown/untracked source, signalling an unsupported ES configuration.
Source
Thrown at distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/JvmOption.java:38
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
class JvmOption {
private final String value;
private final String origin;
JvmOption(String value, String origin) {
if (origin == null) {
throw new IllegalStateException(Strings.format("""
Elasticsearch could not determine the origin of JVM option [%s]. \
This indicates that it is running in an unsupported configuration.""", value));
}
this.value = value;
this.origin = origin;
}
public Optional<String> getValue() {
return Optional.ofNullable(value);
}
public String getMandatoryValue() {
return value;
}
public boolean isCommandLineOrigin() {
return this.origin.contains("command line");
}View on GitHub (pinned to db6a809a66)
Solutions
- Check the stack trace to see which call site built the JvmOption with null origin.
- Restore the standard jvm.options file structure under config/jvm.options and vendor variants.
- Avoid custom JVM injection mechanisms that bypass the documented ES_JAVA_OPTS / jvm.options path.
Example fix
// before
new JvmOption("-Xmx2g", null);
// after
new JvmOption("-Xmx2g", "config/jvm.options"); Defensive patterns
Strategy: validation
Validate before calling
if (origin == null || origin.isBlank()) {
throw new IllegalArgumentException("JvmOption origin must be non-null and non-blank for value: " + value);
} Prevention
- Always pass a concrete origin string when constructing JvmOption.
- Keep the standard jvm.options / ES_JAVA_OPTS pipeline intact in forks.
- Unit-test any custom option source to ensure origin is set.
When it happens
Trigger: Internal: code constructing JvmOption(value, null). This is an invariant violation in the JVM-option collection pipeline — the origin-tracking code path failed to record where the option came from.
Common situations: Running ES with a non-standard jvm.options layout the parser cannot attribute; a fork that injects JVM options without setting origin; a bug in vendor-options or ES_JAVA_OPTS handling that loses the origin string.
Related errors
- 78
- Invalid jvm argument `{}` configure as systemProperty instea
- Template property '{}' not found in template: {}
- could not create the default ssl context
- Bootstrapping cluster secrets in file settings is not suppor
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/6cbf220196882e4e.
Report an issue: GitHub.