{"record":{"id":"7d4cd905fe9ba103","repo":"apache/cassandra","slug":"invalid-keyspace-or-table-name","errorCode":null,"errorMessage":"Invalid keyspace or table name","messagePattern":"Invalid keyspace or table name","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":2894,"sourceCode":"    }\n\n    public void clearOrphanedCompressionDictionaries()\n    {\n        ssProxy.clearOrphanedCompressionDictionaries();\n    }\n\n    private CompressionDictionaryManagerMBean getDictionaryManagerProxy(String keyspace, String table) throws IOException\n    {\n        // Construct table-specific MBean name\n        String mbeanName = CompressionDictionaryManagerMBean.MBEAN_NAME + \",keyspace=\" + keyspace + \",table=\" + table;\n        try\n        {\n            ObjectName objectName = new ObjectName(mbeanName);\n            return JMX.newMBeanProxy(mbeanServerConn, objectName, CompressionDictionaryManagerMBean.class);\n        }\n        catch (MalformedObjectNameException e)\n        {\n            throw new IOException(\"Invalid keyspace or table name\", e);\n        }\n    }\n}\n\nclass ColumnFamilyStoreMBeanIterator implements Iterator<Map.Entry<String, ColumnFamilyStoreMBean>>\n{\n    private MBeanServerConnection mbeanServerConn;\n    Iterator<Entry<String, ColumnFamilyStoreMBean>> mbeans;\n\n    public ColumnFamilyStoreMBeanIterator(MBeanServerConnection mbeanServerConn)\n        throws MalformedObjectNameException, NullPointerException, IOException\n    {\n        this.mbeanServerConn = mbeanServerConn;\n        List<Entry<String, ColumnFamilyStoreMBean>> cfMbeans = getCFSMBeans(mbeanServerConn, \"ColumnFamilies\");\n        cfMbeans.addAll(getCFSMBeans(mbeanServerConn, \"IndexColumnFamilies\"));\n        Collections.sort(cfMbeans, new Comparator<Entry<String, ColumnFamilyStoreMBean>>()\n        {\n            public int compare(Entry<String, ColumnFamilyStoreMBean> e1, Entry<String, ColumnFamilyStoreMBean> e2)","sourceCodeStart":2876,"sourceCodeEnd":2912,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L2876-L2912","documentation":"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.","triggerScenarios":"Calling dictionary operations with keyspace/table values containing characters illegal in an JMX ObjectName property value (e.g. unescaped ':', ',', '=', '\"', '*', '?') or an empty/blank name.","commonSituations":"Scripted nodetool invocations passing raw/unescaped identifiers from shell variables; quoted identifiers with special characters; empty table name from a truncated command line.","solutions":["Check that keyspace and table names contain only [a-zA-Z0-9_] characters (or properly quote/escape them).","Ensure neither name is empty — inspect the full nodetool command line for missing arguments.","If the identifier legitimately contains special characters, use its quoted form correctly in CQL and verify how the tool interpolates it.","Wrap the call in try/catch for IOException and inspect getCause() for MalformedObjectNameException details."],"exampleFix":"// before\nString table = \"users:tmp\";   // illegal ':' in JMX ObjectName\nprobe.importCompressionDictionary(keyspace, table, ...);\n// after\nString table = \"users_tmp\";   // or escape ':' as '\\:' if truly needed","handlingStrategy":"validation","validationCode":"if (keyspace == null || table == null || keyspace.isBlank() || table.isBlank())\n    throw new IllegalArgumentException(\"keyspace and table are required\");\nif (!table.matches(\"[a-zA-Z0-9_]+\")) throw new IllegalArgumentException(\"Illegal JMX ObjectName character in table: \" + table);","typeGuard":"boolean validIdentifier(String s) { return s != null && s.matches(\"[a-zA-Z0-9_]+\"); }","tryCatchPattern":"try { probe.exportCompressionDictionary(ks, tbl); }\ncatch (IOException e) { if (e.getCause() instanceof MalformedObjectNameException) log.error(\"Bad identifier: ks={}, tbl={}\", ks, tbl); }","preventionTips":["Sanitize keyspace/table inputs in scripts calling nodetool","Avoid unquoted special characters in identifiers","Check for truncated/empty arguments in automation pipelines"],"tags":["jmx","nodetool","validation","objectname"],"backgroundTag":"invalid-identifier-format","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}