{"record":{"id":"334436b05a886bfc","repo":"apache/hadoop","slug":"output-directory-not-set-in-jobconf","errorCode":null,"errorMessage":"Output directory not set in JobConf.","messagePattern":"Output directory not set in JobConf\\.","errorType":"exception","errorClass":"InvalidJobConfException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileOutputFormat.java","lineNumber":117,"sourceCode":"        throw new IllegalArgumentException(\"Compression codec \" + name + \n                                           \" was not found.\", e);\n      }\n    }\n    return codecClass;\n  }\n  \n  public abstract RecordWriter<K, V> getRecordWriter(FileSystem ignored,\n                                               JobConf job, String name,\n                                               Progressable progress)\n    throws IOException;\n\n  public void checkOutputSpecs(FileSystem ignored, JobConf job) \n    throws FileAlreadyExistsException, \n           InvalidJobConfException, IOException {\n    // Ensure that the output directory is set and not already there\n    Path outDir = getOutputPath(job);\n    if (outDir == null && job.getNumReduceTasks() != 0) {\n      throw new InvalidJobConfException(\"Output directory not set in JobConf.\");\n    }\n    if (outDir != null) {\n      FileSystem fs = outDir.getFileSystem(job);\n      // normalize the output directory\n      outDir = fs.makeQualified(outDir);\n      setOutputPath(job, outDir);\n      \n      // get delegation token for the outDir's file system\n      TokenCache.obtainTokensForNamenodes(job.getCredentials(), \n                                          new Path[] {outDir}, job);\n      \n      // check its existence\n      if (fs.exists(outDir)) {\n        throw new FileAlreadyExistsException(\"Output directory \" + outDir + \n                                             \" already exists\");\n      }\n    }\n  }","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileOutputFormat.java#L99-L135","documentation":"Error \"Output directory not set in JobConf.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileOutputFormat.java:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the output directory with FileOutputFormat.setOutputPath(job, path) or mapreduce.output.fileoutputformat.outputdir before submitting the job."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}