{"record":{"id":"a944c3f6881ff742","repo":"oracle/graal","slug":"invalid-vm-option-s-specified-s","errorCode":null,"errorMessage":"Invalid VM option %s specified. %s","messagePattern":"Invalid VM option (.+?) specified\\. (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccessBuilder.java","lineNumber":224,"sourceCode":"                } catch (IOException e) {\n                    throw new IllegalArgumentException(\"Cannot use the specified log.file\", e);\n                }\n                builder.logHandler(out);\n                return;\n            }\n        }\n        OptionDescriptor descriptor = findOptionDescriptor(group, key);\n        if (descriptor == null) {\n            key = JAVA_LANGUAGE_ID + \".\" + key;\n            descriptor = findOptionDescriptor(JAVA_LANGUAGE_ID, key);\n            if (descriptor == null) {\n                throw new IllegalArgumentException(\"Unrecognized VM option: '\" + vmOption);\n            }\n        }\n        try {\n            descriptor.getKey().getType().convert(value);\n        } catch (IllegalArgumentException e) {\n            throw new IllegalArgumentException(String.format(\"Invalid VM option %s specified. %s\", vmOption, e.getMessage()));\n        }\n        builder.option(key, value);\n    }\n\n    private static OptionDescriptor findOptionDescriptor(String group, String key) {\n        OptionDescriptors descriptors = null;\n        switch (group) {\n            case \"engine\":\n            case \"compiler\":\n                descriptors = getTempEngine().getOptions();\n                break;\n            default:\n                Engine engine = getTempEngine();\n                if (engine.getLanguages().containsKey(group)) {\n                    descriptors = engine.getLanguages().get(group).getOptions();\n                } else if (engine.getInstruments().containsKey(group)) {\n                    descriptors = engine.getInstruments().get(group).getOptions();\n                }","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccessBuilder.java#L206-L242","documentation":"Thrown by EspressoExternalVMAccessBuilder after an option key was recognized: the raw string value failed descriptor.getKey().getType().convert(value). Each option has a typed key (boolean, enum, int, string...), so a syntactically valid key with a wrong-typed value is rejected with IllegalArgumentException including the convert error.","triggerScenarios":"Passing e.g. 'engine.Compilation=false' style mistakes like a non-numeric value to a numeric option, an unknown enum constant to an enum option, or 'yes'/'1' to a strictly boolean option expecting 'true'/'false'.","commonSituations":"Assuming loose truthy parsing ('yes', 'on', '1') for boolean options; passing arbitrary strings to enum-typed Espresso options; locale-specific number formats; values quoted incorrectly when options come from a properties file or shell.","solutions":["Read the option's declared type from its OptionDescriptor and supply the value in the exact expected syntax (booleans are 'true'/'false', enums use the exact constant name, numbers in plain decimal)","Strip surrounding quotes/whitespace that shells or properties loaders may have left in the value","Validate candidate values with the same convert() call in a pre-flight loop so all bad values are reported before the engine starts"],"exampleFix":"// before\nbuilder.option(\"engine.WarnInterpreterOnly\", \"no\"); // not a boolean literal\n\n// after\nbuilder.option(\"engine.WarnInterpreterOnly\", \"false\");","handlingStrategy":"validation","validationCode":"OptionDescriptor d = findOptionDescriptor(group, key);\nd.getKey().getType().convert(value); // pre-flight: throws the same convert error early with your context","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { include key, value, and the option's declared type in the error report }","preventionTips":["Type your own config layer (boolean/enum/int fields) so values are rendered in the exact option syntax","Never pass raw shell/properties values through untrimmed"],"tags":["espresso","configuration","vm-options","type-conversion"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}