hermannpencole / nifi-config

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

Can't undeploy template #24

Closed britishbadger closed 6 years ago

britishbadger commented 7 years ago

I'm using nifi 1.2.0 and nifi-deploy-config-1.1.13.jar and have a script wrapping my undeploy and deploy steps, but get the following error when trying to undeploy

I should also say that the template contains a remote process group too.

2017-10-30 12:35:26 | INFO  | [main] c.g.h.n.c.Main:124 - Communicate with nifi 1.2.0
Exception in thread "main" java.util.NoSuchElementException: No value present
        at java.util.Optional.get(Optional.java:135)
        at com.github.hermannpencole.nifi.config.service.ProcessGroupService.lambda$reorder$3(ProcessGroupService.java:217)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1553)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
        at com.github.hermannpencole.nifi.config.service.ProcessGroupService.reorder(ProcessGroupService.java:217)
        at com.github.hermannpencole.nifi.config.service.ProcessGroupService.stop(ProcessGroupService.java:152)
        at com.github.hermannpencole.nifi.config.service.TemplateService.undeploy(TemplateService.java:91)
        at com.github.hermannpencole.nifi.config.Main.main(Main.java:142)

Using 1.1.12 I get the following

2017-10-30 12:55:12 | ERROR | [main] c.g.h.n.c.Main:147 - Conflict
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.TemplateService.undeploy(TemplateService.java:97)
        at com.github.hermannpencole.nifi.config.Main.main(Main.java:142)
Exception in thread "main" com.github.hermannpencole.nifi.config.model.ConfigException: Conflict: Source of Connection (dfae97f9-82a8-36b1-c4bd-0329c89c5e47) is running
        at com.github.hermannpencole.nifi.config.Main.main(Main.java:148)
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.TemplateService.undeploy(TemplateService.java:97)
        at com.github.hermannpencole.nifi.config.Main.main(Main.java:142)

Anyone able to help ?

britishbadger commented 7 years ago

I've submitted a pull request for the Exception in thread "main" java.util.NoSuchElementException: No value present but now I get the same error as with 1.1.12. ApiException: Conflict

25 - Pull Request

hermannpencole commented 6 years ago

Yes there is problems with remote process that are not yet supported by nifi config

hermannpencole commented 6 years ago

Correct in 1.1.15