apache/cassandra · error · TriggerDisabledException
Refusing to load new trigger class
Error message
Refusing to load new trigger class %s with TriggersPolicy.%s
What it means
loadTriggerInstance refuses to instantiate a new trigger class when the cluster's triggers_policy is set to disabled or forbidden, throwing TriggerDisabledException (a ConfigurationException). Only NEW trigger class loads are blocked; cached triggers may still be present.
Solutions
- Remove the trigger definitions from the schema (DROP TRIGGER) if policy should stay disabled
- Set triggers_policy: enabled in cassandra.yaml and restart if triggers are required
- Note existing cached trigger instances may still execute until restart
- Use 'blocked' policy if you only want to prevent loading new triggers dynamically
Example fix
// before (cassandra.yaml) triggers_policy: forbidden // after triggers_policy: enabled
Defensive patterns
Strategy: validation
Validate before calling
// check policy before relying on triggers
Config.TriggersPolicy policy = DatabaseDescriptor.getTriggersPolicy();
if (policy == Config.TriggersPolicy.disabled || policy == Config.TriggersPolicy.forbidden)
throw new IllegalStateException("Triggers disabled by policy; DROP TRIGGER or set triggers_policy: enabled"); Try / catch
try {
session.execute(write);
} catch (org.apache.cassandra.exceptions.ConfigurationException e) {
if (e.getMessage().startsWith("Refusing to load new trigger class")) {
// enable triggers or remove trigger definitions
} else throw e;
} Prevention
- Align triggers_policy with schema: no triggers in schema when policy is disabled/forbidden
- Audit cassandra.yaml across environments for policy drift
- Remember cached trigger instances can persist until restart after policy changes
When it happens
Trigger: cassandra.yaml sets triggers_policy: disabled or forbidden and a mutation invokes a table with a trigger whose class has not yet been loaded/cached in this process.
Common situations: Operators hardening clusters disable triggers but a schema with triggers remains; config synced from a hardened cluster to one with trigger-based workflows.
Related errors
- Triggers are present but TriggersPolicy.forbidden is…
- Trigger class couldn't be found.
- a hints file cannot be configured for both compression and…
- A maximum number of tokens per node is supported
- accord.cache_size option was set incorrectly to
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/b893c7647692639f.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/triggers/TriggerExecutor.java:323
return FBUtilities.classForNameWithoutInitialization(triggerClass,
"trigger",
ITrigger.class,
customClassLoader);
}
catch (ConfigurationException e)
{
if (e.getCause() instanceof ClassNotFoundException)
throw (ClassNotFoundException) e.getCause();
throw e;
}
}
public synchronized ITrigger loadTriggerInstance(String triggerClass) throws Exception
{
Config.TriggersPolicy policy = DatabaseDescriptor.getTriggersPolicy();
if (policy == Config.TriggersPolicy.disabled || policy == Config.TriggersPolicy.forbidden)
{
throw new TriggerDisabledException(String.format("Refusing to load new trigger class %s with TriggersPolicy.%s", triggerClass, policy));
}
// double check.
if (cachedTriggers.get(triggerClass) != null)
return cachedTriggers.get(triggerClass);
return loadTriggerClassWithoutInitialization(triggerClass).getConstructor().newInstance();
}
}
View on GitHub (pinned to 88fd0f6a0e)