Created 01-18-2024 11:34 PM
Hi there, I need some help regarding using a flow.xml.gz from 1.13 to 1.24. First our nifi setup:
2 node cluster running on ec2 instances in aws where we run nifi in docker containers. We have succesfully upgraded from 1.13 to 1.24 after making a backup of the flow.xml.gz file.
We then stop the nifi containers and put back the flow.xml.gz from version 1.13. Then startup nifi. Unfortunately we get the following error:
Created on 01-19-2024 10:05 AM - edited 01-19-2024 10:07 AM
@Dave0x1
That is a big jump in versions from 1.13 directly to 1.24.
Use NiFi toolkit instead to change the algorithm.
https://nifi.apache.org/download/
NiFi Toolkit 1.24.0
./encrypt-config.sh -n <nifi.properties from original 1.13 NiFi> -f <flow.xml.gz from original 1.13 NiFi> -x -s <sensitive props key from NiFi> -b <bootstrap.conf from original 1.13 NiFi> -A NIFI_PBKDF2_AES_GCM_256 -g <new 1.24 flow.xml.gz filename>
Then in your NiFi 1.24 remove or rename the current flow.xml.gz and flow.json.gz files.
Place the flow.xml.gz output from above toolkit command into same location and make sure permissions and ownership are correct.
Start your NiFi 1.24. Since the flow.json.gz does not exist, NiFi will load the flow.xml.gz and upon successful startup generate the new flow.json.gz file it will load from that point forward each time NiFi is restarted.
Hope this works for you.
If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.
Thank you,
Mat
Created 01-22-2024 06:12 AM
Above registry issue also solve, with the help of this thread 🤓
https://community.cloudera.com/t5/Support-Questions/NIfi-and-Nifi-Registry-Integration/m-p/286469
Created 01-22-2024 08:42 PM
@Dave0x1, I'm happy to see that you resolved your issue. Can you kindly mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future?
Regards,
Vidya Sargur,Created 01-19-2024 07:51 AM
After some trial and errors found where the problem lies, our nifi 1.13 uses the old alogrithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
I tried to change this running the following command to change the flow.xml.gz and flow.json.gz to the correct algo.
# ./nifi.sh set-sensitive-properties-algorithm NIFI_PBKDF2_AES_GCM_256
Java home: /opt/java/openjdk
NiFi home: /opt/nifi/nifi-current
Bootstrap Config File: /opt/nifi/nifi-current/conf/bootstrap.conf
Failed to process Flow Configuration [/nifi-data/conf/flow.xml.gz]
org.apache.nifi.encrypt.EncryptionException: Decryption Failed with Algorithm [AES/GCM/NoPadding]
at org.apache.nifi.encrypt.CipherPropertyEncryptor.decrypt(CipherPropertyEncryptor.java:78)
at org.apache.nifi.flow.encryptor.AbstractFlowEncryptor.getOutputEncrypted(AbstractFlowEncryptor.java:31)
at org.apache.nifi.flow.encryptor.XmlFlowEncryptor.processFlow(XmlFlowEncryptor.java:57)
at org.apache.nifi.flow.encryptor.StandardFlowEncryptor.processFlow(StandardFlowEncryptor.java:50)
at org.apache.nifi.flow.encryptor.command.FlowEncryptorCommand.processFlowConfiguration(FlowEncryptorCommand.java:135)
at org.apache.nifi.flow.encryptor.command.FlowEncryptorCommand.processFlowConfigurationFiles(FlowEncryptorCommand.java:119)
at org.apache.nifi.flow.encryptor.command.FlowEncryptorCommand.run(FlowEncryptorCommand.java:96)
at org.apache.nifi.flow.encryptor.command.SetSensitivePropertiesAlgorithm.main(SetSensitivePropertiesAlgorithm.java:29)
Caused by: javax.crypto.AEADBadTagException: Tag mismatch!
at java.base/com.sun.crypto.provider.GaloisCounterMode.decryptFinal(Unknown Source)
at java.base/com.sun.crypto.provider.CipherCore.finalNoPadding(Unknown Source)
at java.base/com.sun.crypto.provider.CipherCore.fillOutputBuffer(Unknown Source)
at java.base/com.sun.crypto.provider.CipherCore.doFinal(Unknown Source)
at java.base/com.sun.crypto.provider.AESCipher.engineDoFinal(Unknown Source)
at java.base/javax.crypto.Cipher.doFinal(Unknown Source)
at org.apache.nifi.encrypt.CipherPropertyEncryptor.decrypt(CipherPropertyEncryptor.java:74)
... 7 more
NiFi Properties Processed [/opt/nifi/nifi-current/conf/nifi.properties]
So i know here it's failing, but no solution yet.
Created on 01-19-2024 10:05 AM - edited 01-19-2024 10:07 AM
@Dave0x1
That is a big jump in versions from 1.13 directly to 1.24.
Use NiFi toolkit instead to change the algorithm.
https://nifi.apache.org/download/
NiFi Toolkit 1.24.0
./encrypt-config.sh -n <nifi.properties from original 1.13 NiFi> -f <flow.xml.gz from original 1.13 NiFi> -x -s <sensitive props key from NiFi> -b <bootstrap.conf from original 1.13 NiFi> -A NIFI_PBKDF2_AES_GCM_256 -g <new 1.24 flow.xml.gz filename>
Then in your NiFi 1.24 remove or rename the current flow.xml.gz and flow.json.gz files.
Place the flow.xml.gz output from above toolkit command into same location and make sure permissions and ownership are correct.
Start your NiFi 1.24. Since the flow.json.gz does not exist, NiFi will load the flow.xml.gz and upon successful startup generate the new flow.json.gz file it will load from that point forward each time NiFi is restarted.
Hope this works for you.
If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.
Thank you,
Mat
Created 01-21-2024 11:28 PM
Thank you very much Mat for your advice. I'll try it out today and get back to you with the results. Sounds promising 🤓
Created on 01-22-2024 04:19 AM - edited 01-22-2024 04:21 AM
Hi Mat, it works! Awesome, nifi 1.24 starts up with the flow we had from 1.13 👏 Thank you very much for the advice. We are again one step further towards finalizing our migration plan.
Only thing left is is now we get the following error from the flow with regards to the nifi-registry.
I'll open een separate thread for this
Created 01-22-2024 06:12 AM
Above registry issue also solve, with the help of this thread 🤓
https://community.cloudera.com/t5/Support-Questions/NIfi-and-Nifi-Registry-Integration/m-p/286469
Created 01-22-2024 08:42 PM
@Dave0x1, I'm happy to see that you resolved your issue. Can you kindly mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future?
Regards,
Vidya Sargur,