{"record":{"id":"36b97ee0e221361c","repo":"pentaho/pentaho-kettle","slug":"gpg-errorcheckinggpgfile","errorCode":null,"errorMessage":"GPG.ErrorCheckingGPGFile","messagePattern":"GPG\\.ErrorCheckingGPGFile","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/pgpencryptfiles/GPG.java","lineNumber":135,"sourceCode":"    // We have a filename, we need to check\n    FileObject file = null;\n    try {\n      file = KettleVFS.getInstance( bowl ).getFileObject( getGpgExeFile() );\n\n      if ( !file.exists() ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPG.GPGFilenameNotFound\" ) );\n      }\n      // The file exists\n      if ( !file.getType().equals( FileType.FILE ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPG.GPGNotAFile\", getGpgExeFile() ) );\n      }\n\n      // Ok we have a real file\n      // Get the local filename\n      this.gpgexe = KettleVFS.getFilename( file );\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPG.ErrorCheckingGPGFile\", getGpgExeFile() ), e );\n    } finally {\n      try {\n        if ( file != null ) {\n          file.close();\n        }\n      } catch ( Exception e ) {\n        // Ignore close errors\n      }\n    }\n  }\n\n  /**\n   * Returns GPG program location\n   *\n   * @return GPG filename\n   */\n  public String getGpgExeFile() {\n    return this.gpgexe;","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/pgpencryptfiles/GPG.java#L117-L153","documentation":"Thrown by the GPG constructor when any exception occurs while resolving or validating the GPG executable via VFS (e.g. a FileSystemException opening the file, access problems, or VFS scheme errors). It wraps the original exception with the configured gpg filename for diagnosis.","triggerScenarios":"Inside the GPG constructor's try block, KettleVFS.getInstance(bowl).getFileObject(getGpgExeFile()), file.exists(), file.getType(), or KettleVFS.getFilename(file) throws any Exception — bad VFS URI, permission issues on the path, or provider failure.","commonSituations":"Malformed VFS URI in the gpg path (e.g. stray spaces, unsupported scheme); OS permission denied traversing to the binary; VFS provider missing for the configured scheme; transient filesystem errors on network mounts.","solutions":["Read the wrapped cause (getCause()) to see the actual VFS/IO error and fix the path accordingly.","Use a plain absolute local filesystem path for the GPG executable to avoid VFS scheme issues.","Check OS permissions on every directory component of the path.","Ensure the Kettle VFS plugin/provider for the chosen scheme is installed."],"exampleFix":"// before\nString gpgPath = \"sftp://host/usr/bin/gpg\"; // remote scheme breaks VFS resolution\n// after\nString gpgPath = \"/usr/bin/gpg\"; // plain local path\nGPG gpg = new GPG( bowl, gpgPath, log );","handlingStrategy":"try-catch","validationCode":"// use a plain local path and check readability before construction\njava.io.File f = new java.io.File( gpgPath );\nif ( !f.canRead() ) throw new IllegalArgumentException( \"Cannot read GPG path: \" + gpgPath );","typeGuard":null,"tryCatchPattern":"try {\n  GPG gpg = new GPG( bowl, gpgPath, log );\n} catch ( KettleException e ) {\n  logError( \"GPG executable validation failed for \" + gpgPath + \": \" + e.getCause(), e );\n}","preventionTips":["Prefer plain local filesystem paths over exotic VFS schemes for the GPG binary.","Check OS permissions along the whole path.","Inspect the wrapped cause for the underlying VFS/IO error.","Avoid spaces and special characters in the executable path."],"tags":["gpg","vfs","filesystem","validation"],"backgroundTag":"file-open-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"}