{"record":{"id":"77ce118e888019cb","repo":"apache/hadoop","slug":"jobstory-not-available-for-job","errorCode":null,"errorMessage":"JobStory not available for job {}","messagePattern":"JobStory not available for job (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/Statistics.java","lineNumber":109,"sourceCode":"        public JobClient run() throws IOException {\n          return new JobClient(new JobConf(conf));\n        }\n      });\n\n    this.jtPollingInterval = pollingInterval;\n    maxJobCompletedInInterval = conf.getInt(\n      MAX_JOBS_COMPLETED_IN_POLL_INTERVAL_KEY, 1);\n    this.startFlag = startFlag;\n  }\n\n  /**\n   * Generates a job stats.\n   */\n  public static JobStats generateJobStats(Job job, JobStory jobdesc) {\n    int seq = GridmixJob.getJobSeqId(job);\n    // bail out if job description is missing for a job to be simulated\n    if (seq >= 0 && jobdesc == null) {\n      throw new IllegalArgumentException(\"JobStory not available for job \" \n                                         + job.getJobID());\n    }\n    \n    int maps = -1;\n    int reds = -1;\n    if (jobdesc != null) {\n      // Note that the ZombieJob will return a >= 0 value\n      maps = jobdesc.getNumberMaps();\n      reds = jobdesc.getNumberReduces();\n    }\n    return new JobStats(maps, reds, job);\n  }\n\n  private static void addToNumMapsSubmitted(int numMaps) {\n    numMapsSubmitted += numMaps;\n  }\n\n  private static void addToNumReducesSubmitted(int numReduces) {","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/Statistics.java#L91-L127","documentation":"Statistics.generateJobStats(job, jobdesc) computes the gridmix job sequence id from the job configuration and throws IllegalArgumentException if seq >= 0 but the JobStory (job descriptor from the trace) is null. It is an internal invariant: every submitted gridmix job with a valid sequence number must carry its original trace job. The sole caller is JobSubmitter's statistics thread, so the exception surfaces from the submitter after job submission.","triggerScenarios":"A custom GridmixJob or JobFactory submits a job whose configuration carries the job-seq-id property but whose JobStory argument is null; replaying a trace where a submitted job has no corresponding trace job record (null desc from the factory).","commonSituations":"Extending gridmix (custom job factories/mappers) and not wiring the JobStory through; truncated or malformed trace files yielding null descriptions; version mismatches in gridmix extensions after upgrading Hadoop. Not triggerable by ordinary CLI configuration.","solutions":["Ensure your JobFactory/GridmixJob supplies a non-null JobStory for every job that carries a gridmix sequence id","If the job legitimately has no trace descriptor, clear/omit the job sequence id so seq < 0 (stats are then recorded with maps/reds = -1)","Regenerate the job trace from a clean job history so no submitted job maps to a null descriptor"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before recording stats for a submitted gridmix job\nJobStory desc = job.getJobDesc();\nif (desc == null && GridmixJob.getJobSeqId(job.getJob()) >= 0) {\n  // invariant violated upstream; fix the job factory instead of calling generateJobStats\n}","typeGuard":null,"tryCatchPattern":"try {\n  JobStats stats = Statistics.generateJobStats(job, jobdesc);\n} catch (IllegalArgumentException e) {\n  // job carried a gridmix seq id but no JobStory; repair the factory/trace wiring\n}","preventionTips":["In custom gridmix job factories, always pass the trace JobStory into the submitted job","Validate traces for per-job descriptors before replay"],"tags":["hadoop","gridmix","statistics","internal-invariant","job-trace"],"backgroundTag":"missing-job-trace-data","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}