apache/cassandra · error · ConfigurationException
category %s not found in %s
Error message
category %s not found in %s
What it means
Thrown by CreateTypeStatement.apply when a CREATE TYPE statement targets a keyspace that does not exist in the cluster schema. The statement resolves the parent keyspace from ClusterMetadata before adding the user type; if schema.getNullable(keyspaceName) returns null the DDL is rejected as an InvalidRequestException. This is a fail-fast schema dependency check, not an internal failure.
Source
Thrown at src/java/org/apache/cassandra/audit/AuditLogOptions.java:281
}
}
private static void validateCategories(final String categories)
{
assert categories != null;
if (categories.isEmpty())
return;
for (final String includedCategory : categories.split(","))
{
try
{
AuditLogEntryCategory.valueOf(includedCategory);
}
catch (final IllegalArgumentException ex)
{
throw new ConfigurationException(String.format("category %s not found in %s",
includedCategory,
AuditLogEntryCategory.class.getName()),
ex);
}
}
}
public String toString()
{
return "AuditLogOptions{" +
"enabled=" + enabled +
", logger='" + logger + '\'' +
", included_keyspaces='" + included_keyspaces + '\'' +
", excluded_keyspaces='" + excluded_keyspaces + '\'' +
", included_categories='" + included_categories + '\'' +
", excluded_categories='" + excluded_categories + '\'' +
", included_users='" + included_users + '\'' +
", excluded_users='" + excluded_users + '\'' +View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Run 'DESCRIBE KEYSPACES' (or query system_schema.keyspaces) and confirm the target keyspace exists.
- Create the keyspace first with CREATE KEYSPACE ... WITH replication = {...}, then re-run the CREATE TYPE.
- Correct the keyspace qualifier in the statement, matching case or quoting it ('CREATE TYPE "MyKS".t ...').
- Verify you are connected to the intended cluster/contact point and that schema has fully propagated after any recent DDL.
Example fix
// before
CREATE TYPE orders.address (street text, city text);
// after
CREATE KEYSPACE IF NOT EXISTS orders WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};
CREATE TYPE orders.address (street text, city text); Defensive patterns
Strategy: validation
Validate before calling
Row r = session.execute("SELECT keyspace_name FROM system_schema.keyspaces WHERE keyspace_name = ?", ksName).one();
if (r == null) throw new IllegalStateException("Keyspace does not exist: " + ksName); Type guard
boolean keyspaceExists(Session s, String ks) {
return s.execute("SELECT keyspace_name FROM system_schema.keyspaces WHERE keyspace_name = ?", ks).one() != null;
} Try / catch
try {
session.execute(createTypeStmt);
} catch (InvalidQueryException e) {
if (e.getMessage().contains("doesn't exist")) { ensureKeyspace(ksName); retry(createTypeStmt); }
else throw e;
} Prevention
- Always create keyspaces and types in the same ordered migration script.
- Use fully-qualified names and consistent casing (quote identifiers if needed).
- Check schema with DESCRIBE/system_schema before DDL in deployment automation.
When it happens
Trigger: Executing 'CREATE TYPE ks.newType (...)' where ks was never created, was dropped concurrently, or the keyspace name (case-sensitively resolved unless quoted) does not exist on the connected cluster.
Common situations: Typos in the keyspace name; running the DDL script against the wrong cluster or environment (dev vs prod); a DROP KEYSPACE executed by another client between the script's CREATE KEYSPACE and CREATE TYPE; scripts that assume the current keyspace without qualifying the name.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- GRANT operation is not supported by AllowAllAuthorizer
- REVOKE operation is not supported by AllowAllAuthorizer
- LIST PERMISSIONS operation is not supported by AllowAllAutho
- Invalidate CIDR permissions cache operation not supported by
- 'Get CIDR groups for IP' operation not supported by %s
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/34643d03c30ee09d.
Report an issue: GitHub.