{"record":{"id":"2c7cda109f475449","repo":"apache/hadoop","slug":"unable-to-load-configuration-for-job","errorCode":null,"errorMessage":"unable to load configuration for job: {}","messagePattern":"unable to load configuration for job: (.+?)","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AMWebServices.java","lineNumber":335,"sourceCode":"    checkAccess(job, hsr);\n    return new JobCounterInfo(this.appCtx, job);\n  }\n\n  @GET\n  @Path(\"/jobs/{jobid}/conf\")\n  @Produces({ MediaType.APPLICATION_JSON + \"; \" + JettyUtils.UTF_8,\n      MediaType.APPLICATION_XML + \"; \" + JettyUtils.UTF_8 })\n  public ConfInfo getJobConf(@Context HttpServletRequest hsr,\n      @PathParam(\"jobid\") String jid) {\n\n    init();\n    Job job = getJobFromJobIdString(jid, appCtx);\n    checkAccess(job, hsr);\n    ConfInfo info;\n    try {\n      info = new ConfInfo(job);\n    } catch (IOException e) {\n      throw new NotFoundException(\"unable to load configuration for job: \"\n          + jid);\n    }\n    return info;\n  }\n\n  @GET\n  @Path(\"/jobs/{jobid}/tasks\")\n  @Produces({ MediaType.APPLICATION_JSON + \"; \" + JettyUtils.UTF_8,\n      MediaType.APPLICATION_XML + \"; \" + JettyUtils.UTF_8 })\n  public TasksInfo getJobTasks(@Context HttpServletRequest hsr,\n      @PathParam(\"jobid\") String jid, @QueryParam(\"type\") String type) {\n\n    init();\n    Job job = getJobFromJobIdString(jid, appCtx);\n    checkAccess(job, hsr);\n    TasksInfo allTasks = new TasksInfo();\n    for (Task task : job.getTasks().values()) {\n      TaskType ttype = null;","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AMWebServices.java#L317-L353","documentation":"getJobConf builds a ConfInfo from the job; internally the job loads its configuration XML (job.xml) from the filesystem it was submitted to, usually HDFS under the staging directory. An IOException during that read is converted to HTTP 404 'unable to load configuration for job: <jid>', hiding the real I/O cause.","triggerScenarios":"GET /ws/v1/mapreduce/jobs/{jobid}/conf while job.xml is missing (staging dir cleaned), unreadable (permissions), or the filesystem is down (NameNode unavailable); also on secure clusters when the AM's delegation tokens expired.","commonSituations":"Retired job still listed by the AM with its conf already reaped; automated HDFS cleanup of staging directories; HDFS outage during a long-running job; job viewed right after submission before conf visible.","solutions":["Check the ApplicationMaster log for the underlying IOException - it names the real path and cause","Verify the file exists: hdfs dfs -ls <staging-dir>/<jobid>/job.xml; fix permissions if needed","If the job is finished, use the Job History Server REST endpoint /ws/v1/history/mapreduce/jobs/{jobid}/conf (port 19888)","Retry once HDFS recovers if the NameNode was the problem"],"exampleFix":"// before: finished job queried on the AM\nGET http://am-host:8099/ws/v1/mapreduce/jobs/job_1401318629735_0001/conf\n// 404 { \"unable to load configuration for job: ...\" }\n\n// after: finished job served by the Job History Server\nGET http://jhs-host:19888/ws/v1/history/mapreduce/jobs/job_1401318629735_0001/conf","handlingStrategy":"try-catch","validationCode":"// Cheap pre-check: query job state first; only RUNNING jobs reliably have conf on the AM\nJobInfo job = client.target(amBase).path(\"jobs/{jid}\")\n    .resolveTemplate(\"jid\", jid).request(MediaType.APPLICATION_JSON)\n    .get(JobInfo.class);\nif (!\"RUNNING\".equals(job.getState())) {\n  // use the Job History Server conf endpoint instead\n}","typeGuard":null,"tryCatchPattern":"try {\n  return client.target(amBase).path(\"jobs/{jid}/conf\")\n      .resolveTemplate(\"jid\", jid).request(MediaType.APPLICATION_JSON)\n      .get(ConfInfo.class);\n} catch (javax.ws.rs.NotFoundException nfe) {\n  // fall back to the history server for finished jobs\n  return client.target(jhsBase) // http://jhs:19888/ws/v1/history/mapreduce\n      .path(\"jobs/{jid}/conf\").resolveTemplate(\"jid\", jid)\n      .request(MediaType.APPLICATION_JSON).get(ConfInfo.class);\n}","preventionTips":["Do not retain AM conf URLs beyond the job's lifetime - switch to the history server when a job finishes","Keep staging directories until the history server has captured job data","On secure clusters, confirm the AM's delegation tokens remain valid for the job duration"],"tags":["mapreduce","rest","http-404","configuration","hdfs","job-conf"],"backgroundTag":"config-file-load-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}