Skip to content

Support nested Processing Groups #12

Description

@hijakk

Hello, I took a look at the nifi-api-deploy utility as recommended to scarpacci on Stack Overflow, and it definitely seems to be on the right track.
We have fairly complex flows, and the code as written didn't seem to play nicely with undeploying processors/connections at the root level processor group, or the controllers.

Controller undeployment fails with:

Undeploying Controller Service: Test - DBCPConnectionPool
[ERROR] HTTP call failed. Status code: HTTP/1.1 409 Conflict: This NiFi instance has been updated by 'anonymous'. Please refresh to synchronize the view.
Caught: java.lang.AssertionError: Terminated script execution. Expression: null
java.lang.AssertionError: Terminated script execution. Expression: null
    at NiFiDeploy$_run_closure2.doCall(NiFiDeploy.groovy:526)
    at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:503)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1142)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1076)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
    at groovyx.net.http.RESTClient.put(RESTClient.java:163)
    at groovyx.net.http.RESTClient$put$0.call(Unknown Source)
    at NiFiDeploy._changeControllerServiceState(NiFiDeploy.groovy:510)
    at NiFiDeploy.stopControllerService(NiFiDeploy.groovy:470)
    at NiFiDeploy$_handleUndeploy_closure5.doCall(NiFiDeploy.groovy:78)
    at NiFiDeploy.handleUndeploy(NiFiDeploy.groovy:74)
    at NiFiDeploy.run(NiFiDeploy.groovy:539)

Undeployment of root connected processor groups fails with (manually deleting the controller service, else the above error is encountered and the process halts):

Loading Process Groups from NiFi
Undeploying Controller Service: Test - DBCPConnectionPool
Undeploying Process Group: root
[WARN] No such process group found in NiFi
Undeploying Process Group: Group 1
[ERROR] HTTP call failed. Status code: HTTP/1.1 409 Conflict: Cannot delete Process Group because Input Port LocalPort[name=Input,id=abc123] has at least one incoming connection from a component outside of the Process Group. Delete this connection first.
Caught: java.lang.AssertionError: Terminated script execution. Expression: null
java.lang.AssertionError: Terminated script execution. Expression: null
    at NiFiDeploy$_run_closure2.doCall(NiFiDeploy.groovy:526)
    at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:503)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1142)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1076)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
    at groovyx.net.http.RESTClient.delete(RESTClient.java:219)
    at groovyx.net.http.RESTClient$delete$1.call(Unknown Source)
    at NiFiDeploy$_handleUndeploy_closure6.doCall(NiFiDeploy.groovy:106)
    at NiFiDeploy.handleUndeploy(NiFiDeploy.groovy:91)
    at NiFiDeploy.run(NiFiDeploy.groovy:539)

Manually deleting and redeploying seemed to work alright.
It also seems to auto start processor groups, even if all contained processors are marked as halted. This appears to be a result of line 352.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions