{"record":{"id":"5612dc306dee034d","repo":"pentaho/pentaho-kettle","slug":"filesystemexception-wrapping-kettlefileexception","errorCode":null,"errorMessage":"FileSystemException wrapping KettleFileException","messagePattern":"FileSystemException wrapping KettleFileException","errorType":"exception","errorClass":"FileSystemException","httpStatus":null,"severity":"error","filePath":"plugins/s3-vfs/core/src/main/java/org/pentaho/amazon/s3/S3VfsFileChooserBaseDialog.java","lineNumber":91,"sourceCode":"    vfsFileChooserDialog.vfsBrowser.fileSystemTree.removeAll();\n    super.activate();\n\n    try {\n      String filename = Props.getInstance().getCustomParameter( \"S3VfsFileChooserDialog.Filename\", buildS3FileSystemUrlString() );\n      FileObject newRoot = resolveFile( filename );\n      vfsFileChooserDialog.vfsBrowser.resetVfsRoot( newRoot );\n    } catch ( FileSystemException ignored ) {\n      //ignored\n    }\n  }\n\n  public FileObject resolveFile( String fileUri ) throws FileSystemException {\n    Spoon spoon = Spoon.getInstance();\n    try {\n      return KettleVFS.getInstance( spoon.getExecutionBowl() )\n        .getFileObject( fileUri, getVariableSpace(), getFileSystemOptions() );\n    } catch ( KettleFileException e ) {\n      throw new FileSystemException( e );\n    }\n  }\n\n  public FileObject resolveFile( String fileUri, FileSystemOptions opts ) throws FileSystemException {\n    Spoon spoon = Spoon.getInstance();\n    try {\n      return KettleVFS.getInstance( spoon.getExecutionBowl() ).getFileObject( fileUri, getVariableSpace(), opts );\n    } catch ( KettleFileException e ) {\n      throw new FileSystemException( e );\n    }\n  }\n\n  private FileSystemOptions getFileSystemOptions() throws FileSystemException {\n    FileSystemOptions opts = new FileSystemOptions();\n    try {\n      String accessKey = \"\";\n      String secretKey = \"\";\n      /* For legacy transformations containing AWS S3 access credentials, {@link Const#KETTLE_USE_AWS_DEFAULT_CREDENTIALS} can force Spoon to use","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/s3-vfs/core/src/main/java/org/pentaho/amazon/s3/S3VfsFileChooserBaseDialog.java#L73-L109","documentation":"The S3 VFS file chooser dialog's resolveFile delegates to KettleVFS.getFileObject and converts KettleFileException into org.apache.commons.vfs2.FileSystemException, since the VFS API declares FileSystemException. The message is therefore a wrapper; the meaningful cause is the nested KettleFileException.","triggerScenarios":"newRoot -> resolveFile(fileUri) when KettleVFS cannot resolve the given S3 URI: invalid or unresolvable URI, missing bucket, VFS provider not registered, or variable substitution failures in the URI.","commonSituations":"Browsing to a bucket/folder that does not exist; typos in s3:// URIs; missing AWS credentials causing the S3 VFS provider to fail resolution; variables in the path that don't resolve in the Spoon context.","solutions":["Inspect the cause KettleFileException for the actual reason (not-found, auth, provider).","Verify the S3 URI format (s3://bucket/path) and that the bucket/prefix exists.","Check AWS credentials/region so the S3 VFS provider can resolve the file.","Resolve any unresolvable ${variables} used in the path before browsing."],"exampleFix":"// before\nreturn KettleVFS.getInstance( spoon.getExecutionBowl() )\n  .getFileObject( fileUri, getVariableSpace(), getFileSystemOptions() );\n// after: pre-validate the URI\nif ( fileUri == null || !fileUri.startsWith( \"s3://\" ) ) {\n  throw new FileSystemException( \"Invalid S3 URI: \" + fileUri );\n}\nreturn KettleVFS.getInstance( spoon.getExecutionBowl() )\n  .getFileObject( fileUri, getVariableSpace(), getFileSystemOptions() );","handlingStrategy":"try-catch","validationCode":"// check the URI shape before resolving\nif ( fileUri == null || !fileUri.matches( \"^s3://[^/]+/.+\" ) ) {\n  throw new IllegalArgumentException( \"Expected s3://bucket/key URI\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  FileObject fo = dialog.resolveFile( uri );\n} catch ( org.apache.commons.vfs2.FileSystemException e ) {\n  logError( \"Resolve failed: \" + e.getCause(), e );\n}","preventionTips":["Validate s3:// URI format before browsing","Ensure AWS credentials are configured for the S3 VFS provider","Confirm the bucket/prefix exists","Resolve ${variables} before passing the URI"],"tags":["vfs","s3","ui"],"backgroundTag":"file-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"}