{"record":{"id":"f01748de82e75a49","repo":"pentaho/pentaho-kettle","slug":"fileexists-error-filenamefieldmissing","errorCode":null,"errorMessage":"FileExists.Error.FilenameFieldMissing","messagePattern":"FileExists\\.Error\\.FilenameFieldMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExists.java","lineNumber":81,"sourceCode":"    }\n\n    boolean fileexists = false;\n    String filetype = null;\n\n    try {\n      if ( first ) {\n        first = false;\n        // get the RowMeta\n        data.previousRowMeta = getInputRowMeta().clone();\n        data.NrPrevFields = data.previousRowMeta.size();\n        data.outputRowMeta = data.previousRowMeta;\n        meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n          metaStore );\n\n        // Check is tablename field is provided\n        if ( Utils.isEmpty( meta.getDynamicFilenameField() ) ) {\n          logError( BaseMessages.getString( PKG, \"FileExists.Error.FilenameFieldMissing\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"FileExists.Error.FilenameFieldMissing\" ) );\n        }\n\n        // cache the position of the field\n        if ( data.indexOfFileename < 0 ) {\n          data.indexOfFileename = data.previousRowMeta.indexOfValue( meta.getDynamicFilenameField() );\n          if ( data.indexOfFileename < 0 ) {\n            // The field is unreachable !\n            logError( BaseMessages.getString( PKG, \"FileExists.Exception.CouldnotFindField\" )\n              + \"[\" + meta.getDynamicFilenameField() + \"]\" );\n            throw new KettleException( BaseMessages.getString( PKG, \"FileExists.Exception.CouldnotFindField\", meta\n              .getDynamicFilenameField() ) );\n          }\n        }\n      } // End If first\n\n      Object[] outputRow = RowDataUtil.allocateRowData( data.outputRowMeta.size() );\n      for ( int i = 0; i < data.NrPrevFields; i++ ) {\n        outputRow[i] = r[i];","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExists.java#L63-L99","documentation":"The FileExists step requires a 'filename field' name configured in its metadata: the name of the incoming row field that holds the filename to test. processRow() throws a KettleException (after logging the localized 'FilenameFieldMissing' message) when that setting is empty during the first row processing.","triggerScenarios":"Executing a FileExists step whose 'Filename field' dropdown/property was never set, detected on the first processed row.","commonSituations":"Step added programmatically or by copy-paste without configuring the field; a repository/XML import losing step attributes; user leaving the field blank in the dialog.","solutions":["Open the File Exists step dialog and set the 'Filename field' to an incoming field.","Verify the saved ktr/repository record contains the filenamefield attribute.","Recreate the step if its metadata was corrupted by an import or upgrade."],"exampleFix":"// before\nmeta.setDynamicFilenameField(null);\n// after\nmeta.setDynamicFilenameField(\"filename\");","handlingStrategy":"validation","validationCode":"if (meta.getDynamicFilenameField() == null || meta.getDynamicFilenameField().isEmpty()) {\n  throw new IllegalStateException(\"FileExists step requires a 'Filename field' setting\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"FileExists.Error.FilenameFieldMissing\")) {\n    // fix step configuration in the ktr and reload\n  } else { throw e; }\n}","preventionTips":["Always set 'Filename field' when adding the FileExists step.","Validate step configuration programmatically before executing generated transformations.","Review steps after import/copy-paste operations for missing attributes."],"tags":["etl","step-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"}