{"record":{"id":"4fe46c075cdbf864","repo":"apache/dolphinscheduler","slug":"not-support-shell-type","errorCode":null,"errorMessage":"not support shell type: ","messagePattern":"not support shell type: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/shell/ShellInterceptorBuilderFactory.java","lineNumber":40,"sourceCode":"import org.apache.dolphinscheduler.plugin.task.api.shell.cmd.CmdShellInterceptorBuilder;\nimport org.apache.dolphinscheduler.plugin.task.api.shell.sh.ShShellInterceptorBuilder;\n\npublic class ShellInterceptorBuilderFactory {\n\n    private final static String INTERCEPTOR_TYPE = PropertyUtils.getString(\"shell.interceptor.type\", \"bash\");\n\n    @SuppressWarnings(\"unchecked\")\n    public static IShellInterceptorBuilder newBuilder() {\n        if (INTERCEPTOR_TYPE.equalsIgnoreCase(\"bash\")) {\n            return new BashShellInterceptorBuilder();\n        }\n        if (INTERCEPTOR_TYPE.equalsIgnoreCase(\"sh\")) {\n            return new ShShellInterceptorBuilder();\n        }\n        if (INTERCEPTOR_TYPE.equalsIgnoreCase(\"cmd\")) {\n            return new CmdShellInterceptorBuilder();\n        }\n        throw new IllegalArgumentException(\"not support shell type: \" + INTERCEPTOR_TYPE);\n    }\n\n}\n","sourceCodeStart":22,"sourceCodeEnd":44,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/shell/ShellInterceptorBuilderFactory.java#L22-L44","documentation":"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.","triggerScenarios":"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'.","commonSituations":"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.","solutions":["Set the shell task type to 'sh' (Linux/macOS) or 'cmd' (Windows) in the task/plugin configuration.","Check the property that feeds INTERCEPTOR_TYPE (e.g. in common/task-type config) for typos, whitespace, or an empty value.","If you need another shell (powershell/zsh), implement a ShellInterceptorBuilder subclass and add a branch in newBuilder(), then rebuild the plugin.","Verify the deployed dolphinscheduler-task-api jar version matches your config expectations."],"exampleFix":"// before\n# application.yaml\ntask.shell.type: bash\n// after\n# application.yaml\ntask.shell.type: sh","handlingStrategy":"validation","validationCode":"String type = getShellType(); // from config\nif (type == null || !(type.equalsIgnoreCase(\"sh\") || type.equalsIgnoreCase(\"cmd\"))) {\n    throw new IllegalArgumentException(\"shell type must be 'sh' or 'cmd', got: \" + type);\n}","typeGuard":"boolean isSupportedShellType(String t) {\n    return t != null && (t.equalsIgnoreCase(\"sh\") || t.equalsIgnoreCase(\"cmd\"));\n}","tryCatchPattern":"try {\n    builder = ShellInterceptorBuilderFactory.newBuilder();\n} catch (IllegalArgumentException e) {\n    log.error(\"unsupported shell type, check task-type config\", e);\n    throw new IllegalStateException(\"Bad shell type configuration\", e);\n}","preventionTips":["Pin the shell type to 'sh' on Linux workers and 'cmd' on Windows in deployment templates.","Trim and lower-case shell-type values loaded from properties files.","Add a startup-time config validation that fails fast on unsupported shell types."],"tags":["shell","configuration","illegal-argument"],"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"}