Skip to content

Undeploy fails when there is an external connection to the process group #37

@ennui93

Description

@ennui93

It is not possible to run nifi-config in its undeploy mode when the process group in which a template is being removed is connected to other process groups. Tested on release nifi-deploy-config-1.1.30 & 17411a8. There are two cases:

Incoming connection

2018-01-09 09:41:08 | INFO  | [pool-29-thread-1] c.g.h.n.c.s.ProcessGroupService:303 - Cannot delete Process Group because Input Port 3d3a458f-7365-1c62-aa8f-864fe0bf3085 has at least one incoming connection from a component outside of the Process Group. Delete this connection first.
Exception in thread "main" com.github.hermannpencole.nifi.config.model.ConfigException: com.github.hermannpencole.nifi.swagger.ApiException: Conflict
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.runTimeout(FunctionUtils.java:40)
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.runWhile(FunctionUtils.java:65)
	at com.github.hermannpencole.nifi.config.service.ProcessGroupService.delete(ProcessGroupService.java:296)
	at com.github.hermannpencole.nifi.config.service.TemplateService.undeploy(TemplateService.java:125)
	at com.github.hermannpencole.nifi.config.Main.main(Main.java:149)
Caused by: com.github.hermannpencole.nifi.swagger.ApiException: Conflict
	at com.github.hermannpencole.nifi.swagger.ApiClient.handleResponse(ApiClient.java:1104)
	at com.github.hermannpencole.nifi.swagger.ApiClient.execute(ApiClient.java:1027)
	at com.github.hermannpencole.nifi.swagger.client.ProcessGroupsApi.removeProcessGroupWithHttpInfo(ProcessGroupsApi.java:2882)
	at com.github.hermannpencole.nifi.swagger.client.ProcessGroupsApi.removeProcessGroup(ProcessGroupsApi.java:2866)
	at com.github.hermannpencole.nifi.config.service.ProcessGroupService.lambda$delete$11(ProcessGroupService.java:301)
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.runWhile(FunctionUtils.java:54)
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.lambda$runWhile$0(FunctionUtils.java:65)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Outgoing connection

2018-01-09 09:36:16 | INFO  | [pool-12-thread-1] c.g.h.n.c.s.ProcessGroupService:303 - Cannot delete Process Group because Output Port 3ed34099-3a0d-1d93-06ad-0a8d19f7f805 has at least one outgoing connection to a component outside of the Process Group. Delete this connection first.
Exception in thread "main" com.github.hermannpencole.nifi.config.model.ConfigException: com.github.hermannpencole.nifi.swagger.ApiException: Conflict
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.runTimeout(FunctionUtils.java:40)
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.runWhile(FunctionUtils.java:65)
	at com.github.hermannpencole.nifi.config.service.ProcessGroupService.delete(ProcessGroupService.java:296)
	at com.github.hermannpencole.nifi.config.service.TemplateService.undeploy(TemplateService.java:125)
	at com.github.hermannpencole.nifi.config.Main.main(Main.java:149)
Caused by: com.github.hermannpencole.nifi.swagger.ApiException: Conflict
	at com.github.hermannpencole.nifi.swagger.ApiClient.handleResponse(ApiClient.java:1104)
	at com.github.hermannpencole.nifi.swagger.ApiClient.execute(ApiClient.java:1027)
	at com.github.hermannpencole.nifi.swagger.client.ProcessGroupsApi.removeProcessGroupWithHttpInfo(ProcessGroupsApi.java:2882)
	at com.github.hermannpencole.nifi.swagger.client.ProcessGroupsApi.removeProcessGroup(ProcessGroupsApi.java:2866)
	at com.github.hermannpencole.nifi.config.service.ProcessGroupService.lambda$delete$11(ProcessGroupService.java:301)
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.runWhile(FunctionUtils.java:54)
	at com.github.hermannpencole.nifi.config.utils.FunctionUtils.lambda$runWhile$0(FunctionUtils.java:65)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions