{"record":{"id":"0a854c205b46b194","repo":"pentaho/pentaho-kettle","slug":"error-adding-values-to-row","errorCode":null,"errorMessage":"Error adding values to row!","messagePattern":"Error adding values to row!","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/email-messages/impl/src/main/java/org/pentaho/di/trans/steps/mailinput/MailInput.java","lineNumber":236,"sourceCode":"      if ( isDebug() ) {\n        logDebug( BaseMessages.getString( PKG, \"MailInput.Log.FetchingMessage\", data.mailConn.getEffectiveMessageNumber( message ) ) );\n      }\n\n      try {\n        instance.parseToArray( r, message );\n      } catch ( Exception e ) {\n        String msg = e.getMessage();\n        if ( meta.isStopOnError() ) {\n          throw new KettleException( msg, e );\n        } else {\n          logError( msg, e );\n        }\n      }\n\n      incrementLinesInput();\n      data.rownr++;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Error adding values to row!\", e );\n    }\n\n    return r;\n  }\n\n  private boolean openNextFolder() {\n    try {\n      if ( !meta.isDynamicFolder() ) {\n        // static folders list\n        // let's check if we fetched all values in list\n        if ( data.folderenr >= data.folders.length ) {\n          // We have fetched all folders\n          if ( isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"MailInput.Log.FinishedProcessing\" ) );\n          }\n          return false;\n        }\n      } else {","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/email-messages/impl/src/main/java/org/pentaho/di/trans/steps/mailinput/MailInput.java#L218-L254","documentation":"MailInput.getOneRow() wraps any Exception that occurs while converting the current email's fields into a Kettle output row. It is the generic catch-all of the row-building step: the message was fetched but row data extraction (fields, attachments info, body, rownr handling) failed.","triggerScenarios":"Any exception inside the per-message field mapping in getOneRow() (called from outputRowData): e.g. getMessage() content access fails, a field value cannot be converted, attachment retrieval throws.","commonSituations":"Unreadable message bodies on the server; MIME parsing errors on specific emails; step field configuration referencing content the protocol cannot fetch (e.g. body on POP3 with folder not opened); connection dropped mid-row.","solutions":["Inspect e.getCause() for the underlying MessagingException/IOException","Reduce fetched fields (disable body/attachment fields) to isolate the failing field","Reopen the connection/folder and rerun the transformation","Check message-specific problems by logging message number/subject before mapping"],"exampleFix":"// before\nObject[] row = getOneRow(); // generic wrap hides real cause\n// after\ntry {\n  Object[] row = getOneRow();\n} catch ( KettleException e ) {\n  logError( \"Row failed for message \" + data.message.getMessageNumber() + \": \", e );\n  setErrors( 1 );\n  return null;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  Object[] row = getOneRow();\n} catch ( KettleException e ) {\n  logError( \"Error adding values to row: \" + e.getCause(), e );\n  setErrors( 1 );\n  return null; // stop or skip depending on error handling policy\n}","preventionTips":["Log message number/subject before mapping so failures are attributable","Limit fetched fields to what the protocol supports","Set the step's error handling to route bad rows to an error stream","Test transformations against real mailboxes containing edge-case emails"],"tags":["kettle","pdi","transformation","email","row-processing"],"backgroundTag":"unexpected-response-shape","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"}