apache/cassandra · error · ConfigurationException

JavaScript user-defined functions were removed in CASSANDRA-

Error message

JavaScript user-defined functions were removed in CASSANDRA-18252. Hooks are planned to be introduced as part of CASSANDRA-17280

What it means

Thrown when scripted_user_defined_functions_enabled is true. JavaScript (scripted) UDF support was removed from Cassandra in CASSANDRA-18252; the flag now only exists to fail fast with a message pointing at the planned hooks under CASSANDRA-17280.

Source

Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:1119

        if (indexSummaryCapacityInMiB < 0)
            throw new ConfigurationException("index_summary_capacity option was set incorrectly to '"
                                             + conf.index_summary_capacity.toString() + "', it should be a non-negative integer.", false);

        // we need this assignment for the Settings virtual table - CASSANDRA-17735
        conf.index_summary_capacity = new DataStorageSpec.LongMebibytesBound(indexSummaryCapacityInMiB);

        if (conf.user_defined_functions_fail_timeout.toMilliseconds() < conf.user_defined_functions_warn_timeout.toMilliseconds())
            throw new ConfigurationException("user_defined_functions_warn_timeout must less than user_defined_function_fail_timeout", false);

        if (!conf.allow_insecure_udfs && !conf.user_defined_functions_threads_enabled)
            throw new ConfigurationException("To be able to set enable_user_defined_functions_threads: false you need to set allow_insecure_udfs: true - this is an unsafe configuration and is not recommended.");

        if (conf.allow_extra_insecure_udfs)
            logger.warn("Allowing java.lang.System.* access in UDFs is dangerous and not recommended. Set allow_extra_insecure_udfs: false to disable.");

        if (conf.scripted_user_defined_functions_enabled)
            throw new ConfigurationException("JavaScript user-defined functions were removed in CASSANDRA-18252. " +
                                             "Hooks are planned to be introduced as part of CASSANDRA-17280");

        if (conf.commitlog_segment_size.toMebibytes() == 0)
            throw new ConfigurationException("commitlog_segment_size must be positive, but was "
                                             + conf.commitlog_segment_size.toString(), false);
        else if (conf.commitlog_segment_size.toMebibytes() >= 2048)
            throw new ConfigurationException("commitlog_segment_size must be smaller than 2048, but was "
                                             + conf.commitlog_segment_size.toString(), false);

        if (conf.max_mutation_size == null)
            conf.max_mutation_size = new DataStorageSpec.IntKibibytesBound(conf.commitlog_segment_size.toKibibytes() / 2);
        else if (conf.commitlog_segment_size.toKibibytes() < 2 * conf.max_mutation_size.toKibibytes())
            throw new ConfigurationException("commitlog_segment_size must be at least twice the size of max_mutation_size / 1024", false);

        if (conf.native_transport_max_message_size == null)
        {
            conf.native_transport_max_message_size = new DataStorageSpec.LongBytesBound(calculateDefaultNativeTransportMaxMessageSizeInBytes());
        }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove or set scripted_user_defined_functions_enabled: false in cassandra.yaml.
  2. Migrate any existing JavaScript UDFs to Java UDFs before upgrading (scripted UDFs no longer work).

Example fix

# before
scripted_user_defined_functions_enabled: true
# after
scripted_user_defined_functions_enabled: false
Defensive patterns

Strategy: validation

Validate before calling

if (Boolean.TRUE.equals(yaml.get("scripted_user_defined_functions_enabled")))
    throw new IllegalArgumentException("scripted UDFs were removed in CASSANDRA-18252; migrate to Java UDFs");

Try / catch

try {
    DatabaseDescriptor.applySimpleConfig();
} catch (ConfigurationException e) {
    if (e.getMessage().contains("JavaScript user-defined functions"))
        logger.error("Remove scripted_user_defined_functions_enabled and migrate JS UDFs to Java");
}

Prevention

When it happens

Trigger: cassandra.yaml sets scripted_user_defined_functions_enabled: true (possibly carried over from a pre-removal cluster config).

Common situations: Upgrading a cluster that previously used JS UDFs and keeping the old yaml; blindly merging old config templates into new versions.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/643d43e2fe1e27fb. Report an issue: GitHub.