NiFi prevents the deletion of NARs that are currently being used by active components (processors, controller services, etc.).
Deletion Protection
If you attempt to delete a NAR in use without forcing it, nipyapi.extensions.delete_nar will raise a ValueError with a message indicating components are instantiated from this NAR.
Force Deletion and Orphaned Components
If you use force=True to delete a NAR while components are using it, those components become orphaned. Their state will change to STOPPED or INVALID with a "Missing Processor" error.
Recovering Orphaned Components
To recover components orphaned by a force-deletion, re-upload the exact same NAR version. The components will automatically recover, and their properties and configurations will be preserved.
| Action | Result | Component State |
|---|
| Delete NAR (no force) | Blocked | Unchanged |
| Delete NAR (force=True) | NAR removed | STOPPED, INVALID with "Missing Processor" error |
| Re-upload same NAR | NAR installed | Recovers to VALID, properties preserved |
import nipyapi
# Attempting to delete a NAR in use
try:
nipyapi.extensions.delete_nar(nar_id)
except ValueError as e:
# "Unable to delete NAR [...] because components are instantiated from this NAR"
print(f"NAR protected: {e}")
# Recovering orphaned components by re-uploading
nar = nipyapi.extensions.upload_nar("/path/to/my-processor.nar")
# Wait for processor to recover
proc = nipyapi.extensions.wait_for_processor_init(processor_id)
print(f"Recovered: {proc.component.validation_status}")