hermannpencole / nifi-config

Automatically deploy and configure Template on Nifi
Apache License 2.0
55 stars 39 forks source link

Disabling referencing controller services misses referencing component revisions #34

Closed ennui93 closed 6 years ago

ennui93 commented 6 years ago

As of 228ab76a44758903fc26f05cd5e1d4368bd4530c, when attempting to configure a controller service on which other controller services depend, stopping the dependent controller services fails. This looks to be because the referencing component revisions of the dependent controller services are not included in the request to NiFi.

PUT /nifi-api/controller-services/525fb1ed-015d-1000-c1f1-ef810e0c3bb8/references HTTP/1.1
Accept: application/json
User-Agent: Swagger-Codegen/1.1.0/java
Content-Type: application/json; charset=utf-8
Content-Length: 99
Host: localhost:8079
Connection: Keep-Alive
Accept-Encoding: gzip

{"id":"525fb1ed-015d-1000-c1f1-ef810e0c3bb8","state":"DISABLED","referencingComponentRevisions":{}}

HTTP/1.1 500 Internal Server Error
Date: Mon, 18 Dec 2017 08:22:22 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Server: Jetty(9.3.9.v20160517)

4F
An unexpected error has occurred. Please check the logs for additional details.
0
ennui93 commented 6 years ago

See 70a0ee722564fd7b825e602086defe1d12f3610e for the beginnings of a fix. However, it breaks ControllerServicesServiceTest.setStateReferencingControllerServicesTest and requires further testing before ready for PR.

hermannpencole commented 6 years ago

Thank you very much, with your code I better understood how the ControllerServiceReferencingComponentEntity works. I was inspired by your code to make a correction.

ennui93 commented 6 years ago

33f3effd387312c1ef689302108b481746823a8d looks to have corrected the issue highlighted above. Thanks!

hermannpencole commented 6 years ago

No, they was a null pointer. I correct and repoen this issue in 1.1.25