{"record":{"id":"d062e8b154cad7b1","repo":"pentaho/pentaho-kettle","slug":"gploaddataoutput-exception-fieldnotfound","errorCode":null,"errorMessage":"GPLoadDataOutput.Exception.FieldNotFound","messagePattern":"GPLoadDataOutput\\.Exception\\.FieldNotFound","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadDataOutput.java","lineNumber":159,"sourceCode":"      }\n\n      delimiter = meta.getDelimiter();\n      if ( delimiter == null ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPload.Exception.DelimiterMissing\" ) );\n      } else {\n        delimiter = gpLoad.environmentSubstitute( delimiter );\n        if ( Utils.isEmpty( delimiter ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPload.Exception.DelimiterMissing\" ) );\n        }\n      }\n\n      // Setup up the fields we need to take for each of the rows\n      // as this speeds up processing.\n      fieldNumbers = new int[meta.getFieldStream().length];\n      for ( int i = 0; i < fieldNumbers.length; i++ ) {\n        fieldNumbers[i] = mi.indexOfValue( meta.getFieldStream()[i] );\n        if ( fieldNumbers[i] < 0 ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPLoadDataOutput.Exception.FieldNotFound\", meta\n              .getFieldStream()[i] ) );\n        }\n      }\n\n      sdfDate = new SimpleDateFormat( \"yyyy-MM-dd\" );\n      sdfDateTime = new SimpleDateFormat( \"yyyy-MM-dd HH:mm:ss.SSS\" );\n    }\n\n    // Write the data to the output\n    ValueMetaInterface v = null;\n    int number = 0;\n\n    for ( int i = 0; i < fieldNumbers.length; i++ ) {\n      // TODO: variable substitution\n      if ( i != 0 ) {\n        output.print( delimiter );\n      }\n      number = fieldNumbers[i];","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadDataOutput.java#L141-L177","documentation":"writeLine() maps each configured field name to an index in the incoming row (RowMeta.indexOfValue). If a field listed in the step's 'field stream' is not present in the actual row, indexOfValue returns -1 and this KettleException is thrown naming the missing field.","triggerScenarios":"A field name configured in the GPload step does not exist in the row arriving at the step — renamed upstream, filtered out, wrong case, or the step's cached field list is stale after upstream changes.","commonSituations":"Upstream step renamed/deleted a column; GPload dialog fields configured when a different stream layout existed (no re-open/re-save after edits); case-sensitive mismatch between configured and actual field names.","solutions":["Open the GPload step, reselect the fields from the current stream, and save (refreshes fieldStream metadata)","Compare the configured field names with the actual row schema (use a Get Fields/preview) and fix names including case","Ensure upstream steps do not rename or remove the referenced fields (check Select values / Filter rows)","Re-run after re-saving so the cached field metadata is regenerated"],"exampleFix":"// before\nfieldStream = [\"cust_id\", \"amt\"]  // row has \"amount\" not \"amt\"\n// after\nfieldStream = [\"cust_id\", \"amount\"]","handlingStrategy":"validation","validationCode":"RowMetaInterface rowMeta = ...; // actual incoming row\nfor (String fieldName : meta.getFieldStream()) {\n  if (rowMeta.indexOfValue(fieldName) < 0) {\n    throw new IllegalStateException(\"Field not found in incoming row: \" + fieldName);\n  }\n}","typeGuard":"boolean fieldsExist(RowMetaInterface row, GPLoadMeta m) {\n  return java.util.Arrays.stream(m.getFieldStream()).allMatch(f -> row.indexOfValue(f) >= 0);\n}","tryCatchPattern":"try { ... } catch (KettleException e) { if (e.getMessage().contains(\"FieldNotFound\")) { logError(\"Missing field \" + e.getMessage() + \" — refresh GPload field mapping\"); } throw e; }","preventionTips":["After any upstream schema change, re-open and re-save the GPload step so its field list refreshes","Use Select values just before GPload to pin the expected schema and field names","Match field-name case exactly — indexOfValue is case-sensitive","Preview rows at the GPload input before running in production"],"tags":["kettle","pdi","schema","field-mapping"],"backgroundTag":"schema-validation-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"}