Support Questions
Find answers, ask questions, and share your expertise

Nifi showing blank Canvas How to recover jobs?

Explorer

Hi,

 

I am using nifi 1.14. My entire workflow has been crashed and suddenly Nifi is showing blank canvas. Is there any safe way to recover all the jobs?

 

Please provide step by step solution. Any help in this issue will be greatly appreciated.

Thank You!

1 ACCEPTED SOLUTION

Accepted Solutions

Master Guru

@CodeLa 

 

Everything you do via the NiFi canvas when building out your dataflows is preserved in the flow.xml.gz file written to disk.  On NiFi service start, the flow.xml.gz is loaded in to memory and and then FlowFiles from the the flowfile_repository are loaded back in to the dataflow connections they were last in prior to NiFi being stopped.  

In order for your your canvas to be blank on NiFi service startup, that flow.xml.gz is missing. 
By default NiFi creates an archived copy of the flow.xml.gz each time a change is made.
The following properties from the nifi.properties file control where the flow.xml.gz is written and if/how the archiving is setup:

MattWho_0-1633524803564.png

Recovering the flow from archive is as simple as copying the latest "<timesatmp>_flow.xml.gz" from the configured archive directory to the configured NiFi configuration file location and renaming it to "flow.xml.gz".  Make sure proper ownership and permissions are set after you copy and rename (Must be owned and accessible by the NiFi service user).


As a future suggestion:

  • Another way to protect against a total loss of your flow is running a NiFi cluster instead of a single NiFi instance.  In a NiFi cluster, every NiFi node preserves its own identical copy of the flow.xml.gz file.  So should catastrophe strike on one of the nodes, you can simply copy the flow.xml.gz from any one of the other nodes to recover the bad node.

 

If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.

Thank you,

Matt

View solution in original post

2 REPLIES 2

Master Guru

@CodeLa 

 

Everything you do via the NiFi canvas when building out your dataflows is preserved in the flow.xml.gz file written to disk.  On NiFi service start, the flow.xml.gz is loaded in to memory and and then FlowFiles from the the flowfile_repository are loaded back in to the dataflow connections they were last in prior to NiFi being stopped.  

In order for your your canvas to be blank on NiFi service startup, that flow.xml.gz is missing. 
By default NiFi creates an archived copy of the flow.xml.gz each time a change is made.
The following properties from the nifi.properties file control where the flow.xml.gz is written and if/how the archiving is setup:

MattWho_0-1633524803564.png

Recovering the flow from archive is as simple as copying the latest "<timesatmp>_flow.xml.gz" from the configured archive directory to the configured NiFi configuration file location and renaming it to "flow.xml.gz".  Make sure proper ownership and permissions are set after you copy and rename (Must be owned and accessible by the NiFi service user).


As a future suggestion:

  • Another way to protect against a total loss of your flow is running a NiFi cluster instead of a single NiFi instance.  In a NiFi cluster, every NiFi node preserves its own identical copy of the flow.xml.gz file.  So should catastrophe strike on one of the nodes, you can simply copy the flow.xml.gz from any one of the other nodes to recover the bad node.

 

If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.

Thank you,

Matt

View solution in original post

Explorer

Hi Matt,

 

Thank you for your suggestion I've recovered it by using flow.xml.gz file.