pentaho/pentaho-kettle · error · KettleException

GPG.Exception.ExistStatus

Error message

GPG.Exception.ExistStatus

What it means

KettleException with key GPG.Exception.ExistStatus is thrown by GPG.execGnuPG when the gpg process terminates with a non-zero exit code. The stderr produced by the gpg process is embedded in the message, so the actual GnuPG failure (bad passphrase, missing key, unreadable file) is reported there. This is the standard way external-command failures from GPG file operations surface.

Solutions

  1. Read the stderr text in the exception message — it contains gpg's own diagnostic (e.g. 'No secret key', 'Bad passphrase').
  2. Import/verify the required keys: gpg --list-keys / --list-secret-keys for the userID used by the entry.
  3. Confirm the passphrase and userID configured in the JobPGPEncryptFiles entry match the keyring.
  4. Check input/output file paths exist and are readable/writable by the user running Kettle.
Defensive patterns

Strategy: validation

Validate before calling

// Before running the entry:
Process p = new ProcessBuilder("gpg", "--list-secret-keys", userId).start();
if (p.waitFor() != 0) throw new IllegalStateException("No signing key for " + userId);
if (!new java.io.File(inputPath).canRead()) throw new IllegalStateException("Input unreadable");

Try / catch

try {
  gpg.decryptFile(file, userId, pass, destFile, true);
} catch (KettleException ke) {
  // message embeds gpg stderr — surface it to the operator
  logger.error("gpg failed: " + ke.getMessage());
}

Prevention

When it happens

Trigger: Any of decryptFile, encryptFile, signAndEncryptFile, signFile, verifySignature, verifyDetachedSignature invoking gpg which completes but returns exitValue() != 0.

Common situations: Wrong or missing passphrase; private/public key not in the keyring for the given userID; input file does not exist or is not readable; gpg version differences in accepted options; corrupted or non-GPG input to decrypt/verify.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/4079870e0736ca43. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/pgpencryptfiles/GPG.java:219

          } catch ( Exception e ) {
            // Ignore
          }
        }
      }
    }

    try {
      p.waitFor();

      psr_stdout.join();
      psr_stderr.join();
    } catch ( InterruptedException i ) {
      throw new KettleException( BaseMessages.getString( PKG, "GPG.ExceptionWait" ), i );
    }

    try {
      if ( p.exitValue() != 0 ) {
        throw new KettleException( BaseMessages.getString( PKG, "GPG.Exception.ExistStatus", psr_stderr
          .getString() ) );
      }
    } catch ( IllegalThreadStateException itse ) {
      throw new KettleException( BaseMessages.getString( PKG, "GPG.ExceptionillegalThreadStateException" ), itse );
    } finally {
      p.destroy();
    }

    retval = psr_stdout.getString();

    return retval;

  }

  /**
   * Decrypt a file
   *
   * @param cryptedFilename

View on GitHub (pinned to f3058517a1)