apache/dolphinscheduler · error · java.lang.IllegalArgumentException

unsupported command fetch strategy type: ${type}

Error message

unsupported command fetch strategy type: ${type}

What it means

Thrown when the configured command fetch strategy type is not handled by CommandFetcherConfiguration.commandFetcher. Currently only ID_SLOT_BASED is supported; the switch's default branch rejects everything else with this IllegalArgumentException. It guards against a configured-but-unknown fetch strategy at master startup.

Source

Thrown at dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/command/CommandFetcherConfiguration.java:45

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CommandFetcherConfiguration {

    @Bean
    public ICommandFetcher commandFetcher(MasterConfig masterConfig,
                                          MasterSlotManager masterSlotManager,
                                          CommandDao commandDao) {
        CommandFetchStrategy commandFetchStrategy =
                checkNotNull(masterConfig.getCommandFetchStrategy(), "command fetch strategy is null");
        switch (commandFetchStrategy.getType()) {
            case ID_SLOT_BASED:
                CommandFetchStrategy.IdSlotBasedFetchConfig idSlotBasedFetchConfig =
                        (CommandFetchStrategy.IdSlotBasedFetchConfig) commandFetchStrategy.getConfig();
                return new IdSlotBasedCommandFetcher(idSlotBasedFetchConfig, masterSlotManager, commandDao);
            default:
                throw new IllegalArgumentException(
                        "unsupported command fetch strategy type: " + commandFetchStrategy.getType());
        }
    }
}

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Set the command fetch strategy type to ID_SLOT_BASED in the master configuration
  2. Verify the value against the CommandFetchStrategy type enum in the source
  3. Remove stale/legacy strategy keys left from an upgrade

Example fix

// before
master:
  command-fetch-strategy:
    type: QUEUE_BASED
// after
master:
  command-fetch-strategy:
    type: ID_SLOT_BASED
Defensive patterns

Strategy: validation

Validate before calling

if (!"ID_SLOT_BASED".equals(configuredStrategyType)) {
    throw new IllegalArgumentException("only ID_SLOT_BASED is supported");
}

Try / catch

try {
    CommandFetcher fetcher = configuration.commandFetcher();
} catch (IllegalArgumentException e) {
    log.error("Unsupported fetch strategy, using IdSlotBasedCommandFetcher default");
}

Prevention

When it happens

Trigger: Configuring the master command fetch strategy to any value other than ID_SLOT_BASED, e.g. a legacy type name or typo in application.yaml, or supplying a custom enum value via code.

Common situations: Following outdated docs that mention removed fetch strategies, hand-editing YAML with wrong casing, or newer config files used with an older build.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/6d30a8df414c64ee. Report an issue: GitHub.