{"record":{"id":"25f921d645c59db2","repo":"pentaho/pentaho-kettle","slug":"error-during-processing-a-row","errorCode":null,"errorMessage":"Error during processing a row","messagePattern":"Error during processing a row","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/loadfileinput/LoadFileInput.java","lineNumber":451,"sourceCode":"      }\n      // Add Uri\n      if ( !Utils.isEmpty( meta.getUriField() ) ) {\n        outputRowData[rowIndex++] = data.uriName;\n      }\n      // Add RootUri\n      if ( !Utils.isEmpty( meta.getRootUriField() ) ) {\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( \"Error during processing a row\", e );\n    }\n\n    return outputRowData;\n  }\n\n  public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {\n    meta = (LoadFileInputMeta) smi;\n    data = (LoadFileInputData) sdi;\n\n    if ( super.init( smi, sdi ) ) {\n      if ( !meta.getFileInFields() ) {\n        try {\n          data.files = meta.getFiles( getTransMeta().getBowl(), this );\n          handleMissingFiles();\n          // Create the output row meta-data\n          data.outputRowMeta = new RowMeta();\n          meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n            metaStore );","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/loadfileinput/LoadFileInput.java#L433-L469","documentation":"Generic wrapper in LoadFileInput.getOneRow(): any Exception thrown while processing a single file/row (opening the file, decoding content, extracting fields, converting types per field definitions) is rethrown as KettleException(\"Error during processing a row\", e). It is a catch-all around per-row processing, so the real cause is always in the wrapped exception.","triggerScenarios":"During processRow -> outputRowData -> getOneRow, when reading a file's content fails: IOException opening/reading the FileObject, unsupported encoding, charset decoding errors, field type conversion failures (e.g. string to number/date), or XML/XPath extraction errors depending on configuration.","commonSituations":"File deleted between listing and reading; wrong 'Encoding' selected (e.g. UTF-8 vs ISO-8859-1 with invalid bytes); field format masks that do not match actual data; transient NFS/S3 mounts dropping; binary/corrupt files fed into the step.","solutions":["Inspect the full stack trace's cause (the wrapped exception) — it names the actual file and failure.","Fix the encoding setting in the Content tab to match the source file's charset.","Correct field definitions (type, format, length) in the Fields tab to match file content, or enable tolerant parsing/error handling (step error handling with 'reject row').","Verify file availability/permissions at runtime; if content can be arbitrary, route bad files out before this step."],"exampleFix":"// before\n// Encoding: UTF-8 on a Windows-1252 file -> decoding exception -> \"Error during processing a row\"\n// after\n// Content tab: Encoding = ISO-8859-1 (or pre-convert file to UTF-8 before the step)","handlingStrategy":"try-catch","validationCode":"// Before running: verify encoding and field formats\nCharset.availableCharsets().containsKey(Charset.forName(configuredEncoding).name());\n// and confirm file exists: new File(path).exists()","typeGuard":null,"tryCatchPattern":"try {\n  while (processRow(...)) {}\n} catch (KettleException e) {\n  // Always log the wrapped cause — the real failure is e.getCause()\n  Throwable cause = e.getCause();\n  log.error(\"Row processing failed: \" + (cause != null ? cause.toString() : e.toString()), e);\n  // enable step error handling to route bad rows/files instead of failing the whole transformation\n}","preventionTips":["Match the step's Encoding setting to the actual file charset.","Validate Fields tab types/formats against sample data.","Configure step error handling (reject rows) for tolerant parsing.","Verify file availability and integrity before processing (checksums, size > 0)."],"tags":["file-io","row-processing","kettle","wrapper-exception"],"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"}