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

  1. Include the numeric job id in the request path, e.g. GET /job-info/9218347100264553
  2. Only invoke the endpoint after a successful job submission returned a jobId
  3. Catch IllegalArgumentException and return a 400 with usage guidance
  4. 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

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


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/5515e64b13c5fe68. Report an issue: GitHub.