Support Questions
Find answers, ask questions, and share your expertise

failed to initialize decryption algorithm because java.lang.NullPointerException nifi ?

Explorer

trying to encrypt the content using PGP encryption algorithm in nifi flow but ending up with the error :

EDT ERROR: Failed to initialize decryption algorithm because -: java.lang.NullPointerException

6 REPLIES 6

Master Guru

@Veerendra Nath Jasthi

Providing a full stack trace from the nifi-app.log may help in understanding what is going on here.

Explorer

2018-03-21 13:46:21,063 ERROR [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:22,064 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:22,064 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:23,065 ERROR [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:23,065 ERROR [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:24,067 ERROR [Timer-Driven Process Thread-7] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:24,067 ERROR [Timer-Driven Process Thread-7] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:25,068 ERROR [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:25,068 ERROR [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:26,069 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:26,069 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:27,070 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:27,070 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:27,292 WARN [StandardProcessScheduler Thread-8] o.a.h.h.zookeeper.RecoverableZooKeeper Possibly transient ZooKeeper, quorum=pvhd3dev01.medassurant.local:2181,pvhd3dev02.medassurant.local:2181,pvhd3dev05.medassurant.local:2181, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase 2018-03-21 13:46:28,071 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:28,071 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:29,073 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:29,073 ERROR [Timer-Driven Process Thread-6] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:30,074 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:30,074 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:31,075 ERROR [Timer-Driven Process Thread-7] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:31,075 ERROR [Timer-Driven Process Thread-7] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:32,076 ERROR [Timer-Driven Process Thread-10] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:32,076 ERROR [Timer-Driven Process Thread-10] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:33,077 ERROR [Timer-Driven Process Thread-5] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:33,077 ERROR [Timer-Driven Process Thread-5] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 13:46:34,079 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 13:46:34,079 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null

Veerendra,

Please enable DEBUG level logging by editing the $NIFI_HOME/conf/logback.xml file and adding these lines:

	<logger name="org.apache.nifi.processors.standard.EncryptContent" level="DEBUG"/>
	<logger name="org.apache.nifi.security.util.crypto" level="DEBUG"/>

Wait 30 seconds for the changes to be picked up by NiFi and then please try to trigger the same flow. You should get more verbose output in the log file.

The sequence "Failed to initialize decryption algorithm because" isn't present anywhere in NiFi code, so I imagine this is coming from an underlying library, probably BouncyCastle. Can you please share the configuration you're using for EncryptContent processor and some sample input data (preferably generated specifically for debugging so it does not contain any sensitive data).

Explorer

after adding these lines

  1. <loggername="org.apache.nifi.processors.standard.EncryptContent"level="DEBUG"/>
  2. <loggername="org.apache.nifi.security.util.crypto"level="DEBUG"/>

Below is the log file :

2018-03-21 14:50:21,434 ERROR [Timer-Driven Process Thread-7] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 14:50:21,435 ERROR [Timer-Driven Process Thread-7] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 14:50:21,435 DEBUG [Timer-Driven Process Thread-7] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] has chosen to yield its resources; will not be scheduled to run again for 1000 milliseconds 2018-03-21 14:50:22,436 ERROR [Timer-Driven Process Thread-3] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 14:50:22,436 ERROR [Timer-Driven Process Thread-3] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 14:50:22,436 DEBUG [Timer-Driven Process Thread-3] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] has chosen to yield its resources; will not be scheduled to run again for 1000 milliseconds 2018-03-21 14:50:23,437 ERROR [Timer-Driven Process Thread-4] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 14:50:23,437 ERROR [Timer-Driven Process Thread-4] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 14:50:23,437 DEBUG [Timer-Driven Process Thread-4] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] has chosen to yield its resources; will not be scheduled to run again for 1000 milliseconds 2018-03-21 14:50:24,438 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 14:50:24,438 ERROR [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 14:50:24,438 DEBUG [Timer-Driven Process Thread-8] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] has chosen to yield its resources; will not be scheduled to run again for 1000 milliseconds 2018-03-21 14:50:25,439 ERROR [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] Failed to initialize decryption algorithm because - : java.lang.NullPointerException 2018-03-21 14:50:25,439 ERROR [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent java.lang.NullPointerException: null 2018-03-21 14:50:25,439 DEBUG [Timer-Driven Process Thread-1] o.a.n.processors.standard.EncryptContent EncryptContent[id=0162100f-4c3c-149a-1642-7d9b03658c1d] has chosen to yield its resources; will not be scheduled to run again for 1000 milliseconds

Explorer

Below are the EncryptContent processor : & attached input data as well.

Mode

Decrypt
Key Derivation Function
Bcrypt
Encryption Algorithm
PGP
Allow insecure cryptographic modes
Not Allowedtest.txt

These configuration values will not allow you to decrypt any data. You've selected PGP as the encryption algorithm, but provided Bcrypt as the Key Derivation Function. Those are not compatible. PGP does not use a KDF at all, so set it to None. You'll also need to provide a PGP Private Keyring File containing the private key used to decrypt the incoming data, and a PGP Private Keyring Passphrase which is used to access the private key.

; ;