apache/dolphinscheduler · error · IllegalArgumentException

not support shell type:

Error message

not support shell type: 

What it means

ShellInterceptorBuilderFactory.newBuilder() selects a shell interceptor builder based on the configured shell type (INTERCEPTOR_TYPE). Only 'sh' and 'cmd' are supported (case-insensitive); any other value causes an IllegalArgumentException. This happens when the task-type configuration (e.g. SHELL task type on Windows, or a misconfigured type) does not match a known interceptor.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/shell/ShellInterceptorBuilderFactory.java:40

import org.apache.dolphinscheduler.plugin.task.api.shell.cmd.CmdShellInterceptorBuilder;
import org.apache.dolphinscheduler.plugin.task.api.shell.sh.ShShellInterceptorBuilder;

public class ShellInterceptorBuilderFactory {

    private final static String INTERCEPTOR_TYPE = PropertyUtils.getString("shell.interceptor.type", "bash");

    @SuppressWarnings("unchecked")
    public static IShellInterceptorBuilder newBuilder() {
        if (INTERCEPTOR_TYPE.equalsIgnoreCase("bash")) {
            return new BashShellInterceptorBuilder();
        }
        if (INTERCEPTOR_TYPE.equalsIgnoreCase("sh")) {
            return new ShShellInterceptorBuilder();
        }
        if (INTERCEPTOR_TYPE.equalsIgnoreCase("cmd")) {
            return new CmdShellInterceptorBuilder();
        }
        throw new IllegalArgumentException("not support shell type: " + INTERCEPTOR_TYPE);
    }

}

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Set the shell task type to 'sh' (Linux/macOS) or 'cmd' (Windows) in the task/plugin configuration.
  2. Check the property that feeds INTERCEPTOR_TYPE (e.g. in common/task-type config) for typos, whitespace, or an empty value.
  3. If you need another shell (powershell/zsh), implement a ShellInterceptorBuilder subclass and add a branch in newBuilder(), then rebuild the plugin.
  4. Verify the deployed dolphinscheduler-task-api jar version matches your config expectations.

Example fix

// before
# application.yaml
task.shell.type: bash
// after
# application.yaml
task.shell.type: sh
Defensive patterns

Strategy: validation

Validate before calling

String type = getShellType(); // from config
if (type == null || !(type.equalsIgnoreCase("sh") || type.equalsIgnoreCase("cmd"))) {
    throw new IllegalArgumentException("shell type must be 'sh' or 'cmd', got: " + type);
}

Type guard

boolean isSupportedShellType(String t) {
    return t != null && (t.equalsIgnoreCase("sh") || t.equalsIgnoreCase("cmd"));
}

Try / catch

try {
    builder = ShellInterceptorBuilderFactory.newBuilder();
} catch (IllegalArgumentException e) {
    log.error("unsupported shell type, check task-type config", e);
    throw new IllegalStateException("Bad shell type configuration", e);
}

Prevention

When it happens

Trigger: Calling newBuilder() when INTERCEPTOR_TYPE is neither 'sh' nor 'cmd' — typically because the task type string mapped to the shell task is empty, misspelled, or an unsupported value like 'powershell' or 'bash'.

Common situations: Configuring a shell task with a custom/unsupported shell type in task-type config; running on Windows where 'cmd' mapping is expected but config says otherwise; upgrading versions where a previously supported type was removed; a properties file (task config) missing the shell type so an empty string is compared.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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