{"record":{"id":"e40557ef9d15925f","repo":"pentaho/pentaho-kettle","slug":"propertyinput-error-cannotreadfromfile","errorCode":null,"errorMessage":"PropertyInput.Error.CanNotReadFromFile","messagePattern":"PropertyInput\\.Error\\.CanNotReadFromFile","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/propertyinput/PropertyInput.java","lineNumber":302,"sourceCode":"      }\n      // Add Uri\n      if ( !Utils.isEmpty( meta.getUriField() ) ) {\n        r[data.totalpreviousfields + rowIndex++] = data.uriName;\n      }\n      // Add RootUri\n      if ( !Utils.isEmpty( meta.getRootUriField() ) ) {\n        r[data.totalpreviousfields + rowIndex++] = data.rootUriName;\n      }\n\n      RowMetaInterface iRow = getInputRowMeta();\n\n      data.previousRow = iRow == null ? r : iRow.cloneRow( r ); // copy it to make\n      // surely the next step doesn't change it in between...\n\n      incrementLinesInput();\n      data.rownr++;\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"PropertyInput.Error.CanNotReadFromFile\", data.file\n        .toString() ), e );\n    }\n\n    return r;\n  }\n\n  private boolean openNextFile() {\n    try {\n      if ( !meta.isFileField() ) {\n        if ( data.filenr >= data.files.nrOfFiles() ) { // finished processing!\n\n          if ( log.isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"PropertyInput.Log.FinishedProcessing\" ) );\n          }\n          return false;\n        }\n\n        // Is this the last file?","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/propertyinput/PropertyInput.java#L284-L320","documentation":"PropertyInput.getOneRow() wraps any exception that occurs while reading a record from the current properties/INI file into a KettleException with this message and the file name. It indicates the file could not be parsed/read at the point of row production.","triggerScenarios":"An I/O or parse error inside loadProperties/loadIniFile while fetching the next row — corrupt or binary file passed in, encoding mismatch, unreadable file after open, or malformed INI content.","commonSituations":"Pointing the step at a non-properties/binary file; wrong encoding configured for the file; file truncated or removed mid-run; invalid INI syntax that the ini4j parser chokes on.","solutions":["Verify the file is a valid .properties/.ini file and open it manually","Match the encoding setting in the step dialog to the file's actual encoding","Check the wrapped cause (e.getCause()) for the underlying I/O or parse error","Repair or regenerate the corrupt file","Enable step-level error handling to route bad files to an error stream instead of failing the transformation"],"exampleFix":"// before: default charset mismatch\nmeta.setEncoding(null);\n// after\nmeta.setEncoding(\"UTF-8\"); // match the actual file encoding\n// and configure error handling:\nstepMeta.getStepErrorMeta().setEnabled(true);","handlingStrategy":"try-catch","validationCode":"// sanity-check the file before pointing the step at it\nFile f = new File(path);\nif (!f.isFile() || f.length() == 0) throw new IllegalStateException(\"Not a valid properties file: \" + path);","typeGuard":null,"tryCatchPattern":"try {\n  transformation.execute(params);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"CanNotReadFromFile\")) {\n    logError(\"Cannot read \" + extractFile(e.getMessage()) + \": \" + e.getCause());\n    // route to error handling / skip file\n  } else { throw e; }\n}","preventionTips":["Confirm input files are true .properties/.ini text files, not binary","Set the step's encoding to match the file encoding","Add step error handling to divert bad files instead of aborting the run","Keep error-handling rowsets so corrupted files can be inspected later"],"tags":["kettle","file-read","properties","encoding"],"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"}