{"record":{"id":"58adb08e257a219a","repo":"pentaho/pentaho-kettle","slug":"ldifinput-exception-unabletoreadfile","errorCode":"LDIFInput.Exception.UnableToReadFile","errorMessage":"LDIFInput.Exception.UnableToReadFile","messagePattern":"LDIFInput\\.Exception\\.UnableToReadFile","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/ldifinput/LDIFInput.java","lineNumber":227,"sourceCode":"      }\n      // Add Uri\n      if ( meta.getUriField() != null && meta.getUriField().length() > 0 ) {\n        outputRowData[rowIndex++] = data.uriName;\n      }\n      // Add RootUri\n      if ( meta.getRootUriField() != null && meta.getRootUriField().length() > 0 ) {\n        outputRowData[rowIndex++] = data.rootUriName;\n      }\n      RowMetaInterface irow = getInputRowMeta();\n\n      data.previousRow = irow == null ? outputRowData : irow.cloneRow( outputRowData ); // copy it to make\n      // surely the next step doesn't change it in between...\n\n      incrementLinesInput();\n      data.rownr++;\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"LDIFInput.Exception.UnableToReadFile\", data.file\n        .toString() ), e );\n    }\n\n    return outputRowData;\n  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n\n    Object[] r = null;\n\n    boolean sendToErrorRow = false;\n    String errorMessage = null;\n\n    try {\n      // Grab one row\n      Object[] outputRowData = getOneRow();\n      if ( outputRowData == null ) {\n        setOutputDone(); // signal end to receiver(s)","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/ldifinput/LDIFInput.java#L209-L245","documentation":"LDIFInput.getOneRow wraps all per-row processing in a catch-all that rethrows as KettleException with message 'Unable to read file' plus the current file name. It fires when any exception occurs while reading/parsing the LDIF file or building the output row. The original exception is chained as the cause, so the real reason (IO error, parse failure, etc.) is in the stack trace.","triggerScenarios":"getOneRow() processes a row for the current LDIF file (data.file) and any Exception escapes the try block — e.g. VFS cannot open the file, the file stream read fails, or LDIF parsing throws.","commonSituations":"File deleted or moved between listing and reading; network/remote file (VFS) unreachable; file encoding or malformed LDIF content causes parser exception; permission denied at read time.","solutions":["Inspect the chained cause (e.getMessage()/stack trace) for the real underlying failure.","Verify the file still exists and is readable at processing time (ls -l / stat the path).","Re-add the file in the step's file list or fix the wildcard/directory so only valid LDIF files are selected.","If remote (SFTP/HTTP via VFS), check connectivity and credentials.","Re-export or regenerate a corrupt LDIF file and retry."],"exampleFix":"// before: transformation fails at runtime with opaque message\n// after: pre-validate files in an earlier step or fix the input list\nString path = environmentSubstitute(\"${INPUT_FILE}\");\nFile f = new File(path);\nif (!f.isFile() || !f.canRead()) {\n  throw new KettleException(\"LDIF file missing/unreadable: \" + path);\n}","handlingStrategy":"try-catch","validationCode":"File f = new File(path);\nif (!f.isFile() || !f.canRead()) throw new KettleException(\"Unreadable LDIF file: \" + path);","typeGuard":null,"tryCatchPattern":"try {\n  // run transformation / process row\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  log.error(\"LDIF read failed for file, cause: \" + (cause != null ? cause.toString() : \"n/a\"), e);\n  // route row to error handling / skip file\n}","preventionTips":["Pre-validate files exist and are readable before running the transformation","Check the chained cause, not just the wrapper message","Use stable local paths or verify remote connectivity/credentials","Regenerate corrupted LDIF sources"],"tags":["kettle","pentaho","file-io","ldif","transformation"],"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"}