{"record":{"id":"eb7b8773ad2d6442","repo":"apache/cassandra","slug":"invalid-index-specified-s-s","errorCode":null,"errorMessage":"Invalid index specified: %s/%s.","messagePattern":"Invalid index specified: (.+?)/(.+?)\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/Keyspace.java","lineNumber":648,"sourceCode":"        }\n\n        // include the specified stores and possibly the stores of any of their indexes\n        for (String cfName : cfNames)\n        {\n            if (SecondaryIndexManager.isIndexColumnFamily(cfName))\n            {\n                if (!allowIndexes)\n                {\n                    logger.warn(\"Operation not allowed on secondary Index table ({})\", cfName);\n                    continue;\n                }\n                String baseName = SecondaryIndexManager.getParentCfsName(cfName);\n                String indexName = SecondaryIndexManager.getIndexName(cfName);\n\n                ColumnFamilyStore baseCfs = getColumnFamilyStore(baseName);\n                Index index = baseCfs.indexManager.getIndexByName(indexName);\n                if (index == null)\n                    throw new IllegalArgumentException(String.format(\"Invalid index specified: %s/%s.\",\n                                                                     baseCfs.metadata.name,\n                                                                     indexName));\n\n                if (index.getBackingTable().isPresent())\n                    valid.add(index.getBackingTable().get());\n            }\n            else\n            {\n                ColumnFamilyStore cfStore = getColumnFamilyStore(cfName);\n                valid.add(cfStore);\n                if (autoAddIndexes)\n                    valid.addAll(getIndexColumnFamilyStores(cfStore));\n            }\n        }\n\n        return valid;\n    }\n","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/Keyspace.java#L630-L666","documentation":"In Keyspace.getValidColumnFamilies, when a CF name is given in the form baseTable/indexName, the code looks up the index by name on the base table's SecondaryIndexManager. If no such index exists it throws IllegalArgumentException(\"Invalid index specified: base/index.\"). It guards index-scoped operations (e.g. compaction, cleanup) against nonexistent indexes.","triggerScenarios":"Calling Keyspace.getValidColumnFamilies(keyspace, ..., \"table/index_name\") where index_name was never created or was already dropped; passing a table name containing '/' that is not actually an index reference.","commonSituations":"Operational commands like `nodetool compact ks tableidx` after an index was dropped; misremembered index names (SASI/SAI/2i naming differs); scripts built for one cluster reused on another where indexes differ.","solutions":["List existing indexes with `DESCRIBE TABLE` or query system_schema.indexes and use the exact index name.","Recreate the missing index (CREATE INDEX / CREATE CUSTOM INDEX) if it should exist.","If you meant the base table, pass the table name without the '/index' suffix."],"exampleFix":"// before\nkeyspace.getValidColumnFamilies(null, \"users_by_email_idx\"); // treated as table/index, wrong\n// after\nkeyspace.getValidColumnFamilies(null, \"users/users_by_email_idx\"); // base table / index name that exists","handlingStrategy":"validation","validationCode":"ColumnFamilyStore cfs = Keyspace.open(ks).getColumnFamilyStore(baseTable);\nif (cfs.indexManager.getIndexByName(indexName) == null)\n    throw new IllegalArgumentException(\"index missing: \" + baseTable + \"/\" + indexName);","typeGuard":null,"tryCatchPattern":"try { return ks.getValidColumnFamilies(null, tableName); } catch (IllegalArgumentException e) { LOG.warn(\"bad table/index spec\", e); return Collections.emptySet(); }","preventionTips":["Query system_schema.indexes to enumerate valid index names before index-scoped ops.","Keep index names in sync between DDL scripts and ops tooling.","Remember the base/index format for index-scoped commands."],"tags":["index","illegal-argument","secondary-index","resource-not-found"],"backgroundTag":"resource-not-found","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"}