apache/hadoop · error · IllegalArgumentException
Invalid JMX query: "{}" against NameNode URI: {}
Error message
Invalid JMX query: "{}" against NameNode URI: {} What it means
Error "Invalid JMX query: "{}" against NameNode URI: {}" thrown in apache/hadoop.
Source
Thrown at hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/DynoInfraUtils.java:548
/**
* Fetch a value from the launched NameNode's JMX.
*
* @param nameNodeProperties The set of properties containing information
* about the NameNode.
* @param jmxBeanQuery The JMX bean query to execute; should return a
* JMX property matching {@code jmxProperty}.
* @param property The name of the JMX property whose value should be polled.
* @return The value associated with the property.
*/
static String fetchNameNodeJMXValue(Properties nameNodeProperties,
String jmxBeanQuery, String property) throws IOException {
URI nnWebUri = getNameNodeWebUri(nameNodeProperties);
URL queryURL;
try {
queryURL = new URL(nnWebUri.getScheme(), nnWebUri.getHost(),
nnWebUri.getPort(), "/jmx?qry=" + jmxBeanQuery);
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Invalid JMX query: \"" + jmxBeanQuery
+ "\" against " + "NameNode URI: " + nnWebUri);
}
HttpURLConnection conn = (HttpURLConnection) queryURL.openConnection();
if (conn.getResponseCode() != 200) {
throw new IOException(
"Unable to retrieve JMX: " + conn.getResponseMessage());
}
InputStream in = conn.getInputStream();
JsonFactory fac = new JsonFactory();
JsonParser parser = fac.createParser(in);
if (parser.nextToken() != JsonToken.START_OBJECT
|| parser.nextToken() != JsonToken.FIELD_NAME
|| !parser.getCurrentName().equals("beans")
|| parser.nextToken() != JsonToken.START_ARRAY
|| parser.nextToken() != JsonToken.START_OBJECT) {
throw new IOException(
"Unexpected format of JMX JSON response for: " + jmxBeanQuery);
}View on GitHub (pinned to 2add963021)
Solutions
- Fix the JMX query string so it is a valid query against the NameNode JMX endpoint (check bean name and attribute).
When it happens
Trigger: A JMX query issued against the NameNode is syntactically invalid or targets an unsupported operation, so the HttpURLConnection to the /jmx endpoint cannot be opened correctly.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/27f2705c46f0cdbc.
Report an issue: GitHub.