Support Questions

Find answers, ask questions, and share your expertise

Changing nifi.sensitive.props.key value??

avatar
Super Collaborator

Hi,

When i initially setup NiFi instance i missed setting this property nifi.sensitive.props.key

Can i change it to have some value now..? If yes , Can i go ahead and put some value.?? Will my existing flows work or What is the best way to do it without loosing existing flows.

Regards,

Sai

5 REPLIES 5

avatar
Super Collaborator

i found it in the documentation and successfully able to update my nifi.sensitive.props.key

https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#existing-flow-migration

avatar
Contributor

My nifi services are running on windows. Do we know how to set the nifi.sensitive.props.key.value since nish.sh can't be run on windows.

Also, according to https://cwiki.apache.org/confluence/display/NIFI/Migration+Guidance, it seems nifi.sensitive.props.key should be automatically generated upon first nifi start, which didn't happen for my 1.15.3 installation on windows.

 

Instead, I got following stack trace in nifi-app.log:
2022-02-25 15:13:11,748 ERROR [main] o.a.nifi.properties.NiFiPropertiesLoader Flow Configuration [.\conf\flow.xml.gz] Found: Migration Required for blank Sensitive Properties Key [nifi.sensitive.props.key]
2022-02-25 15:13:11,748 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi
java.lang.IllegalArgumentException: There was an issue decrypting protected properties
at org.apache.nifi.NiFi.initializeProperties(NiFi.java:373)
at org.apache.nifi.NiFi.convertArgumentsToValidatedNiFiProperties(NiFi.java:341)
at org.apache.nifi.NiFi.convertArgumentsToValidatedNiFiProperties(NiFi.java:337)
at org.apache.nifi.NiFi.main(NiFi.java:329)
Caused by: org.apache.nifi.properties.SensitivePropertyProtectionException: Sensitive Properties Key [nifi.sensitive.props.key] not found: See Admin Guide section [Updating the Sensitive Properties Key]
at org.apache.nifi.properties.NiFiPropertiesLoader.getDefaultProperties(NiFiPropertiesLoader.java:231)
at org.apache.nifi.properties.NiFiPropertiesLoader.get(NiFiPropertiesLoader.java:214)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.nifi.NiFi.initializeProperties(NiFi.java:368)
... 3 common frames omitted

Does anyone have any previous experience generating the key for a nifi migration on windows server?

Ming




avatar
Super Guru

@myuintelli2021 

 

The NiFi binaries come with a run-nifi.bat in addition of nifi.sh.

 

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Contributor

Hi! Thanks for responding to my question. But it doesn't seem run-nifi.bat supports switch set-sensitive-properties-key. 

If you read run-status.bat, it has no logic to support switch "set-sensitive-properties-key".

avatar
Super Guru

@myuintelli2021 ,

 

Good point! I hadn't noticed that.

 

Alternatively, you can download the NiFi Toolkit and use the encrypt-config.bat to perform the key migration. 

 

Check this out: https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html#sensitive-property-key-migration

 

The toolkit contains a Windows version of the script (encrypt-config.bat).

 

HTH,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.