apache/cassandra · error · RuntimeException

Invalid ObjectName format:

Error message

Invalid ObjectName format: 

What it means

RuntimeException thrown by NodeProbe.getSaiMetric when the formatted ObjectName string for a StorageAttachedIndex metric is not a valid ObjectName (MalformedObjectNameException), typically due to keyspace/table/metric names containing characters illegal in JMX ObjectName values.

Solutions

  1. Quote keyspace/table names with special characters (use ObjectName.quote) before building the name
  2. Validate the metric name passed to nodetool sai metrics commands
  3. Catch and report the malformed name to the caller instead of crashing the tool
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/tools/NodeProbe.java:2052 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/66e1be068491df20. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/NodeProbe.java:2052

    }

    public Object getSaiMetric(String ks, String cf, String metricName)
    {
        try
        {
            String scope = getSaiMetricScope(metricName);
            String objectNameStr = String.format("org.apache.cassandra.metrics:type=StorageAttachedIndex,keyspace=%s,table=%s,scope=%s,name=%s",ks, cf, scope, metricName);
            ObjectName oName = new ObjectName(objectNameStr);

            Set<ObjectName> matchingMBeans = mbeanServerConn.queryNames(oName, null);
            if (matchingMBeans.isEmpty())
                return null;

            return getSaiMetricValue(metricName, oName);
        }
        catch (MalformedObjectNameException e)
        {
            throw new RuntimeException("Invalid ObjectName format: " + e.getMessage(), e);
        }
        catch (IOException e)
        {
            throw new RuntimeException("Error accessing MBean server: " + e.getMessage(), e);
        }
    }

    private Object getSaiMetricValue(String metricName, ObjectName oName) throws IOException
    {
        switch (metricName)
        {
            case "QueryLatency":
                return JMX.newMBeanProxy(mbeanServerConn, oName, CassandraMetricsRegistry.JmxTimerMBean.class);
            case "PostFilteringReadLatency":
            case "SSTableIndexesHit":
            case "IndexSegmentsHit":
            case "RowsFiltered":
                return JMX.newMBeanProxy(mbeanServerConn, oName, CassandraMetricsRegistry.JmxHistogramMBean.class);

View on GitHub (pinned to 88fd0f6a0e)