{"record":{"id":"02e6afd0de8992e0","repo":"pentaho/pentaho-kettle","slug":"throw-new-kettleexception-e","errorCode":null,"errorMessage":"throw new KettleException( e );","messagePattern":"throw new KettleException\\( e \\);","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/getfilenames/GetFileNames.java","lineNumber":228,"sourceCode":"          // isreadable\n          extraData[outputIndex++] = Boolean.valueOf( data.file.isReadable() );\n\n          // iswriteable\n          extraData[outputIndex++] = Boolean.valueOf( data.file.isWriteable() );\n\n          // lastmodifiedtime\n          extraData[outputIndex++] = new Date( data.file.getContent().getLastModifiedTime() );\n\n          // size\n          Long size = null;\n          if ( data.file.getType().equals( FileType.FILE ) ) {\n            size = new Long( data.file.getContent().getSize() );\n          }\n\n          extraData[outputIndex++] = size;\n\n        } catch ( IOException e ) {\n          throw new KettleException( e );\n        }\n\n        // extension\n        extraData[outputIndex++] = data.file.getName().getExtension();\n\n        // uri\n        extraData[outputIndex++] = Const.optionallyDecodeUriString( data.file.getName().getURI() );\n\n        // rooturi\n        extraData[outputIndex++] = data.file.getName().getRootURI();\n\n        // See if we need to add the row number to the row...\n        if ( meta.includeRowNumber() && !Utils.isEmpty( meta.getRowNumberField() ) ) {\n          extraData[outputIndex++] = new Long( data.rownr );\n        }\n\n        data.rownr++;\n        // Add row data","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/getfilenames/GetFileNames.java#L210-L246","documentation":"Wraps any IOException raised while reading extended file attributes (specifically the file's size via data.file.getContent().getSize()) during row processing of the GetFileNames step. The KettleStep rethrows it as a KettleException to abort the row with the original cause attached.","triggerScenarios":"IOException while resolving content size for a file in the file list (file disappeared between listing and read, I/O error, unsupported filesystem operation on VFS).","commonSituations":"File deleted/moved by another process after listing; network/SFTP/HTTP-backed VFS file became unreachable; permissions prevent stat.","solutions":["Check the wrapped cause (getCause()) to see the underlying IOException.","Verify the files still exist and are readable when the step runs.","For network-backed files, ensure connectivity/credentials and stable mounts.","Exclude size ('Include file size in output') if size is unavailable for that filesystem."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!fileObject.exists() || !fileObject.isReadable()) { /* skip or fail fast */ }","typeGuard":null,"tryCatchPattern":"try {\n  long size = data.file.getContent().getSize();\n} catch (IOException e) {\n  // fallback: omit size or mark null\n  size = -1;\n}","preventionTips":["Disable 'include file size' for filesystems where stat is unreliable","Ensure files are stable (not being written/moved) during the run","Check permissions and mounts before the transformation"],"tags":["pentaho","kettle","io-exception","file-size"],"backgroundTag":"file-read-failed","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"}