{"record":{"id":"b903dbb8a2a92e52","repo":"pentaho/pentaho-kettle","slug":"error-getting-file-resource","errorCode":null,"errorMessage":"Error getting file resource!","messagePattern":"Error getting file resource!","errorType":"exception","errorClass":"KettleFileException","httpStatus":null,"severity":"warning","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/exceloutput/ExcelOutputExternalResourceConsumer.java","lineNumber":63,"sourceCode":"    if ( !isDataDriven( meta ) /* TODO */ ) {\n      StepMeta parentStepMeta = meta.getParentStepMeta();\n      if ( parentStepMeta != null ) {\n        TransMeta parentTransMeta = parentStepMeta.getParentTransMeta();\n        if ( parentTransMeta != null ) {\n          String[] paths = meta.getFiles( parentTransMeta );\n          if ( paths != null ) {\n            resources = new ArrayList<IExternalResourceInfo>( paths.length );\n\n            for ( String path : paths ) {\n              if ( !Const.isEmpty( path ) ) {\n                try {\n\n                  IExternalResourceInfo resource = ExternalResourceInfoFactory.createFileResource(\n                    KettleVFS.getInstance( parentTransMeta.getBowl() ).getFileObject( path ), false );\n                  if ( resource != null ) {\n                    resources.add( resource );\n                  } else {\n                    throw new KettleFileException( \"Error getting file resource!\" );\n                  }\n                } catch ( KettleFileException kfe ) {\n                  // TODO throw or ignore?\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n    return resources;\n  }\n\n  @Override\n  public Collection<IExternalResourceInfo> getResourcesFromRow( ExcelOutput excelOutput, RowMetaInterface rowMeta,\n                                                                Object[] row ) {\n    Collection<IExternalResourceInfo> resources = new LinkedList<IExternalResourceInfo>();\n    // For some reason the step doesn't return the StepMetaInterface directly, so go around it","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/exceloutput/ExcelOutputExternalResourceConsumer.java#L45-L81","documentation":"In getResourcesFromMeta of ExcelOutputMeta's external resource consumer, a null IExternalResourceInfo from ExternalResourceInfoFactory.createFileResource triggers this KettleFileException. It is immediately caught and swallowed by the adjacent catch block ('TODO throw or ignore?'), so it never propagates to callers.","triggerScenarios":"createFileResource() returns null for the resolved file path of the Excel output while listing resources — typically when the FileObject for the step's filename cannot be turned into a file resource descriptor.","commonSituations":"Testing external resource dependencies (resources()/testExcelOutputExternalResourceConsumer) with an unresolvable or variable-substituted-wrong filename; filename points to a VFS location the factory cannot describe; running the step's resource test before the output file/path is valid.","solutions":["Note this exception is currently swallowed — debug by logging inside the catch block or stepping through getResourcesFromMeta.","Verify the Excel output filename resolves to a concrete, existing path after environment substitution.","If resources must be reported, change the catch block to rethrow or collect the failure instead of ignoring it.","Check that no null/empty filename is passed into KettleVFS.getFileObject before factory creation."],"exampleFix":"// before\n} catch ( KettleFileException kfe ) {\n  // TODO throw or ignore?\n}\n// after\n} catch ( KettleFileException kfe ) {\n  log.logError( \"Could not resolve file resource for path: \" + path, kfe );\n}","handlingStrategy":"fallback","validationCode":"FileObject fo = KettleVFS.getInstance( bowl ).getFileObject( path );\nif ( fo == null || !fo.exists() ) logBasic( \"Resource path not resolvable: \" + path );","typeGuard":null,"tryCatchPattern":"// exception is currently swallowed by the library; treat resource listing as best-effort and check logs","preventionTips":["Set the Excel output filename to a concrete, existing path before running resource-dependent tooling.","Remember failures here are silent — add your own logging or upgrade when the TODO is resolved."],"tags":["pentaho-kettle","excel-output","external-resources","swallowed-exception"],"backgroundTag":"resource-not-found","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"}