nipyapi icon indicating copy to clipboard operation
nipyapi copied to clipboard

Not able to bring down controller service using schedule_controller API

Open saggarsunil opened this issue 4 years ago • 2 comments

Nipyapi version: 0.13.2 NiFi version: 1.9.2 NiFi-Registry version: 0.4.0 Python version: 3.7 Operating System: Rhel 7

Description

We are trying to update sensitive properties of a controller. In order to do that, we have stop the controller. The controller is referenced by number of other service/controllers/processors

What I Did

nipyapi.canvas.schedule_controller(controller, scheduled=False, refresh=True)                         
nipyapi.canvas.update_controller(controller=nipyapi.canvas.get_controller(controller.id,              
                                             identifier_type='id', bool_response=False),               
                                      update=nipyapi.nifi.ControllerServiceDTO(properties=props))     

We get the following error when the code runs.

ERROR:main:Error: Exception while disabling/updating the controller. It many need manual intervention 
ERROR:main:(409)
Reason: Conflict
HTTP response headers: HTTPHeaderDict({'Strict-Transport-Security': 'max-age=31540000', 'Content-Length': '239', 'Content-Security-Policy': "frame-ancestors 'self'", 'Vary': 'Accept-Encoding', 'Server': 'Jetty(9.4.11.v20180605)', 'X-XSS-Protection': '1; mode=block', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Type': 'text/plain', 'Date': 'Tue, 03 Sep 2019 03:16:50 GMT'})
HTTP response body: bb2baaa2-7dc5-3bb3-22d8-6102604a7888 cannot be disabled because it is referenced by 3 components that are currently running: [4b4202c8-6ceb-37be-28d4-98181b6b8330, d32e4d43-9d50-31d2-a7d6-0f5ed226d3fd, 8a18a1f2-cc63-3e2c-3986-6438059ab1fb]

Is there a force option to disable the controller ?

Urgency

It is blocking CI CD process for Nifi.

saggarsunil avatar Sep 03 '19 03:09 saggarsunil

Hi, The schedule_controller call does not cascade to stop dependent services. This would be a useful feature but nobody has yet contributed it. You will need to inspect the controller to determine dependent services, stop them first, then stop the controller, then update, then start them all again. Writing wrapper functions for this would be very helpful

Chaffelson avatar Sep 05 '19 03:09 Chaffelson

If you had a nifi template that could be imported that had a similar setup to reproduce the issue it would help too

ottobackwards avatar Nov 28 '20 07:11 ottobackwards