{"record":{"id":"eee0b77caf4cbcfd","repo":"pentaho/pentaho-kettle","slug":"csvinput-log-onlylocalfilesaresupported","errorCode":null,"errorMessage":"CsvInput.Log.OnlyLocalFilesAreSupported","messagePattern":"CsvInput\\.Log\\.OnlyLocalFilesAreSupported","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/csvinput/CsvInput.java","lineNumber":334,"sourceCode":"    try {\n\n      // Close the previous file...\n      //\n      data.closeFile();\n\n      if ( data.filenr >= data.filenames.length ) {\n        return false;\n      }\n\n      // Open the next one...\n      //\n      data.fieldsMapping = createFieldMapping( data.filenames[data.filenr], meta );\n      FileObject fileObject = KettleVFS.getInstance( getTransMeta().getBowl() )\n        .getFileObject( data.filenames[ data.filenr ], getTransMeta() );\n      if ( !( fileObject instanceof LocalFile ) ) {\n        // We can only use NIO on local files at the moment, so that's what we limit ourselves to.\n        //\n        throw new KettleException( BaseMessages.getString( PKG, \"CsvInput.Log.OnlyLocalFilesAreSupported\" ) );\n      }\n\n      if ( meta.isLazyConversionActive() ) {\n        data.binaryFilename = data.filenames[ data.filenr ].getBytes();\n      }\n\n      String vfsFilename = KettleVFS.getFilename( fileObject );\n\n      int bomSize = getBOMSize( vfsFilename );\n\n      data.fis = new FileInputStream( vfsFilename );\n      if ( 0 != bomSize ) {\n        data.fis.skip( bomSize );\n      }\n\n      data.fc = data.fis.getChannel();\n      data.bb = ByteBuffer.allocateDirect( data.preferredBufferSize );\n","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/csvinput/CsvInput.java#L316-L352","documentation":"The CSV input step uses Java NIO (FileChannel/ByteBuffer) for fast binary reading, which only works on local filesystem files. After resolving the file via KettleVFS it checks the FileObject type; if it is not a LocalFile instance, this KettleException is thrown because NIO cannot be applied to remote/protocol-based filesystems.","triggerScenarios":"data.filenames[filenr] resolves through VFS to a non-local file: e.g. an sftp://, http://, smb://, hdfs:// or webdav:// URL is configured (directly or passed via the filename field from a previous step) and openNextFile is called from processRow.","commonSituations":"Pointing CsvInput at an SFTP or HDFS file expecting transparent remote access; a previous step passing remote file names into the filename field; cluster environments where files exist only on a shared network mount accessed via a non-local VFS scheme.","solutions":["Move/copy the file to a local filesystem path and configure that path in the step.","Add a preceding step (e.g. a shell/script step or Get File) that downloads the remote file locally, then feed the local path to CsvInput.","Use the Text File Input step instead of Csv Input if remote VFS support is required, as it goes through the VFS stream API rather than NIO."],"exampleFix":"// before\nfilename = \"sftp://server/data/input.csv\"\n// after (downloaded first, then read locally)\nfilename = \"/tmp/input.csv\"","handlingStrategy":"validation","validationCode":"// ensure the path is a local file before the transformation reads it\njava.io.File f = new java.io.File(localPath);\nif (!f.isFile() || !f.canRead()) throw new IllegalStateException(\"Not a readable local file: \" + localPath);","typeGuard":null,"tryCatchPattern":"try { ... } catch (KettleException e) {\n  logError(\"CSV Input requires local files; check VFS scheme of: \" + filename, e);\n  setErrors(1);\n}","preventionTips":["Use only local absolute paths with Csv Input; download remote files first","Do not feed sftp/http/hdfs URLs into the filename field","Prefer Text File Input when remote VFS schemes are required","Stage incoming files to local disk with a pre-step"],"tags":["kettle","pentaho","vfs","nio","unsupported-operation"],"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"}