- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Not able to delete the NiFi existing flow using nifi-api
- Labels:
-
Apache NiFi
Created on 03-11-2025 09:50 PM - edited 03-11-2025 09:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am trying to delete my nifi existing process group through nifi-api curl but unfortunately it gives me error that "The revision must be specified" but everything specified as per the documentation but still not working, below is the curl command what I used for delete the process group(flow) to my target system and also I can able to delete the same through UI but not works with rest api.
curl -k -X DELETE "https://localhost:28443/nifi-api/process-groups/836e216e-0195-1000-d3b8-771b257f1fe6" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Token" \
--data '{
"revision": {
"version": 0
},
"disconnectedNodeAcknowledged": false
}'
ERROR: 400 - The revision must be specified.
Also find the below is the output of the process_groups:
{'permissions': {'canRead': True, 'canWrite': True}, 'processGroupFlow': {'id': '187acb23-0195-1000-1908-1543c761f376', 'uri': 'https://localhost:28443/nifi-api/flow/process-groups/187acb23-0195-1000-1908-1543c761f376', 'parameterContext': {'id': 'f24131aa-0fad-3876-f76a-591e810f66da', 'permissions': {'canRead': True, 'canWrite': True}, 'component': {'id': 'f24131aa-0fad-3876-f76a-591e810f66da', 'name': 'NiFi_Engine_Parameters'}}, 'breadcrumb': {'id': '187acb23-0195-1000-1908-1543c761f376', 'permissions': {'canRead': True, 'canWrite': True}, 'breadcrumb': {'id': '187acb23-0195-1000-1908-1543c761f376', 'name': 'NiFi Flow'}}, 'flow': {'processGroups': [{'revision': {'version': 0}, 'id': '836e216e-0195-1000-d3b8-771b257f1fe6', 'uri': 'https://localhost:28443/nifi-api/process-groups/836e216e-0195-1000-d3b8-771b257f1fe6', 'position': {'x': 392.0, 'y': 240.0}, 'permissions': {'canRead': True, 'canWrite': True}, 'bulletins': [], 'component': {'id': '836e216e-0195-1000-d3b8-771b257f1fe6', 'versionedComponentId': '3bcf353e-04bc-39e1-85fd-879f7318bb8a', 'parentGroupId': '187acb23-0195-1000-1908-1543c761f376', 'position': {'x': 392.0, 'y': 240.0}, 'name': 'NIFI_HL7_INTEGRATION_ENGINE_PG_ES_100325_latest', 'comments': '', 'parameterContext': {'id': 'f24131aa-0fad-3876-f76a-591e810f66da', 'permissions': {'canRead': True, 'canWrite': True}, 'component': {'id': 'f24131aa-0fad-3876-f76a-591e810f66da', 'name': 'NiFi_Engine_Parameters'}}, 'flowfileConcurrency': 'UNBOUNDED', 'flowfileOutboundPolicy': 'STREAM_WHEN_AVAILABLE', 'defaultFlowFileExpiration': '0 sec', 'defaultBackPressureObjectThreshold': 10000, 'defaultBackPressureDataSizeThreshold': '1 GB', 'executionEngine': 'INHERITED', 'maxConcurrentTasks': 1, 'statelessFlowTimeout': '1 min', 'runningCount': 0, 'stoppedCount': 542, 'invalidCount': 6, 'disabledCount': 0, 'activeRemotePortCount': 0, 'inactiveRemotePortCount': 0, 'upToDateCount': 0, 'locallyModifiedCount': 0, 'staleCount': 0, 'locallyModifiedAndStaleCount': 0, 'syncFailureCount': 0, 'localInputPortCount': 0, 'localOutputPortCount': 0, 'publicInputPortCount': 0, 'publicOutputPortCount': 0, 'statelessGroupScheduledState': 'STOPPED', 'inputPortCount': 0, 'outputPortCount': 0}, 'status': {'id': '836e216e-0195-1000-d3b8-771b257f1fe6', 'name': 'NIFI_HL7_INTEGRATION_ENGINE_PG_ES_100325_latest', 'statsLastRefreshed': '10:16:27 IST', 'aggregateSnapshot': {'id': '836e216e-0195-1000-d3b8-771b257f1fe6', 'name': 'NIFI_HL7_INTEGRATION_ENGINE_PG_ES_100325_latest', 'statelessActiveThreadCount': 0, 'flowFilesIn': 0, 'bytesIn': 0, 'input': '0 (0 bytes)', 'flowFilesQueued': 0, 'bytesQueued': 0, 'queued': '0 (0 bytes)', 'queuedCount': '0', 'queuedSize': '0 bytes', 'bytesRead': 0, 'read': '0 bytes', 'bytesWritten': 0, 'written': '0 bytes', 'flowFilesOut': 0, 'bytesOut': 0, 'output': '0 (0 bytes)', 'flowFilesTransferred': 0, 'bytesTransferred': 0, 'transferred': '0 (0 bytes)', 'bytesReceived': 0, 'flowFilesReceived': 0, 'received': '0 (0 bytes)', 'bytesSent': 0, 'flowFilesSent': 0, 'sent': '0 (0 bytes)', 'activeThreadCount': 0, 'terminatedThreadCount': 0, 'processingNanos': 0}}, 'runningCount': 0, 'stoppedCount': 542, 'invalidCount': 6, 'disabledCount': 0, 'activeRemotePortCount': 0, 'inactiveRemotePortCount': 0, 'upToDateCount': 0, 'locallyModifiedCount': 0, 'staleCount': 0, 'locallyModifiedAndStaleCount': 0, 'syncFailureCount': 0, 'localInputPortCount': 0, 'localOutputPortCount': 0, 'publicInputPortCount': 0, 'publicOutputPortCount': 0, 'parameterContext': {'id': 'f24131aa-0fad-3876-f76a-591e810f66da', 'permissions': {'canRead': True, 'canWrite': True}, 'component': {'id': 'f24131aa-0fad-3876-f76a-591e810f66da', 'name': 'NiFi_Engine_Parameters'}}, 'inputPortCount': 0, 'outputPortCount': 0}], 'remoteProcessGroups': [], 'processors': [], 'inputPorts': [], 'outputPorts': [], 'connections': [], 'labels': [], 'funnels': []}, 'lastRefreshed': '10:16:27 IST'}}
Awaiting for your response.
Thanks
Vijay Amirtharaj
Created 03-17-2025 10:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@AllIsWell
Somehow I feel you have some stale data. Before deleting the process group, fetch its current state using the API to confirm the correct version number
-H "Authorization: Bearer Token"
Look for the revision object in the response. The version field should match what you include in your DELETE request.
Update the DELETE Request
If the version in the response is not 0, update your DELETE request with the correct version. For example, if the current version is 5, your request should look like this:
-H "Content-Type: application/json" \
-H "Authorization: Bearer Token" \
--data '{
"revision": {
"version": <Value from above>
},
"disconnectedNodeAcknowledged": false
}'
Validate the JSON:
Ensure that the JSON payload is valid. You can use tools like JSONLint to validate the structure.
Check for Trailing Slashes:
Ensure there are no trailing slashes in the URL. For example, use https://localhost:28443/nifi-api/process-groups/836e216e-0195-1000-d3b8-771b257f1fe6 instead of https://localhost:28443/nifi-api/process-groups/836e216e-0195-1000-d3b8-771b257f1fe6/.
Disconnected Node Acknowledgment:
If your NiFi cluster has disconnected nodes, you may need to set disconnectedNodeAcknowledged to true
Final Notes:
If the issue persists, double-check the API documentation for any changes or additional requirements.
Ensure that the Authorization token is valid and has the necessary permissions to delete the process group.
If you are using a NiFi version older than 1.12.0, the API behavior might differ slightly, so consult the documentation for your specific version.
Happy hadooping
