{"record":{"id":"1d01466d5427feaa","repo":"apache/dolphinscheduler","slug":"unsupport-worker-load-balancer-type-type","errorCode":null,"errorMessage":"unSupport worker load balancer type ${type}","messagePattern":"unSupport worker load balancer type (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/cluster/loadbalancer/WorkerLoadBalancerConfiguration.java","lineNumber":45,"sourceCode":"public class WorkerLoadBalancerConfiguration {\n\n    @Bean\n    public IWorkerLoadBalancer randomWorkerLoadBalancer(MasterConfig masterConfig, ClusterManager clusterManager) {\n        WorkerLoadBalancerConfigurationProperties workerLoadBalancerConfigurationProperties =\n                masterConfig.getWorkerLoadBalancerConfigurationProperties();\n        switch (workerLoadBalancerConfigurationProperties.getType()) {\n            case RANDOM:\n                return new RandomWorkerLoadBalancer(clusterManager.getWorkerClusters());\n            case ROUND_ROBIN:\n                return new RoundRobinWorkerLoadBalancer(clusterManager.getWorkerClusters());\n            case FIXED_WEIGHTED_ROUND_ROBIN:\n                return new FixedWeightedRoundRobinWorkerLoadBalancer(clusterManager.getWorkerClusters());\n            case DYNAMIC_WEIGHTED_ROUND_ROBIN:\n                return new DynamicWeightedRoundRobinWorkerLoadBalancer(\n                        clusterManager.getWorkerClusters(),\n                        workerLoadBalancerConfigurationProperties.getDynamicWeightConfigProperties());\n            default:\n                throw new IllegalArgumentException(\n                        \"unSupport worker load balancer type \" + workerLoadBalancerConfigurationProperties.getType());\n        }\n    }\n\n}\n","sourceCodeStart":27,"sourceCodeEnd":51,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/cluster/loadbalancer/WorkerLoadBalancerConfiguration.java#L27-L51","documentation":"The master server throws this IllegalArgumentException when the configured worker load balancer type does not match any known enum constant in WorkerLoadBalancerType. randomWorkerLoadBalancer's switch statement handles FIXED_WEIGHTED_ROUND_ROBIN and DYNAMIC_WEIGHTED_ROUND_ROBIN and falls through to a default case that rejects any other value. It fails fast at startup so a misconfigured balancer is never silently used.","triggerScenarios":"Setting master worker-load-balancer type (workerLoadBalancerConfigurationProperties.getType()) to a value outside the enum, e.g. a typo like 'round-robin' or 'RANDOM', or a value from an older/newer version that the current enum no longer defines.","commonSituations":"YAML config typos after copying example docs, upgrading DolphinScheduler and renaming an enum constant, or programmatically setting the type with a stale string.","solutions":["Open application.yaml and set the master worker load balancer type to an exact enum constant (e.g. FIXED_WEIGHTED_ROUND_ROBIN or DYNAMIC_WEIGHTED_ROUND_ROBIN)","Check spelling/casing against the WorkerLoadBalancerType enum source","If migrating from an older version, map deprecated type names to the new enum constants"],"exampleFix":"// before\nmaster:\n  worker-load-balancer:\n    type: round_robin\n// after\nmaster:\n  worker-load-balancer:\n    type: DYNAMIC_WEIGHTED_ROUND_ROBIN","handlingStrategy":"validation","validationCode":"List<String> valid = Arrays.stream(WorkerLoadBalancerType.values()).map(Enum::name).collect(Collectors.toList());\nif (!valid.contains(configuredType.toUpperCase())) {\n    throw new IllegalArgumentException(\"type must be one of \" + valid);\n}","typeGuard":"boolean isValidBalancerType(String s) {\n    return Arrays.stream(WorkerLoadBalancerType.values()).anyMatch(t -> t.name().equalsIgnoreCase(s));\n}","tryCatchPattern":"try {\n    WorkerLoadBalancer lb = configuration.randomWorkerLoadBalancer();\n} catch (IllegalArgumentException e) {\n    log.error(\"Bad worker load balancer type: {}\", e.getMessage());\n    // fall back to default DYNAMIC_WEIGHTED_ROUND_ROBIN\n}","preventionTips":["Always pick the type from the enum in application.yaml, copied exactly","Add a startup config validation check before master boot","Keep enum values in sync across versions during upgrades"],"tags":["configuration","enum","master-server"],"backgroundTag":"invalid-enum-value","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}