{"record":{"id":"eeda5afacb913658","repo":"pentaho/pentaho-kettle","slug":"changefileencoding-error-filenamefieldmissing","errorCode":"ChangeFileEncoding.Error.FilenameFieldMissing","errorMessage":"ChangeFileEncoding.Error.FilenameFieldMissing","messagePattern":"ChangeFileEncoding\\.Error\\.FilenameFieldMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/changefileencoding/ChangeFileEncoding.java","lineNumber":76,"sourceCode":"    meta = (ChangeFileEncodingMeta) smi;\n    data = (ChangeFileEncodingData) sdi;\n\n    Object[] outputRow = getRow(); // Get row from input rowset & set row busy!\n    if ( outputRow == null ) {\n      // no more input to be expected...\n      setOutputDone();\n      return false;\n    }\n\n    if ( first ) {\n      first = false;\n      // get the RowMeta\n      data.inputRowMeta = getInputRowMeta().clone();\n\n      // Check is source filename field is provided\n      if ( Utils.isEmpty( meta.getDynamicFilenameField() ) ) {\n        logError( BaseMessages.getString( PKG, \"ChangeFileEncoding.Error.FilenameFieldMissing\" ) );\n        throw new KettleException( BaseMessages.getString( PKG, \"ChangeFileEncoding.Error.FilenameFieldMissing\" ) );\n      }\n\n      // Check is target filename field is provided\n      if ( Utils.isEmpty( meta.getTargetFilenameField() ) ) {\n        throw new KettleException(\n            BaseMessages.getString( PKG, \"ChangeFileEncoding.Error.TargetFilenameFieldMissing\" ) );\n      }\n\n      // cache the position of the field\n      data.indexOfFileename = data.inputRowMeta.indexOfValue( meta.getDynamicFilenameField() );\n      if ( data.indexOfFileename < 0 ) {\n        // The field is unreachable !\n        logError( BaseMessages.getString( PKG, \"ChangeFileEncoding.Exception.CouldnotFindField\" ) + \"[\"\n            + meta.getDynamicFilenameField() + \"]\" );\n        throw new KettleException( BaseMessages.getString( PKG, \"ChangeFileEncoding.Exception.CouldnotFindField\",\n          meta.getDynamicFilenameField() ) );\n      }\n      // cache the position of the field","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/changefileencoding/ChangeFileEncoding.java#L58-L94","documentation":"ChangeFileEncoding processes rows where the source (and target) filenames come from fields in the incoming row stream. Before reading any row it validates the step configuration; it throws this localized KettleException when the 'filename field' setting — the input field that holds the source file path — is empty.","triggerScenarios":"processRow, on the first row, when Utils.isEmpty(meta.getDynamicFilenameField()) is true: the 'Filename fieldname' box in the Change File Encoding dialog was left blank.","commonSituations":"Step added to the transformation but never configured; configuration lost after copy-pasting steps or version upgrades; user assumed a static filename could be entered where only a field name is accepted.","solutions":["Open the Change File Encoding step and set 'Filename fieldname' to the incoming field containing the source file path.","Ensure the field actually exists in the input stream (e.g. comes from a 'Get File Names' or previous step).","Re-save the transformation and re-open the step to confirm the setting persisted."],"exampleFix":"// before\nfilenameField = null; // left blank in dialog\n// after\nfilenameField = \"source_file\"; // incoming field holding the path","handlingStrategy":"validation","validationCode":"if (meta.getDynamicFilenameField() == null || meta.getDynamicFilenameField().isEmpty()) {\n  throw new IllegalArgumentException(\"ChangeFileEncoding: 'Filename fieldname' must be set\");\n}\nif (!inputRowMeta.getFieldNames().contains(meta.getDynamicFilenameField())) {\n  throw new IllegalArgumentException(\"Field not in stream: \" + meta.getDynamicFilenameField());\n}","typeGuard":null,"tryCatchPattern":"try {\n  // execute transformation\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"FilenameFieldMissing\")) {\n    // reconfigure the step's filename field\n  } else { throw e; }\n}","preventionTips":["Always fill both filename fields in the dialog","Use 'Get fields' to pick valid field names","Preview rows before running the full transformation"],"tags":["kettle","configuration","missing-field"],"backgroundTag":"missing-required-config-field","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"}