{"record":{"id":"a106020cf208b219","repo":"pentaho/pentaho-kettle","slug":"only-local-files-are-supported-at-this-time-file","errorCode":null,"errorMessage":"Only local files are supported at this time, file [","messagePattern":"Only local files are supported at this time, file \\[","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/mysqlbulkload/JobEntryMysqlBulkLoad.java","lineNumber":272,"sourceCode":"    result.setResult( false );\n\n    String vfsFilename = environmentSubstitute( filename );\n\n    // Let's check the filename ...\n    if ( !Utils.isEmpty( vfsFilename ) ) {\n      try {\n        // User has specified a file, We can continue ...\n        //\n\n        // This is running over VFS but we need a normal file.\n        // As such, we're going to verify that it's a local file...\n        // We're also going to convert VFS FileObject to File\n        //\n        FileObject fileObject = KettleVFS.getInstance( parentJobMeta.getBowl() ).getFileObject( vfsFilename, this );\n        if ( !( fileObject instanceof LocalFile ) ) {\n          // MySQL LOAD DATA can only use local files, so that's what we limit ourselves to.\n          //\n          throw new KettleException( \"Only local files are supported at this time, file [\"\n            + vfsFilename + \"] is not a local file.\" );\n        }\n\n        // Convert it to a regular platform specific file name\n        //\n        String realFilename = KettleVFS.getFilename( fileObject );\n\n        // Here we go... back to the regular scheduled program...\n        //\n        File file = new File( realFilename );\n        if ( ( file.exists() && file.canRead() ) || isLocalInfile() == false ) {\n          // User has specified an existing file, We can continue ...\n          if ( log.isDetailed() ) {\n            logDetailed( \"File [\" + realFilename + \"] exists.\" );\n          }\n\n          if ( connection != null ) {\n            // User has specified a connection, We can continue ...","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/mysqlbulkload/JobEntryMysqlBulkLoad.java#L254-L290","documentation":"Thrown by JobEntryMysqlBulkLoad.execute when the configured filename resolves through Kettle VFS to something other than a LocalFile. MySQL LOAD DATA (LOAD DATA LOCAL INFILE) can only read files on the local filesystem, so remote VFS schemes are rejected.","triggerScenarios":"execute() calls KettleVFS.getFileObject(vfsFilename) and the resolved FileObject is not an instanceof LocalFile — e.g. the filename is an sftp://, http://, hdfs://, s3://, zip: or other non-local VFS URI.","commonSituations":"User pasted an SFTP or HTTP URL as the bulk-load file; file lives inside a zip/jar accessed via VFS; a cluster/HDFS path used when running a distributed job; variable substitution unexpectedly resolves to a remote scheme.","solutions":["Copy the remote file to the local filesystem first (e.g. with a 'Get a file with FTP/SFTP' step or manual download) and point the entry at the local path.","Use an absolute local path or file:// URI for the filename field.","Check any Kettle variables used in the filename resolve to a local path at runtime."],"exampleFix":"// before\nString filename = \"sftp://user@host/data/infile.csv\";\n// after\ncopyViaSftpToLocal( \"sftp://user@host/data/infile.csv\", \"/tmp/infile.csv\" );\nString filename = \"/tmp/infile.csv\";","handlingStrategy":"validation","validationCode":"FileObject fo = KettleVFS.getInstance( bowl ).getFileObject( filename );\nif ( !( fo instanceof LocalFile ) ) {\n  throw new IllegalArgumentException( \"Copy to local disk first: \" + filename );\n}","typeGuard":"boolean isLocalFile( FileObject fo ) { return fo instanceof LocalFile; }","tryCatchPattern":"try {\n  result = jobEntry.execute( prevResult, nr );\n} catch ( KettleException e ) {\n  if ( e.getMessage().startsWith( \"Only local files are supported\" ) ) {\n    // copy remote resource to local temp and retry\n  }\n}","preventionTips":["Always configure local absolute paths for MySQL bulk-load files.","Add a pre-step that downloads remote files locally.","Beware VFS variables resolving to remote schemes.","Test filename resolution with Spoon before scheduling."],"tags":["vfs","filesystem","mysql","configuration"],"backgroundTag":"unsupported-operation","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"}