{"record":{"id":"6cbf220196882e4e","repo":"elastic/elasticsearch","slug":"elasticsearch-could-not-determine-the-origin-of-jv","errorCode":null,"errorMessage":"Elasticsearch could not determine the origin of JVM option [%s]. This indicates that it is running in an unsupported configuration.","messagePattern":"Elasticsearch could not determine the origin of JVM option \\[(.+?)\\]\\. This indicates that it is running in an unsupported configuration\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/JvmOption.java","lineNumber":38,"sourceCode":"import java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.function.Function;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\n\nclass JvmOption {\n    private final String value;\n    private final String origin;\n\n    JvmOption(String value, String origin) {\n        if (origin == null) {\n            throw new IllegalStateException(Strings.format(\"\"\"\n                Elasticsearch could not determine the origin of JVM option [%s]. \\\n                This indicates that it is running in an unsupported configuration.\"\"\", value));\n        }\n        this.value = value;\n        this.origin = origin;\n    }\n\n    public Optional<String> getValue() {\n        return Optional.ofNullable(value);\n    }\n\n    public String getMandatoryValue() {\n        return value;\n    }\n\n    public boolean isCommandLineOrigin() {\n        return this.origin.contains(\"command line\");\n    }","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/JvmOption.java#L20-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nnew JvmOption(\"-Xmx2g\", null);\n\n// after\nnew JvmOption(\"-Xmx2g\", \"config/jvm.options\");","handlingStrategy":"validation","validationCode":"if (origin == null || origin.isBlank()) {\n    throw new IllegalArgumentException(\"JvmOption origin must be non-null and non-blank for value: \" + value);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["jvm","jvm-options","internal","invariant"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}