{"record":{"id":"c20c55dabc2bc620","repo":"apache/hadoop","slug":"fixed-record-length-is-invalid-it-should-be-s","errorCode":null,"errorMessage":"Fixed record length {} is invalid.  It should be set to a value greater than zero","messagePattern":"Fixed record length (.+?) is invalid\\.  It should be set to a value greater than zero","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FixedLengthInputFormat.java","lineNumber":84,"sourceCode":"   * @return the record length, zero means none was set\n   */\n  public static int getRecordLength(Configuration conf) {\n    return conf.getInt(FIXED_RECORD_LENGTH, 0);\n  }\n\n  @Override\n  public void configure(JobConf conf) {\n    compressionCodecs = new CompressionCodecFactory(conf);\n  }\n\n  @Override\n  public RecordReader<LongWritable, BytesWritable>\n      getRecordReader(InputSplit genericSplit, JobConf job, Reporter reporter)\n      throws IOException {\n    reporter.setStatus(genericSplit.toString());\n    int recordLength = getRecordLength(job);\n    if (recordLength <= 0) {\n      throw new IOException(\"Fixed record length \" + recordLength\n          + \" is invalid.  It should be set to a value greater than zero\");\n    }\n    return new FixedLengthRecordReader(job, (FileSplit)genericSplit,\n                                       recordLength);\n  }\n\n  @Override\n  protected boolean isSplitable(FileSystem fs, Path file) {\n    final CompressionCodec codec = compressionCodecs.getCodec(file);\n    return(null == codec);\n  }\n\n}\n","sourceCodeStart":66,"sourceCodeEnd":98,"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/FixedLengthInputFormat.java#L66-L98","documentation":"Error \"Fixed record length {} is invalid.  It should be set to a value greater than zero\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FixedLengthInputFormat.java:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set mapreduce.input.fixedlengthinputformat.record.length to a positive integer greater than zero."],"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-23T01:17:44.959Z"}