{"record":{"id":"38d080a23163d25d","repo":"apache/hadoop","slug":"unable-to-load-configuration-for-job-jid","errorCode":null,"errorMessage":"unable to load configuration for job: {jid}","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-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsWebServices.java","lineNumber":327,"sourceCode":"    checkAccess(job, hsr);\n    return new JobCounterInfo(this.ctx, job);\n  }\n\n  @GET\n  @Path(\"/mapreduce/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 = AMWebServices.getJobFromJobIdString(jid, ctx);\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(\"/mapreduce/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 = AMWebServices.getJobFromJobIdString(jid, ctx);\n    checkAccess(job, hsr);\n    TasksInfo allTasks = new TasksInfo();\n    for (Task task : job.getTasks().values()) {\n      TaskType ttype = null;","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsWebServices.java#L309-L345","documentation":"Returned by the JobHistoryServer REST endpoint GET /ws/v1/history/mapreduce/jobs/{jobid}/conf when constructing the ConfInfo object from the job's stored configuration throws IOException. The server maps that to a NotFoundException (HTTP 404), meaning the job id was accepted but its configuration could not be loaded from history storage — typically because the history file/conf section is missing, partial, or not yet available.","triggerScenarios":"GET /ws/v1/history/mapreduce/jobs/job_1400000000000_0001/conf where the job's history data has not been moved to the done directory, the job.conf is absent from the history file, or the file is corrupt. Also hit when the job id exists in cache but its done-file was deleted by retention/cleanup.","commonSituations":"Querying a just-finished job before moveToDone completes and JHS refreshes its cache; History files removed by mapreduce.jobhistory.cleaner or manual cleanup while JHS still lists the job; Corrupt/partial history file after JHS or NN restart mid-write; Pointing the request at the wrong JobHistoryServer (multi-cluster, wrong federation view)","solutions":["Retry after the job fully retires to done and the JHS cache refresh interval (mapreduce.jobhistory.loadedjobs.cache.size / date-cached interval) elapses","Confirm the job exists: GET /ws/v1/history/mapreduce/jobs and check the listed finish time","Inspect JHS and NameNode logs for the underlying IOException (missing file, permissions, checksum)","Verify the job id matches this cluster's history (application id range) and that the done dir is reachable"],"exampleFix":"// before\ncurl -s http://jhs:19888/ws/v1/history/mapreduce/jobs/job_1234567890000_0001/conf\n\n// after\n# confirm the job and its finish state first\ncurl -s http://jhs:19888/ws/v1/history/mapreduce/jobs | jq '.jobs.job[] | select(.id==\"job_1234567890000_0001\")'\n# then retry /conf; if 404 persists, check JHS logs for the IOException cause","handlingStrategy":"try-catch","validationCode":"// probe availability before requesting conf\ncurl -sf \"$JHS/ws/v1/history/mapreduce/jobs/$JID\" >/dev/null || echo \"job not in history yet\"","typeGuard":null,"tryCatchPattern":"try {\n  ConfInfo conf = jhsClient.getJobConf(jobId);\n} catch (NotFoundException e) { // javax.ws.rs.NotFoundException / HTTP 404\n  // job history not fully loaded yet, or conf missing from history file\n  scheduleRetry(jobId, delay = jhsCacheRefreshInterval);\n  if (retriesExhausted) alert(\"history conf unavailable for \" + jobId);\n}","preventionTips":["Treat 404 on /conf as retryable-until-timeout for freshly finished jobs; permanent for cleaned history","Wait for job state FINISHED plus the JHS loaded-jobs cache interval before scraping conf","Monitor history-file retention so dashboards do not reference deleted jobs"],"tags":["hadoop","mapreduce","jobhistory","rest","http-404","configuration","history-file"],"backgroundTag":"job-history-missing","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}