pentaho/pentaho-kettle · error · KettleException
SFTPPut.Error.CanNotFindRemoteFolder
Error message
SFTPPut.Error.CanNotFindRemoteFolder
What it means
Thrown by SFTPPut.setSFTPDirectory when the target remote spool directory does not exist on the SFTP server and the 'Create remote folder' option (isCreateRemoteFolder) is disabled. The step refuses to upload into a non-existent directory rather than implicitly creating it.
Solutions
- Enable 'Create remote folder' in the SFTP Put step dialog so the step creates the directory
- Create the directory on the SFTP server manually (or via a prior Shell/Job step)
- Verify the exact remote path and the login account's home directory — log in with the same credentials and list directories
Example fix
// before: create remote folder disabled, path may not exist meta.setCreateRemoteFolder( false ); // after meta.setCreateRemoteFolder( true ); // step will mkdir the spool directory if missing
Defensive patterns
Strategy: validation
Validate before calling
// before running the transformation, verify the remote dir exists
SFTPClient client = new SFTPClient( Signals... );
client.connect( host, port, user, pass );
if ( !client.folderExists( remoteSpoolDir ) ) {
client.createFolder( remoteSpoolDir ); // or enable 'Create remote folder'
} Try / catch
try {
step.processRow();
} catch ( KettleException e ) {
if ( e.getMessage().contains( "CanNotFindRemoteFolder" ) ) {
logError( "Remote folder " + remoteSpoolDir + " missing — enable Create remote folder or mkdir it" );
} else { throw e; }
} Prevention
- Enable 'Create remote folder' for idempotent runs
- Verify the remote path with the same login account the step uses
- Watch for cleanup jobs that delete the spool directory between runs
When it happens
Trigger: folderExists(spoolDirectory) returns false and meta.isCreateRemoteFolder() is false; the path in the step's remote folder setting points to a directory that was deleted, renamed, or never created on the server.
Common situations: Typo in the remote path; connecting to a different SFTP account whose home directory lacks the folder; directories cleaned up by a retention job; pointing at a Windows vs Unix path convention mismatch.
Related errors
- FileSystemConfigBuilder could not parse parameter:
- For a SFTP connection server name and username must be set…
- Proxy server name must be set and server port must be…
- SFTPPut.Error.MoveToDestinationFolderIsEmpty
- SFTPPut.Error.RemoteFilenameFieldMissing
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/453d2cdae7c24151.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/sftpput/impl/src/main/java/org/pentaho/di/trans/steps/sftpput/SFTPPut.java:388
resultFile.setComment( BaseMessages.getString( PKG, "SFTPPut.Log.FilenameAddedToResultFilenames" ) );
addResultFile( resultFile );
if ( isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "SFTPPut.Log.FilenameAddedToResultFilenames", sourceData ) );
}
}
break;
}
} catch ( Exception e ) {
throw new KettleException( e );
}
}
protected void setSFTPDirectory( String spoolDirectory ) throws KettleException {
boolean existfolder = data.sftpclient.folderExists( spoolDirectory );
if ( !existfolder ) {
if ( !meta.isCreateRemoteFolder() ) {
throw new KettleException( BaseMessages.getString(
PKG, "SFTPPut.Error.CanNotFindRemoteFolder", spoolDirectory ) );
}
if ( isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "SFTPPut.Error.CanNotFindRemoteFolder", spoolDirectory ) );
}
// Let's create folder
data.sftpclient.createFolder( spoolDirectory );
if ( isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "SFTPPut.Log.RemoteFolderCreated", spoolDirectory ) );
}
}
data.sftpclient.chdir( spoolDirectory );
if ( isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "SFTPPut.Log.ChangedDirectory", spoolDirectory ) );
}
}View on GitHub (pinned to f3058517a1)