apache/hadoop · error · RuntimeException
missing task ID
Error message
missing task ID
What it means
requireTask guards task-scoped pages of the AM web UI: it needs the 'task.id' query parameter holding a full task id (task_<ts>_<seq>_[m|r]_<n>). When the value is missing or empty the page answers 400 (badRequest) and this RuntimeException aborts rendering.
Source
Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java:439
/* check for acl access */
Job job = app.context.getJob(jobID);
if (!checkAccess(job)) {
accessDenied("User " + request().getRemoteUser() + " does not have " +
" permission to view job " + $(JOB_ID));
throw new RuntimeException("Access denied: User " +
request().getRemoteUser() + " does not have permission to view job " +
$(JOB_ID));
}
}
/**
* Ensure that a TASK_ID was passed into the page.
*/
public void requireTask() {
if ($(TASK_ID).isEmpty()) {
badRequest("missing task ID");
throw new RuntimeException("missing task ID");
}
TaskId taskID = MRApps.toTaskID($(TASK_ID));
Job job = app.context.getJob(taskID.getJobId());
app.setJob(job);
if (app.getJob() == null) {
notFound(MRApps.toString(taskID.getJobId()));
throw new RuntimeException("Not Found: " + $(JOB_ID));
} else {
app.setTask(app.getJob().getTask(taskID));
if (app.getTask() == null) {
notFound($(TASK_ID));
throw new RuntimeException("Not Found: " + $(TASK_ID));
}
}
if (!checkAccess(job)) {
accessDenied("User " + request().getRemoteUser() + " does not have " +
" permission to view job " + $(JOB_ID));View on GitHub (pinned to 2add963021)
Solutions
- Append the full task id: /task?job.id=job_...&task.id=task_1401318629735_0001_m_000003
- Open the job's task list page first and follow the generated links
- Check that templating did not swallow the query string
Example fix
// before http://am-host:8099/task?job.id=job_1401318629735_0001 // 400 missing task ID // after http://am-host:8099/task?job.id=job_1401318629735_0001&task.id=task_1401318629735_0001_m_000003
Defensive patterns
Strategy: validation
Validate before calling
if (taskId == null || taskId.isEmpty() || !taskId.startsWith("task_")) {
throw new IllegalArgumentException(
"task.id query parameter is required: ?task.id=task_<ts>_<seq>_[m|r]_<n>");
}
String url = amUrl + "/task?job.id=" + enc(jobId) + "&task.id=" + enc(taskId); Type guard
static boolean isCompleteTaskUrl(String jobId, String taskId) {
return jobId != null && !jobId.isEmpty()
&& taskId != null && taskId.startsWith("task_");
} Prevention
- Require both job.id and task.id in the URL builder
- Get task ids from the job's task list page links
- Watch for templating engines that silently drop empty variables
When it happens
Trigger: Opening /task without ?task.id=task_..., or with an empty value; typically also missing job.id (that check runs first in some pages, task.id here).
Common situations: URL truncated when shared; scraping scripts that forget the parameter; links built from partial job data.
Related errors
- missing task-type.
- missing attempt-state.
- Bad Request: Missing job ID
- taskid {} not found or invalid
- task not found with id {}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/95555729a55a5c53.
Report an issue: GitHub.