{"record":{"id":"417e2d3f4d7f2121","repo":"apache/seatunnel","slug":"invalid-option-rules-request-type-plugin","errorCode":null,"errorMessage":"Invalid option rules request, type: {}, plugin: {}, error: {}","messagePattern":"Invalid option rules request, type: (.+?), plugin: (.+?), error: (.+?)","errorType":"console","errorClass":null,"httpStatus":400,"severity":"warning","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/servlet/OptionRulesServlet.java","lineNumber":53,"sourceCode":"public class OptionRulesServlet extends BaseServlet {\n\n    private final OptionRulesService optionRulesService;\n\n    public OptionRulesServlet(NodeEngineImpl nodeEngine) {\n        super(nodeEngine);\n        this.optionRulesService = new OptionRulesService(nodeEngine);\n    }\n\n    @Override\n    protected void doGet(HttpServletRequest req, HttpServletResponse resp)\n            throws ServletException, IOException {\n        Map<String, String> params = getParameterMap(req);\n        String pluginType = params.get(\"type\");\n        String pluginName = params.get(\"plugin\");\n        try {\n            writeJson(resp, optionRulesService.getOptionRules(pluginType, pluginName));\n        } catch (IllegalArgumentException e) {\n            log.warn(\n                    \"Invalid option rules request, type: {}, plugin: {}, error: {}\",\n                    pluginType,\n                    pluginName,\n                    e.getMessage());\n            writeJson(resp, errorResponse(e.getMessage()), HttpServletResponse.SC_BAD_REQUEST);\n        } catch (NoSuchElementException e) {\n            log.info(\"Option rules plugin not found, type: {}, plugin: {}\", pluginType, pluginName);\n            writeJson(resp, errorResponse(e.getMessage()), HttpServletResponse.SC_NOT_FOUND);\n        } catch (RuntimeException e) {\n            log.error(\n                    \"Failed to load option rules, type: {}, plugin: {}\", pluginType, pluginName, e);\n            writeJson(\n                    resp,\n                    errorResponse(\"Failed to load option rules.\"),\n                    HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n        }\n    }\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/servlet/OptionRulesServlet.java#L35-L71","documentation":"OptionRulesServlet.doGet validates the 'type' and 'query' parameters against optionRulesService.getOptionRules(); when they are invalid (IllegalArgumentException) it logs this warning and returns HTTP 400 with an error JSON body. The requested plugin type or plugin name does not map to a known option-rules entry.","triggerScenarios":"GET /option-rules/ with a 'type' that is not a valid plugin type (source/sink/transform) or a 'plugin' name that fails validation — e.g. missing plugin name for a type that requires one, or unknown plugin identifier.","commonSituations":"Hand-built REST queries with typos in the plugin factory identifier; querying a plugin not installed on the node; using an old plugin name after it was renamed or moved; forgetting the 'plugin' parameter entirely.","solutions":["Check the type parameter is one of the supported values (source, sink, transform) and spelled correctly.","Verify the plugin identifier matches the factory name (e.g. 'FakeSource', 'Jdbc') and the plugin jar is installed on the queried node.","Read the error message returned in the 400 body — IllegalArgumentException.getMessage() explains which parameter was invalid.","Use the plugin discovery endpoints to list available factories before querying option rules."],"exampleFix":"// before\ncurl 'http://host:8080/option-rules/?type=sources&plugin=FakeSource'\n// after\ncurl 'http://host:8080/option-rules/?type=source&plugin=FakeSource'","handlingStrategy":"validation","validationCode":"const TYPES = ['source','sink','transform'];\nfunction validOptionRulesQuery(type, plugin) {\n  return TYPES.includes(type) && typeof plugin === 'string' && plugin.length > 0;\n}","typeGuard":null,"tryCatchPattern":"try { const rules = await fetchOptionRules(type, plugin); } catch (e) { /* 400: read e.body message for which param was invalid */ }","preventionTips":["Validate type is exactly one of source/sink/transform","Use the exact factory name for the plugin parameter (e.g. FakeSource, Jdbc)","Confirm the plugin jar is installed on the queried node"],"tags":["rest","servlet","validation","option-rules"],"backgroundTag":"invalid-query-parameter","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}