apache/cassandra · error · IllegalArgumentException
Argument must have keyspace and table values.
Error message
Argument must have keyspace and table values.
What it means
When importing a compression dictionary, NodeProbe reads the keyspace and table names out of the supplied CompositeData. If either is null, the data cannot be routed to the correct CompressionDictionaryManager MBean, so an IllegalArgumentException is thrown immediately.
Source
Thrown at src/java/org/apache/cassandra/tools/NodeProbe.java:2813
return doWithCompressionDictionaryManagerMBean(proxy -> proxy.getCompressionDictionary(dictId), keyspace, table);
}
/**
* Imports dictionary in composite data to database.
*
* @param compositeData data to import
* @throws IOException if there's an error accessing the MBean
* @throws IllegalArgumentException if keyspace and table values in compositeData are missing
* or if table doesn't support dictionary compression
*/
public void importCompressionDictionary(CompositeData compositeData) throws IOException
{
String keyspace = (String) compositeData.get(CompressionDictionaryDetailsTabularData.KEYSPACE_NAME);
String table = (String) compositeData.get(CompressionDictionaryDetailsTabularData.TABLE_NAME);
if (keyspace == null || table == null)
{
throw new IllegalArgumentException("Argument must have keyspace and table values.");
}
doWithCompressionDictionaryManagerMBean(proxy -> { proxy.importCompressionDictionary(compositeData); return null; }, keyspace, table);
}
/**
*
* @param keyspace keyspace to list dictionaries for
* @param table table to list dictionaries for
* @return tabular data with listing
* @throws IOException if there's an error accessing the MBean
* @throws IllegalArgumentException if table doesn't support dictionary compression
*/
public TabularData listCompressionDictionaries(String keyspace, String table) throws IOException
{
return doWithCompressionDictionaryManagerMBean(CompressionDictionaryManagerMBean::listCompressionDictionaries, keyspace, table);
}
View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Ensure the CompositeData includes non-null KEYSPACE_NAME and TABLE_NAME items before import.
- Use the documented nodetool import syntax so the payload is built correctly.
- Validate the input file/payload fields (keyspace and table present, correct case) before calling import.
Example fix
// before CompositeData data = ...; // missing TABLE_NAME entry // after Map<String,Object> items = new HashMap<>(data); // or build data with both items.put(CompressionDictionaryDetailsTabularData.TABLE_NAME, "mytable");
Defensive patterns
Strategy: validation
Validate before calling
if (data == null) throw new IllegalArgumentException("CompositeData is required");
Object ks = data.get(CompressionDictionaryDetailsTabularData.KEYSPACE_NAME);
Object tbl = data.get(CompressionDictionaryDetailsTabularData.TABLE_NAME);
if (ks == null || tbl == null) throw new IllegalArgumentException("keyspace and table must be set in the payload"); Type guard
boolean isNonBlank(String s) { return s != null && !s.isBlank(); } Prevention
- Build import payloads via the documented helper/TabularData builder, never by hand
- Validate payload fields before JMX invocation
- Log the payload contents on failure for diagnosis
When it happens
Trigger: Calling nodetool's compression dictionary import (importCompressionDictionary) with a CompositeData payload missing the KEYSPACE_NAME or TABLE_NAME entries.
Common situations: Hand-crafted or generated import payload missing required columns; programmatic JMX callers building CompositeData with wrong keys; CSV/JSON import tooling that omits fields.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Table %s.%s does not exist or does not support dictionary co
- throw new IOException(e.getMessage())
- Keyspace not specified.
- Table not specified.
- Error while refreshing system.size_estimates
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/93a4ab74e0c39be4.
Report an issue: GitHub.