apache/cassandra · error · IOException

Invalid keyspace or table name

Error message

Invalid keyspace or table name

What it means

NodeProbe builds an ObjectName for the per-table CompressionDictionaryManager MBean using the supplied keyspace/table. If the name is malformed (MalformedObjectNameException), it throws an IOException('Invalid keyspace or table name') with the cause attached. This is a client-side validation failure of the MBean name string.

Source

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

    }

    public void clearOrphanedCompressionDictionaries()
    {
        ssProxy.clearOrphanedCompressionDictionaries();
    }

    private CompressionDictionaryManagerMBean getDictionaryManagerProxy(String keyspace, String table) throws IOException
    {
        // Construct table-specific MBean name
        String mbeanName = CompressionDictionaryManagerMBean.MBEAN_NAME + ",keyspace=" + keyspace + ",table=" + table;
        try
        {
            ObjectName objectName = new ObjectName(mbeanName);
            return JMX.newMBeanProxy(mbeanServerConn, objectName, CompressionDictionaryManagerMBean.class);
        }
        catch (MalformedObjectNameException e)
        {
            throw new IOException("Invalid keyspace or table name", e);
        }
    }
}

class ColumnFamilyStoreMBeanIterator implements Iterator<Map.Entry<String, ColumnFamilyStoreMBean>>
{
    private MBeanServerConnection mbeanServerConn;
    Iterator<Entry<String, ColumnFamilyStoreMBean>> mbeans;

    public ColumnFamilyStoreMBeanIterator(MBeanServerConnection mbeanServerConn)
        throws MalformedObjectNameException, NullPointerException, IOException
    {
        this.mbeanServerConn = mbeanServerConn;
        List<Entry<String, ColumnFamilyStoreMBean>> cfMbeans = getCFSMBeans(mbeanServerConn, "ColumnFamilies");
        cfMbeans.addAll(getCFSMBeans(mbeanServerConn, "IndexColumnFamilies"));
        Collections.sort(cfMbeans, new Comparator<Entry<String, ColumnFamilyStoreMBean>>()
        {
            public int compare(Entry<String, ColumnFamilyStoreMBean> e1, Entry<String, ColumnFamilyStoreMBean> e2)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Check that keyspace and table names contain only [a-zA-Z0-9_] characters (or properly quote/escape them).
  2. Ensure neither name is empty — inspect the full nodetool command line for missing arguments.
  3. If the identifier legitimately contains special characters, use its quoted form correctly in CQL and verify how the tool interpolates it.
  4. Wrap the call in try/catch for IOException and inspect getCause() for MalformedObjectNameException details.

Example fix

// before
String table = "users:tmp";   // illegal ':' in JMX ObjectName
probe.importCompressionDictionary(keyspace, table, ...);
// after
String table = "users_tmp";   // or escape ':' as '\:' if truly needed
Defensive patterns

Strategy: validation

Validate before calling

if (keyspace == null || table == null || keyspace.isBlank() || table.isBlank())
    throw new IllegalArgumentException("keyspace and table are required");
if (!table.matches("[a-zA-Z0-9_]+")) throw new IllegalArgumentException("Illegal JMX ObjectName character in table: " + table);

Type guard

boolean validIdentifier(String s) { return s != null && s.matches("[a-zA-Z0-9_]+"); }

Try / catch

try { probe.exportCompressionDictionary(ks, tbl); }
catch (IOException e) { if (e.getCause() instanceof MalformedObjectNameException) log.error("Bad identifier: ks={}, tbl={}", ks, tbl); }

Prevention

When it happens

Trigger: Calling dictionary operations with keyspace/table values containing characters illegal in an JMX ObjectName property value (e.g. unescaped ':', ',', '=', '"', '*', '?') or an empty/blank name.

Common situations: Scripted nodetool invocations passing raw/unescaped identifiers from shell variables; quoted identifiers with special characters; empty table name from a truncated command line.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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