{"record":{"id":"d2211c6e7c86501e","repo":"pentaho/pentaho-kettle","slug":"symmetriccrypto-schememissing","errorCode":"SymmetricCrypto.SchemeMissing","errorMessage":"SymmetricCrypto.SchemeMissing","messagePattern":"SymmetricCrypto\\.SchemeMissing","errorType":"exception","errorClass":"CryptoException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/symmetriccrypto/symmetricalgorithm/SymmetricCrypto.java","lineNumber":59,"sourceCode":"  private Cipher cipher;\n\n  private SecretKeySpec secretKeySpec;\n\n  /** Encryption/ decryption scheme **/\n  private String scheme;\n\n  /**\n   * Construct a new Symetric SymmetricCrypto trans\n   *\n   * @param inf\n   *          The Database Connection Info to construct the connection with.\n   */\n  public SymmetricCrypto( SymmetricCryptoMeta meta ) throws CryptoException {\n    this.meta = meta;\n    this.scheme = meta.getDefaultScheme();\n    try {\n      if ( this.scheme == null ) {\n        throw new CryptoException( BaseMessages.getString( PKG, \"SymmetricCrypto.SchemeMissing\" ) );\n      }\n      this.cipher = Cipher.getInstance( this.scheme );\n    } catch ( Exception e ) {\n      throw new CryptoException( e );\n    }\n  }\n\n  /**\n   * Construct a new Symetric SymmetricCrypto trans\n   *\n   * @param inf\n   *          The Database Connection Info to construct the connection with.\n   */\n  public SymmetricCrypto( SymmetricCryptoMeta meta, String xform ) throws CryptoException {\n    this.meta = meta;\n    this.scheme = Const.NVL( xform, meta.getDefaultScheme() );\n    try {\n      if ( this.scheme == null ) {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/symmetriccrypto/symmetricalgorithm/SymmetricCrypto.java#L41-L77","documentation":"The SymmetricCrypto(Meta) constructor throws CryptoException with message 'SymmetricCrypto.SchemeMissing' when meta.getDefaultScheme() returns null, i.e. no cipher transformation (e.g. AES) was configured on the SymmetricCryptoMeta. It cannot instantiate a JCE Cipher without a scheme.","triggerScenarios":"new SymmetricCrypto(symmetricCryptoMeta) where the meta was built without a scheme: defaultScheme null, plugin not initialized, or algorithm name not set in metadata.","commonSituations":"Building SymmetricCryptoMeta programmatically without calling setDefault()/setting the scheme; loading step metadata from a repository row where the algorithm field was empty; custom crypto plugin returning null default scheme.","solutions":["Set the scheme on the meta before constructing: meta.setDefault() or set the algorithm field","Verify the transformation step's 'Algorithm' property is populated in Spoon","Check that the loaded metadata actually read the scheme (not lost in XML/repository load)","Pass an explicit scheme via the SymmetricCrypto(meta, xform) constructor instead"],"exampleFix":"// before\nSymmetricCryptoMeta meta = new SymmetricCryptoMeta(); // scheme null\nSymmetricCrypto crypto = new SymmetricCrypto(meta);\n// after\nSymmetricCryptoMeta meta = new SymmetricCryptoMeta();\nmeta.setDefault(); // sets default scheme e.g. AES\nSymmetricCrypto crypto = new SymmetricCrypto(meta);","handlingStrategy":"validation","validationCode":"if (meta == null || meta.getDefaultScheme() == null) {\n  throw new IllegalArgumentException(\"Scheme must be set on SymmetricCryptoMeta before construction\");\n}","typeGuard":"boolean hasScheme(SymmetricCryptoMeta m) { return m != null && m.getDefaultScheme() != null; }","tryCatchPattern":"try { crypto = new SymmetricCrypto(meta); } catch (CryptoException e) { log.error(\"Scheme missing/invalid: \" + e.getMessage(), e); }","preventionTips":["Always call meta.setDefault() or set the scheme explicitly","Null-check scheme values sourced from variables or fields","Load metadata through loadXML/readRep so fields are populated"],"tags":["crypto","null-scheme","jce","configuration"],"backgroundTag":"missing-required-config-field","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"}