[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2021-10-27 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17435006#comment-17435006
 ] 

ASF subversion and git services commented on NIFI-7012:
---

Commit 104078868ed2e90eca805b9bddc6e7f02c29851c in nifi's branch 
refs/heads/main from Matt Burgess
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=1040788 ]

NIFI-7012: Refactored OnConfigurationRestored to support sensitive property 
validation (#5415)



> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0, 1.14.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Assignee: Matt Burgess
>Priority: Major
>  Labels: parameters, scripting, security
> Fix For: 1.15.0
>
> Attachments: groovy_sample.txt
>
>  Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2021-08-10 Thread Eduardo Mota Fontes (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17396759#comment-17396759
 ] 

Eduardo Mota Fontes commented on NIFI-7012:
---

This happened to me in two ways in NiFi 1.14: when I restarted a node and when 
I import a flow from registry. I think this issue is related to the order the 
processor is constructed. To work fine NiFi need to create the processor, 
validade the script and then populate properties. It is not validating the 
script so NiFi don't know a property is sensitive and create a conflict with 
Parameter Context sensitive parameter. [~alopresto] [~markap14]

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0, 1.14.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Assignee: Andy LoPresto
>Priority: Major
>  Labels: parameters, scripting, security
> Attachments: groovy_sample.txt
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2021-06-11 Thread Jul Tomten (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17361695#comment-17361695
 ] 

Jul Tomten commented on NIFI-7012:
--

I have the same issue,

https://issues.apache.org/jira/browse/NIFI-8684

sorry for creating a duplicate

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Assignee: Andy LoPresto
>Priority: Major
>  Labels: parameters, scripting, security
> Attachments: groovy_sample.txt
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2020-10-19 Thread Thanh Phuc Vo (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17216864#comment-17216864
 ] 

Thanh Phuc Vo commented on NIFI-7012:
-

Dear [~alopresto] and [~markap14] could you please share the new pull request 
for fixing this issue? As I check in the release 1.12.1, the issue have not 
been fixed yet

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Assignee: Andy LoPresto
>Priority: Major
>  Labels: parameters, scripting, security
> Attachments: groovy_sample.txt
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2020-01-29 Thread Andy LoPresto (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17026103#comment-17026103
 ] 

Andy LoPresto commented on NIFI-7012:
-

[~markap14] feels there is a better approach for this so he is going to provide 
a separate PR which avoids introducing the {{ScriptableComponent}} marker 
interface and treating some processors differently. 

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Assignee: Andy LoPresto
>Priority: Major
>  Labels: parameters, scripting, security
> Attachments: groovy_sample.txt
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2020-01-28 Thread Dariusz Chmielewski (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17024992#comment-17024992
 ] 

Dariusz Chmielewski commented on NIFI-7012:
---

Thank you [~alopresto]! This patch does address the NiFi startup issue, but 
while I was testing this I did notice one side issue. If you try to change 
sensitive parameter value while InvokeScriptedProcessor using it is currently 
running you will get below exception and parameter value does not change. You 
have to manually stop the processor first to successfully change the sensitive 
parameter value.
{code:java}
2020-01-28 09:12:26,686 INFO [Parameter Context Update Thread-1] 
o.a.n.web.api.ParameterContextResource Disabling 0 Controller Services in order 
to update Parameter Context2020-01-28 09:12:26,686 INFO [Parameter Context 
Update Thread-1] o.a.n.web.api.ParameterContextResource Disabling 0 Controller 
Services in order to update Parameter Context2020-01-28 09:12:26,687 INFO 
[Parameter Context Update Thread-1] o.a.n.web.api.ParameterContextResource 
Updating Parameter Context with ID 
900a6ced-016f-1000-13a0-956c5fa9adec2020-01-28 09:12:26,687 INFO [Parameter 
Context Update Thread-1] o.a.n.web.api.ParameterContextResource Re-Enabling 0 
Controller Services after having updated Parameter Context2020-01-28 
09:12:26,687 INFO [Parameter Context Update Thread-1] 
o.a.n.web.api.ParameterContextResource Restarting 1 Processors after having 
updated Parameter Context2020-01-28 09:12:26,914 INFO [Flow Service Tasks 
Thread-2] o.a.nifi.controller.StandardFlowService Saved flow controller 
org.apache.nifi.controller.FlowController@327a1949 // Another save pending = 
false2020-01-28 09:12:27,349 INFO [Parameter Context Update Thread-1] 
o.a.n.c.s.StandardProcessScheduler Starting 
InvokeScriptedProcessor[id=90151674-016f-1000-9378-1054622ee2a1]2020-01-28 
09:12:27,349 INFO [Parameter Context Update Thread-1] 
o.a.n.controller.StandardProcessorNode Starting 
InvokeScriptedProcessor[id=90151674-016f-1000-9378-1054622ee2a1]2020-01-28 
09:12:27,562 INFO [Timer-Driven Process Thread-4] 
o.a.n.c.s.TimerDrivenSchedulingAgent Scheduled 
InvokeScriptedProcessor[id=90151674-016f-1000-9378-1054622ee2a1] to run with 1 
threads2020-01-28 09:12:27,765 INFO [Flow Service Tasks Thread-2] 
o.a.nifi.controller.StandardFlowService Saved flow controller 
org.apache.nifi.controller.FlowController@327a1949 // Another save pending = 
false2020-01-28 09:12:28,058 ERROR [Parameter Context Update Thread-1] 
o.a.n.web.api.ParameterContextResource Failed to update Parameter 
Contextjava.lang.IllegalStateException: Cannot update Parameter Context Test 
because the update would add a Sensitive Parameter named 'test_pass' but this 
Parameter already is referenced by a Non-Sensitive Property. at 
org.apache.nifi.web.dao.impl.StandardParameterContextDAO.verifyParameterUpdate(StandardParameterContextDAO.java:189)
 at 
org.apache.nifi.web.dao.impl.StandardParameterContextDAO.verifyUpdate(StandardParameterContextDAO.java:153)
 at 
org.apache.nifi.web.dao.impl.StandardParameterContextDAO$$FastClassBySpringCGLIB$$7099e091.invoke()
 at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
 at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
 at 
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
 at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
 at 
org.apache.nifi.web.dao.impl.StandardParameterContextDAO$$EnhancerBySpringCGLIB$$90f1d6e7.verifyUpdate()
 at 
org.apache.nifi.web.StandardNiFiServiceFacade.verifyUpdateParameterContext(StandardNiFiServiceFacade.java:1004)
 at 
org.apache.nifi.web.StandardNiFiServiceFacade$$FastClassBySpringCGLIB$$358780e0.invoke()
 at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
 at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
 at 
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:84)
 at 
org.apache.nifi.web.NiFiServiceFacadeLock.proceedWithReadLock(NiFiServiceFacadeLock.java:161)
 at 
org.apache.nifi.web.NiFiServiceFacadeLock.verifyLock(NiFiServiceFacadeLock.java:138)
 at sun.reflect.GeneratedMethodAccessor335.invoke(Unknown Source) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2020-01-26 Thread Andy LoPresto (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17024040#comment-17024040
 ] 

Andy LoPresto commented on NIFI-7012:
-

[~DCTech] I have pushed a PR which I think addresses this scenario. Please 
verify that it solves your issue. 

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Assignee: Andy LoPresto
>Priority: Major
>  Labels: parameters, scripting, security
> Attachments: groovy_sample.txt
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2020-01-20 Thread Dariusz Chmielewski (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17019888#comment-17019888
 ] 

Dariusz Chmielewski commented on NIFI-7012:
---

Thank you. Let me know if I can help with anything.

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Assignee: Andy LoPresto
>Priority: Major
> Attachments: groovy_sample.txt
>
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2020-01-20 Thread Andy LoPresto (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17019790#comment-17019790
 ] 

Andy LoPresto commented on NIFI-7012:
-

I was able to reproduce the issue. Will try to resolve it. 

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Priority: Major
> Attachments: groovy_sample.txt
>
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> 

[jira] [Commented] (NIFI-7012) Using sensitive parameter in sensitive property of InvokeScriptedProcessor causes Jetty shutdown on NiFi restart

2020-01-20 Thread Dariusz Chmielewski (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-7012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17019682#comment-17019682
 ] 

Dariusz Chmielewski commented on NIFI-7012:
---

Can anyone confirm if it's reproducible? For some reason the code in 
AbstractComponentNode.verifyCanUpdateProperties() does not detect this as a 
sensitive parameter at Jetty startup but it is a sensitive parameter as it 
works just fine at runtime.

> Using sensitive parameter in sensitive property of InvokeScriptedProcessor 
> causes Jetty shutdown on NiFi restart
> 
>
> Key: NIFI-7012
> URL: https://issues.apache.org/jira/browse/NIFI-7012
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.10.0
> Environment: OpenJDK 1.8.0_232 on Ubuntu 18.04.3 LTS
>Reporter: Dariusz Chmielewski
>Priority: Major
> Attachments: groovy_sample.txt
>
>
> To simulate this add a new InvokeScriptedProcessor to your flow with attached 
> example basic Groovy script as the Script Body. This will create a "Password" 
> sensitive property on the processor, then using UI enter sensitive parameter 
> (ex: "#\{test_pass}") in the value of this property. At this point everything 
> will work fine, no errors in UI or nifi-app.log during this processor 
> execution, but when you restart NiFi you will notice the below warning in 
> nifi-app.log. To get around this issue and have Jetty start again I had to 
> manually edit flow.xml and set the parameter ("test_pass") sensitive value to 
> false. Note that both the processor property and parameter appear as 
> sensitive in UI (before making changes to flow.xml) and their values are 
> encrypted in flow.xml.
> {code:java}
> 2020-01-10 15:37:28,492 INFO [main] org.eclipse.jetty.server.Server Started 
> @29687ms
>  2020-01-10 15:37:28,493 WARN [main] org.apache.nifi.web.server.JettyServer 
> Failed to start web server... shutting down.
>  org.apache.nifi.controller.serialization.FlowSynchronizationException: 
> java.lang.IllegalArgumentException: The property 'Password' cannot reference 
> Parameter 'test_pass' because Sensitive Parameters may only be referenced by 
> Sensitive Properties.
>  at 
> org.apache.nifi.controller.StandardFlowSynchronizer.sync(StandardFlowSynchronizer.java:510)
>  at 
> org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1368)
>  at 
> org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.load(StandardXMLFlowConfigurationDAO.java:88)
>  at 
> org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:812)
>  at 
> org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:557)
>  at 
> org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>  at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>  at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
>  at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>  at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>  at 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:406)
>  at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>  at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
>  at 
>