{"record":{"id":"643d43e2fe1e27fb","repo":"apache/cassandra","slug":"javascript-user-defined-functions-were-removed-in","errorCode":null,"errorMessage":"JavaScript user-defined functions were removed in CASSANDRA-18252. Hooks are planned to be introduced as part of CASSANDRA-17280","messagePattern":"JavaScript user-defined functions were removed in CASSANDRA-18252\\. Hooks are planned to be introduced as part of CASSANDRA-17280","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1119,"sourceCode":"\n        if (indexSummaryCapacityInMiB < 0)\n            throw new ConfigurationException(\"index_summary_capacity option was set incorrectly to '\"\n                                             + conf.index_summary_capacity.toString() + \"', it should be a non-negative integer.\", false);\n\n        // we need this assignment for the Settings virtual table - CASSANDRA-17735\n        conf.index_summary_capacity = new DataStorageSpec.LongMebibytesBound(indexSummaryCapacityInMiB);\n\n        if (conf.user_defined_functions_fail_timeout.toMilliseconds() < conf.user_defined_functions_warn_timeout.toMilliseconds())\n            throw new ConfigurationException(\"user_defined_functions_warn_timeout must less than user_defined_function_fail_timeout\", false);\n\n        if (!conf.allow_insecure_udfs && !conf.user_defined_functions_threads_enabled)\n            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.\");\n\n        if (conf.allow_extra_insecure_udfs)\n            logger.warn(\"Allowing java.lang.System.* access in UDFs is dangerous and not recommended. Set allow_extra_insecure_udfs: false to disable.\");\n\n        if (conf.scripted_user_defined_functions_enabled)\n            throw new ConfigurationException(\"JavaScript user-defined functions were removed in CASSANDRA-18252. \" +\n                                             \"Hooks are planned to be introduced as part of CASSANDRA-17280\");\n\n        if (conf.commitlog_segment_size.toMebibytes() == 0)\n            throw new ConfigurationException(\"commitlog_segment_size must be positive, but was \"\n                                             + conf.commitlog_segment_size.toString(), false);\n        else if (conf.commitlog_segment_size.toMebibytes() >= 2048)\n            throw new ConfigurationException(\"commitlog_segment_size must be smaller than 2048, but was \"\n                                             + conf.commitlog_segment_size.toString(), false);\n\n        if (conf.max_mutation_size == null)\n            conf.max_mutation_size = new DataStorageSpec.IntKibibytesBound(conf.commitlog_segment_size.toKibibytes() / 2);\n        else if (conf.commitlog_segment_size.toKibibytes() < 2 * conf.max_mutation_size.toKibibytes())\n            throw new ConfigurationException(\"commitlog_segment_size must be at least twice the size of max_mutation_size / 1024\", false);\n\n        if (conf.native_transport_max_message_size == null)\n        {\n            conf.native_transport_max_message_size = new DataStorageSpec.LongBytesBound(calculateDefaultNativeTransportMaxMessageSizeInBytes());\n        }","sourceCodeStart":1101,"sourceCodeEnd":1137,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1101-L1137","documentation":"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.","triggerScenarios":"cassandra.yaml sets scripted_user_defined_functions_enabled: true (possibly carried over from a pre-removal cluster config).","commonSituations":"Upgrading a cluster that previously used JS UDFs and keeping the old yaml; blindly merging old config templates into new versions.","solutions":["Remove or set scripted_user_defined_functions_enabled: false in cassandra.yaml.","Migrate any existing JavaScript UDFs to Java UDFs before upgrading (scripted UDFs no longer work)."],"exampleFix":"# before\nscripted_user_defined_functions_enabled: true\n# after\nscripted_user_defined_functions_enabled: false","handlingStrategy":"validation","validationCode":"if (Boolean.TRUE.equals(yaml.get(\"scripted_user_defined_functions_enabled\")))\n    throw new IllegalArgumentException(\"scripted UDFs were removed in CASSANDRA-18252; migrate to Java UDFs\");","typeGuard":null,"tryCatchPattern":"try {\n    DatabaseDescriptor.applySimpleConfig();\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"JavaScript user-defined functions\"))\n        logger.error(\"Remove scripted_user_defined_functions_enabled and migrate JS UDFs to Java\");\n}","preventionTips":["Audit old cassandra.yaml files after version upgrades","Migrate JavaScript UDFs to Java before upgrading past the removal version","Strip removed config keys during upgrade runbooks"],"tags":["config","udf","removed-feature","upgrade"],"backgroundTag":"deprecated-api-usage","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}