{"record":{"id":"5c30a3a0dd67682e","repo":"pentaho/pentaho-kettle","slug":"could-not-read-line-number-file","errorCode":null,"errorMessage":"Could not read line number file ","messagePattern":"Could not read line number file ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/core/playlist/FilePlayListReplayLineNumberFile.java","lineNumber":52,"sourceCode":"  }\n\n  private void initialize( FileObject lineNumberFile, String encoding ) throws KettleException {\n    BufferedReader reader = null;\n    try {\n      if ( encoding == null ) {\n        reader = new BufferedReader( new InputStreamReader( KettleVFS.getInputStream( lineNumberFile ) ) );\n      } else {\n        reader =\n          new BufferedReader( new InputStreamReader( KettleVFS.getInputStream( lineNumberFile ), encoding ) );\n      }\n      String line = null;\n      while ( ( line = reader.readLine() ) != null ) {\n        if ( line.length() > 0 ) {\n          lineNumbers.add( Long.valueOf( line ) );\n        }\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Could not read line number file \" + lineNumberFile.getName().getURI(), e );\n    } finally {\n      if ( reader != null ) {\n        try {\n          reader.close();\n        } catch ( IOException e ) {\n          throw new KettleException( \"Could not close line number file \" + lineNumberFile.getName().getURI(), e );\n        }\n      }\n    }\n  }\n\n  public boolean isProcessingNeeded( FileObject file, long lineNr, String filePart ) throws KettleException {\n    return lineNumbers.contains( new Long( lineNr ) );\n  }\n}\n","sourceCodeStart":34,"sourceCodeEnd":68,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/playlist/FilePlayListReplayLineNumberFile.java#L34-L68","documentation":"FilePlayListReplayLineNumberFile.initialize() reads a line-number file (used in replay/play-list mode to skip previously processed lines) and wraps any parsing/IO exception in this KettleException. Reading errors can also come from non-numeric line content.","triggerScenarios":"Constructor passes a lineNumberFile that cannot be read: missing file, permission problem, or content that fails Long.valueOf parsing.","commonSituations":"Replay file corrupted or truncated; file deleted between runs; wrong file passed as the line-number file; encoding/BOM causing parse failure.","solutions":["Verify the line-number file exists and is readable at the given URI","Check each line contains only a numeric line number","Regenerate the line-number file from the previous run","Check filesystem permissions on the file"],"exampleFix":"// before\n// lines like \"12abc\" in linenumber.txt\n// after\n// linenumber.txt contains one long per line: 12\\n45\\n","handlingStrategy":"validation","validationCode":"// Validate the line-number file before constructing the play-list replay object\nFileObject f = KettleVFS.getInstance(DefaultBowl.getInstance()).getFileObject(lineNumberUri);\nif (!f.exists() || !f.isReadable()) throw new IllegalStateException(\"Line number file missing/unreadable\");\ntry (BufferedReader r = new BufferedReader(new InputStreamReader(f.getContent().getInputStream()))) {\n  String line;\n  while ((line = r.readLine()) != null)\n    if (line.length() > 0) Long.parseLong(line.trim()); // throws if non-numeric\n}","typeGuard":null,"tryCatchPattern":"try {\n  playList = new FilePlayListReplayLineNumberFile(file, lineNumberFile, charset);\n} catch (KettleException e) {\n  if (e.getMessage().startsWith(\"Could not read line number file\")) {\n    log.error(\"Bad or missing replay line-number file: \", e.getCause());\n  } else throw e;\n}","preventionTips":["Never hand-edit the line-number file; keep one long per line","Back up the replay file between runs","Check file permissions before replaying a processing list"],"tags":["file-io","replay","parsing"],"backgroundTag":"file-read-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}