Support Questions

Find answers, ask questions, and share your expertise

Failed to register flow with Flow Registry due to Error creating snapshot: An unexpected error has occurred.

avatar
Rising Star

Hi,

 

My issue related to committing workflow changes onto my Github repository. I have made changes in the providers.xml file and now my Nifi flows are linked to Github flowPersistenceProvider.
However, when I try to commit changes to the same linked repo, it gives me below error:

 

Kiranq_0-1686820950143.png

 

and in the log files, it says: "Flow version is not added yet, can not be serialized.. Returning Conflict response."

I also witnessed on "show local changes" that the prompt gives an error "version must be greater than 1". Are these linked?
Any guideline would help. Thanks. 

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Kiranq 

This is what I believe you executed from yoru description:
You were originally using the the FileSystemFlowPersistenceProvider and has already version controlled one or more NiFi Process Groups (PG) to your NiFi-Registry?
Then you change your configuration to use the GitFlowPersistenceProvider?

This is what I believe you did not do:
Prior to switching flow persistence providers, did you stop version control on all your PGs?

Switching from other Flow Persistence Provider

In order to switch the Flow Persistence Provider, it is necessary to reset NiFi Registry. For example, to switch from FileSystemFlowPersistenceProvider to GitFlowPersistenceProvider, follow these steps:

  1. Stop version control on all ProcessGroups in NiFi

  2. Stop NiFi Registry

  3. Move the H2 DB (specified as nifi.registry.db.directory in nifi-registry.properties) and Flow Storage Directory for FileSystemFlowPersistenceProvider directories somewhere for back up

  4. Configure GitFlowPersistenceProvider provider in providers.xml

  5. Start NiFi Registry

  6. Recreate any buckets

  7. Start version control on all ProcessGroups again.

It appears as though you may not have followed the above documented steps in the NiFi-Registry admin guide (https://nifi.apache.org/docs/nifi-registry-docs/html/administration-guide.html#flow-persistence-prov...).  This leaves you with your Metadata Database with info about your version controlled PGs and that metadata references flows persisted that it can no longer find in the flow persistence provider configured.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

 

 

View solution in original post

5 REPLIES 5

avatar
Master Mentor

@Kiranq 

This is what I believe you executed from yoru description:
You were originally using the the FileSystemFlowPersistenceProvider and has already version controlled one or more NiFi Process Groups (PG) to your NiFi-Registry?
Then you change your configuration to use the GitFlowPersistenceProvider?

This is what I believe you did not do:
Prior to switching flow persistence providers, did you stop version control on all your PGs?

Switching from other Flow Persistence Provider

In order to switch the Flow Persistence Provider, it is necessary to reset NiFi Registry. For example, to switch from FileSystemFlowPersistenceProvider to GitFlowPersistenceProvider, follow these steps:

  1. Stop version control on all ProcessGroups in NiFi

  2. Stop NiFi Registry

  3. Move the H2 DB (specified as nifi.registry.db.directory in nifi-registry.properties) and Flow Storage Directory for FileSystemFlowPersistenceProvider directories somewhere for back up

  4. Configure GitFlowPersistenceProvider provider in providers.xml

  5. Start NiFi Registry

  6. Recreate any buckets

  7. Start version control on all ProcessGroups again.

It appears as though you may not have followed the above documented steps in the NiFi-Registry admin guide (https://nifi.apache.org/docs/nifi-registry-docs/html/administration-guide.html#flow-persistence-prov...).  This leaves you with your Metadata Database with info about your version controlled PGs and that metadata references flows persisted that it can no longer find in the flow persistence provider configured.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

 

 

avatar
New Contributor

Hi Matt, Is there any way to recover the registry, if we have missed to stop the version control

avatar
Master Mentor

@Abibee04 

Please start a new Community question with the details of your query.

I am not clear what you mean by "recover the registry", so the more detail you can provide the better in that new community question by sharing what step you performed and what you are looking to accomplish.

Thank you,
Matt

avatar
Rising Star

@MattWho thanks for your response.

I followed the documented way to switch between flow persistence providers but still getting an error however, a different now:

Kiranq_0-1686842418349.png

 

I am witnessing that if I commit and push changes to my Git repo using VS Code, the error I mentioned in my last message disappears, however, using UI when I try to commit changes, it is now showing me above error. 

 

In all, I am unable to commit changes to my flows when it is linked with to a Github repo. I am wondering if this functionality that I am trying is even possible?

If it helps, my nifi-registry-app logs are rotating between these two kinds of errors when I make any changes in my workflow:

 

An unexpected error has occurred: org.apache.nifi.registry.flow.FlowPersistenceException: Git directory <path to git directory on my local machine> is not clean or has uncommitted changes, resolve those changes first to save flow contents.. Returning Internal Server Error response.

 

I commit and push changes through VS Code (success) since NiFi UI throws error. Then I try to redo "commit local changes" from NiFi UI, it gives below error in my log file.

 

Flow version is not added yet, can not be serialized.. Returning Conflict response. 

 

Looking forward to any guideline.

Thanks.

avatar
Master Mentor

@Kiranq 

1. What version of NiFi and NiFi-Registry are you using?
2. How is your GitFlowPersistenceProvider configured?

Matt