{"record":{"id":"28ac371221acbabc","repo":"apache/seatunnel","slug":"invalid-params-format-in-params","errorCode":null,"errorMessage":"Invalid Params format in Params.","messagePattern":"Invalid Params format in Params\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/utils/RestUtil.java","lineNumber":64,"sourceCode":"    public static JsonNode convertByteToJsonNode(byte[] byteData) throws IOException {\n        return objectMapper.readTree(byteData);\n    }\n\n    public static void buildRequestParams(Map<String, String> requestParams, String uri) {\n        requestParams.put(RestConstant.JOB_ID, null);\n        requestParams.put(RestConstant.IS_START_WITH_SAVE_POINT, String.valueOf(false));\n        uri = StringUtil.stripTrailingSlash(uri);\n        if (!uri.contains(\"?\")) {\n            return;\n        }\n        int indexEnd = uri.indexOf('?');\n        try {\n            for (String s : uri.substring(indexEnd + 1).split(\"&\")) {\n                String[] param = s.split(\"=\");\n                requestParams.put(param[0], URLDecoder.decode(param[1], \"UTF-8\"));\n            }\n        } catch (IndexOutOfBoundsException e) {\n            throw new IllegalArgumentException(\"Invalid Params format in Params.\");\n        } catch (UnsupportedEncodingException e) {\n            throw new IllegalArgumentException(\"Unsupported encoding exists in the parameter.\");\n        }\n        if (Boolean.parseBoolean(requestParams.get(RestConstant.IS_START_WITH_SAVE_POINT))\n                && requestParams.get(RestConstant.JOB_ID) == null) {\n            throw new IllegalArgumentException(\"Please provide jobId when start with save point.\");\n        }\n    }\n\n    public static Config buildConfig(JsonNode jsonNode) {\n        Map<String, Object> objectMap = JsonUtils.toMap(jsonNode);\n        return ConfigBuilder.of(objectMap);\n    }\n\n    public static List<Tuple2<Map<String, String>, Config>> buildConfigList(JsonNode jsonNode) {\n        return StreamSupport.stream(jsonNode.spliterator(), false)\n                .filter(JsonNode::isObject)\n                .map(","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/utils/RestUtil.java#L46-L82","documentation":"Thrown by RestUtil.buildRequestParams when parsing the REST URI query string. Each parameter is split on '=' and both key and value are indexed; a parameter without a value (e.g. 'flag' or 'a==b') causes an IndexOutOfBoundsException, which is rethrown as this IllegalArgumentException. It signals a malformed query string sent to the SeaTunnel REST API.","triggerScenarios":"Calling any SeaTunnel REST endpoint with a malformed query string: a parameter missing its '=' and value (e.g. '?jobId'), an empty parameter between ampersands (e.g. '?a=1&&b=2'), or a trailing '&' with nothing after it.","commonSituations":"Hand-built curl/browser URLs with typos, scripting that appends '&' or partial parameters programmatically, URL templates where a variable failed to interpolate (leaving 'jobId=' empty or 'jobId' alone), or proxies rewriting query strings.","solutions":["Inspect the request URL and fix the query string so every parameter has the form key=value","Ensure no empty segments exist (no '&&', no trailing '&', no bare keys)","URL-encode values that contain '=' or '&' so splitting is not disrupted","Log the full request URI server-side to identify the offending parameter"],"exampleFix":"// before\ncurl 'http://host:5801/job-info?jobId'\n// after\ncurl 'http://host:5801/job-info?jobId=12345'","handlingStrategy":"validation","validationCode":"function validateQuery(qs) {\n  if (!qs) return true;\n  return qs.replace(/^[?]/, '').split('&').every(p => p.length > 0 && p.includes('='));\n}\nif (!validateQuery(queryString)) throw new Error('Malformed query string: each param must be key=value');","typeGuard":null,"tryCatchPattern":"try {\n  restUtil.buildRequestParams(uri);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Invalid Params format\")) {\n    log.error(\"Malformed query string: \" + uri);\n    // fix request URL and retry\n  } else throw e;\n}","preventionTips":["Always URL-encode parameter values (encodeURIComponent / URLEncoder)","Never append bare '&' or trailing separators when building URLs programmatically","Assert query-string shape with a validator before sending requests","Guard URL templates so missing variables do not produce empty params"],"tags":["rest","url-parsing","query-string"],"backgroundTag":"invalid-argument-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}