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

  1. Remove the trigger definitions from the schema (DROP TRIGGER) if policy should stay disabled
  2. Set triggers_policy: enabled in cassandra.yaml and restart if triggers are required
  3. Note existing cached trigger instances may still execute until restart
  4. 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

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


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)