apache/seatunnel · error · IllegalArgumentException
The jobId must not be empty.
Error message
The jobId must not be empty.
What it means
JobInfoServlet.doGet strips the leading slash from pathInfo to get the jobId; when pathInfo is missing, empty, or only a slash, it throws IllegalArgumentException because job info lookup requires a specific job id. The servlet pattern is GET .../<jobId> returning the job's info JSON.
Source
Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/servlet/JobInfoServlet.java:48
public class JobInfoServlet extends BaseServlet {
private final JobInfoService jobInfoService;
public JobInfoServlet(NodeEngineImpl nodeEngine) {
super(nodeEngine);
this.jobInfoService = new JobInfoService(nodeEngine);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String jobIdStr = req.getPathInfo();
if (jobIdStr != null && jobIdStr.length() > 1) {
jobIdStr = jobIdStr.substring(1);
} else {
throw new IllegalArgumentException("The jobId must not be empty.");
}
Long jobId = Long.valueOf(jobIdStr);
writeJson(resp, jobInfoService.getJobInfoJson(jobId));
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Include the numeric job id in the request path, e.g. GET /job-info/9218347100264553
- Only invoke the endpoint after a successful job submission returned a jobId
- Catch IllegalArgumentException and return a 400 with usage guidance
- Log/propagate the jobId from job submission so it is never empty downstream
Example fix
// before
fetch(`/job-info/${jobId}`); // jobId is undefined -> 'undefined'/empty
// after
if (!jobId) throw new Error('jobId required');
fetch(`/job-info/${jobId}`); Defensive patterns
Strategy: validation
Validate before calling
if (jobId == null || jobId.isBlank() || !jobId.matches("\\d+")) throw new IllegalArgumentException("valid numeric jobId required"); Type guard
boolean isNumericJobId(String s) { return s != null && s.matches("\\d+"); } Try / catch
try { info = getJobInfo(jobId); } catch (IllegalArgumentException e) { redirectToListPage(); } Prevention
- Propagate the submitted job's id through your pipeline metadata store
- Avoid hand-building job-info URLs from untrusted templates
- Add client-side URL validation before fetch
When it happens
Trigger: GET the job-info endpoint without a /<jobId> path segment (pathInfo null, empty, or '/').
Common situations: Automation pipelines that lost the job id after submission failure; hand-typed URLs; load balancers normalizing trailing slashes away; client templates with an unfilled {jobId} placeholder.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- The jobId must not be empty.
- The jobId must not be empty.
- Parameter 'pluginName' cannot be empty.
- Page number must be greater than 0
- Page number exceeds total pages
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/5515e64b13c5fe68.
Report an issue: GitHub.