Question
Unable to start MiNiFi because of an error caused due to the number of threads
What am I doing:
I am new to minifi and I want to get a bit workout on how to use minifi and generate a dataflow and send it to Apache NiFi.
After going through the web I understood that first we need to design the flow using the NiFi and download its JSON definition as json.gz format and place it in the conf folder of minifi. Then start the minifi using run-minifi.bat file.
- These are things I have done to build the dataflow for MiNiFi:
- First I have created a pipeline to read from a table present in my Postgres SQL database using a ExecuteSQL processor, Remote Process Group, Input Port and logAttribute Processor.

Input port connected to a LogAttribute to receive the data from the Remote Process Group
- Second, I have downloaded the ExecuteSQL, Remote Process Group and LogAttribute pipeline as a JSON file and compressed it as flow.json.gz and placed it in the conf folder and started the minifi instance.
- First I have created a pipeline to read from a table present in my Postgres SQL database using a ExecuteSQL processor, Remote Process Group, Input Port and logAttribute Processor.
The Error I am Facing:
java.lang.Exception: Unable to load flow due to: org.apache.nifi.controller.serialization.FlowSynchronizationException: java.lang.IllegalArgumentException: Cannot set max number of threads to less than 1
at org.apache.nifi.headless.HeadlessNiFiServer.start(HeadlessNiFiServer.java:194)
at org.apache.nifi.minifi.StandardMiNiFiServer.start(StandardMiNiFiServer.java:62)
at org.apache.nifi.minifi.MiNiFi.<init>(MiNiFi.java:141)
at org.apache.nifi.minifi.MiNiFi.<init>(MiNiFi.java:62)
at org.apache.nifi.minifi.MiNiFi.main(MiNiFi.java:226)
Caused by: org.apache.nifi.controller.serialization.FlowSynchronizationException: java.lang.IllegalArgumentException: Cannot set max number of threads to less than 1
at org.apache.nifi.controller.serialization.VersionedFlowSynchronizer.synchronizeFlow(VersionedFlowSynchronizer.java:477)
at org.apache.nifi.controller.serialization.VersionedFlowSynchronizer.sync(VersionedFlowSynchronizer.java:224)
at org.apache.nifi.controller.FlowController.synchronize(FlowController.java:1729)
at org.apache.nifi.persistence.StandardFlowConfigurationDAO.load(StandardFlowConfigurationDAO.java:91)
at org.apache.nifi.controller.StandardFlowService.loadFromBytes(StandardFlowService.java:805)
at org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:526)
at org.apache.nifi.headless.HeadlessNiFiServer.start(HeadlessNiFiServer.java:170)
... 4 common frames omitted
Caused by: java.lang.IllegalArgumentException: Cannot set max number of threads to less than 1
at org.apache.nifi.controller.FlowController.setMaxThreadCount(FlowController.java:1783)
at org.apache.nifi.controller.FlowController.setMaxTimerDrivenThreadCount(FlowController.java:1766)
at org.apache.nifi.controller.serialization.VersionedFlowSynchronizer.synchronizeFlow(VersionedFlowSynchronizer.java:410)
... 10 common frames omitted
What did I try to resolve the Error:
- I tried adding this property in my minifi.properties but the file is getting reset to the previous properties making this to get erased on every start of minifi instance nifi.flow.engine.threads= 5 .
- I tried adding this in my bootstrap.conf file but the error still persists. nifi.minifi.flow.max.concurrent.threads=1.
I'm hoping someone who has encountered this error before or has an idea about how to resolve it can help me please. Thank you in advance.

