{"record":{"id":"45221b9fcebf33f4","repo":"pentaho/pentaho-kettle","slug":"sftpput-error-sourcefilenamefieldmissing","errorCode":null,"errorMessage":"SFTPPut.Error.SourceFileNameFieldMissing","messagePattern":"SFTPPut\\.Error\\.SourceFileNameFieldMissing","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/sftpput/impl/src/main/java/org/pentaho/di/trans/steps/sftpput/SFTPPut.java","lineNumber":269,"sourceCode":"          file.close();\n        }\n        if ( inputStream != null ) {\n          inputStream.close();\n        }\n      } catch ( Exception e ) {\n        // ignore this\n      }\n    }\n    return true;\n  }\n\n  @VisibleForTesting\n  void checkSourceFileField( String sourceFilenameFieldName, SFTPPutData data ) throws KettleStepException {\n    // Sourcefilename field\n    sourceFilenameFieldName = environmentSubstitute( sourceFilenameFieldName );\n    if ( Utils.isEmpty( sourceFilenameFieldName ) ) {\n      // source filename field is missing\n      throw new KettleStepException( BaseMessages.getString( PKG, \"SFTPPut.Error.SourceFileNameFieldMissing\" ) );\n    }\n\n    data.indexOfSourceFileFieldName = getInputRowMeta().indexOfValue( sourceFilenameFieldName );\n    if ( data.indexOfSourceFileFieldName == -1 ) {\n      // source filename field is missing\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"SFTPPut.Error.CanNotFindField\", sourceFilenameFieldName ) );\n    }\n  }\n\n  @VisibleForTesting\n  void checkRemoteFoldernameField( String remoteFoldernameFieldName, SFTPPutData data ) throws KettleStepException {\n    // Remote folder fieldname\n    remoteFoldernameFieldName = environmentSubstitute( remoteFoldernameFieldName );\n    if ( Utils.isEmpty( remoteFoldernameFieldName ) ) {\n      // remote folder field is missing\n      throw new KettleStepException( BaseMessages.getString( PKG, \"SFTPPut.Error.RemoteFolderNameFieldMissing\" ) );\n    }","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/sftpput/impl/src/main/java/org/pentaho/di/trans/steps/sftpput/SFTPPut.java#L251-L287","documentation":"Thrown by checkSourceFileField when the configured source filename field name is empty after environment substitution. The step cannot locate the source data without knowing which row field holds the filename. Raised during field validation before processing rows.","triggerScenarios":"The 'Source filename fieldname' setting is blank in the step dialog (or the variable used for it substitutes to an empty string), and processRow invokes checkSourceFileField.","commonSituations":"Freshly configured step where the user forgot to pick the field; a KETTLE variable intended to hold the field name is undefined, substituting to empty; dialog settings lost after copying the step between transformations.","solutions":["Open the SFTPPut dialog and select the field that contains the source filename.","If a variable supplies the field name, define it (set variable step / kettle.properties) so substitution yields a non-empty value.","Use 'Get Fields' in the dialog to populate field names from the incoming stream.","Re-check the step after copying/cloning transformations to ensure settings persisted."],"exampleFix":"// before (dialog config)\nsourceFilenameField = \"\"; // or \"${SRC_FIELD}\" with SRC_FIELD undefined\n// after\nsourceFilenameField = \"filename\"; // or define SRC_FIELD=/path before run","handlingStrategy":"validation","validationCode":"String fieldName = environmentSubstitute(sourceFilenameFieldSetting);\nif (fieldName == null || fieldName.isEmpty()) {\n  throw new IllegalStateException(\"SFTPPut: source filename field must be configured\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  transform.execute();\n} catch (KettleStepException e) {\n  if (e.getMessage().contains(\"SourceFileNameFieldMissing\")) {\n    log.error(\"Configure the source filename field in the SFTPPut step\");\n  } else { throw e; }\n}","preventionTips":["Never leave required field settings blank; use 'Get Fields'.","Define any variables used for field names in kettle.properties or a Set Variable step.","Re-validate configuration after cloning/copying transformations."],"tags":["kettle","pentaho","sftp","missing-field","configuration"],"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"}