Assuming you have a dev DB & git repo and then a prod DB & git repo, each DB 
goes with the corresponding repo and has ids that are unique to the 
environment, so you can't take one of the DBs and point at the other’s git 
repo, that is why you need the export/import process with the CLI.

The reason everything looked ok on the registry side of things is because it 
doesn’t need any of the flow content at that point, so it was just showing what 
was in the DB, but then when you said to import the flow into NiFi it then used 
the info from the DB to locate the flow in the git repo, and it didn’t exist 
because the bucket id and flow id are not the same.

> On Sep 11, 2018, at 4:55 PM, David Gallagher <dgallag...@cleverdevices.com> 
> wrote:
> 
> Ok, Last question on this one (promise!). I’ve set up the dev / git 
> repository and it’s working great. I can export flows from dev using the cli 
> and import them into Prod. One thing though, following up on an earlier 
> suggestion from Mike below – I tried stopping the dev registry, copying its 
> database, and using it to overwrite the prod registry’s database. It seemed 
> to work fine – I started up the prod registry, and the buckets and flows were 
> all present. However, when I tried to import a flow from Prod into NiFi, I 
> got an error message (in a popup):
> 
> The Flow Registry with ID ca62a0a5-0165-1000-256b-521c462b06f8 reports that 
> no Flow exists with Bucket d4438d9e-4aef-43f3-866b-55c4a2089e19, Flow 
> b24d2adf-5d2f-4cfd-a160-88a4de99a6d0, Version 1
> 
> I tried using the cli tool, list buckets and flows works as expected but I 
> can’t use the export function. Do I have to do anything special to back up 
> the metadata database correctly?
> 
> Thanks,
> 
> Dave
> 
> From: Kevin Doran <kdoran.apa...@gmail.com>
> Sent: Tuesday, September 11, 2018 10:25 AM
> To: users@nifi.apache.org
> Subject: Re: Nifi Registry + Git: target registry ignores git flows
> 
> Happy to help anytime. Glad it’s working for you!
> 
> Kevin
> 
> From: David Gallagher <dgallag...@cleverdevices.com 
> <mailto:dgallag...@cleverdevices.com>>
> Reply-To: "users@nifi.apache.org <mailto:users@nifi.apache.org>" 
> <users@nifi.apache.org <mailto:users@nifi.apache.org>>
> Date: Tuesday, September 11, 2018 at 10:18
> To: "users@nifi.apache.org <mailto:users@nifi.apache.org>" 
> <users@nifi.apache.org <mailto:users@nifi.apache.org>>
> Subject: RE: Nifi Registry + Git: target registry ignores git flows
> 
> OK, I think I’ve got it now – I didn’t realize that you had to create a 
> bucket and empty flow in the ‘prd’ repository before you could import a 
> version into that flow. For some reason I thought ‘Import Flow’ would create 
> the bucket and flow if it didn’t already exist. Thanks for the help!
> 
> Dave
> 
> From: Kevin Doran <kdoran.apa...@gmail.com <mailto:kdoran.apa...@gmail.com>>
> Sent: Monday, September 10, 2018 10:18 AM
> To: users@nifi.apache.org <mailto:users@nifi.apache.org>
> Subject: Re: Nifi Registry + Git: target registry ignores git flows
> 
> Hi Dave,
> 
> Either persistence provider should work fine for your use case.  The error 
> message indicates that flow ID does not exist in that bucket. You can browse 
> the available buckets and flows in the NiFi Registry UI (in the default 
> view), where clicking on a flow will display details including the flow id 
> and bucket id.
> 
> You can also get this information from the CLI using the 'nifi-registy 
> list-buckets' and 'nifi-registy list-flows' commands.
> 
> If you are using the correct ids and still getting this error, it means 
> something is corrupted creating a mismatch between the flow persistence 
> provider and the metadata persistence provider. I’ve never seen that happen 
> before. My guess would be it could be caused due to a configuration error, a 
> change from one provider to another without foiloowing the right steps, or 
> manually modifying the persistence files outside of the NiFi Registry API/UI
> 
> I hope this helps you get on the right track. Let me know if you need further 
> assistance.
> 
> Cheers,
> Kevin
> 
> From: David Gallagher <dgallag...@cleverdevices.com 
> <mailto:dgallag...@cleverdevices.com>>
> Reply-To: "users@nifi.apache.org <mailto:users@nifi.apache.org>" 
> <users@nifi.apache.org <mailto:users@nifi.apache.org>>
> Date: Sunday, September 9, 2018 at 11:06
> To: "users@nifi.apache.org <mailto:users@nifi.apache.org>" 
> <users@nifi.apache.org <mailto:users@nifi.apache.org>>
> Subject: RE: Nifi Registry + Git: target registry ignores git flows
> 
> Thanks for the assistance! I tried the CLI and it worked up until I tried to 
> export a flow from ‘Dev’, got this message:
> 
> 2018-09-09 10:52:45,911 ERROR [NiFi Registry Web Server-19] 
> o.a.n.r.web.mapper.ThrowableMapper An unexpected error has occurred: 
> org.apache.nifi.registry.flow.FlowPersistenceException: Flow ID 
> 0df59975-2683-4e84-91f5-f616bbed207a version 1 was not found in bucket 
> CleverGit:34658e23-c138-4085-9280-6359f322672d.. Returning Internal Server 
> Error response.
> org.apache.nifi.registry.flow.FlowPersistenceException: Flow ID 
> 0df59975-2683-4e84-91f5-f616bbed207a version 1 was not found in bucket 
> CleverGit:34658e23-c138-4085-9280-6359f322672d.
> 
> Am I going about this the wrong way? Should I just be using the default flow 
> persistence provider?
> 
> Thanks,
> 
> Dave
> 
> From: Kevin Doran <kdoran.apa...@gmail.com <mailto:kdoran.apa...@gmail.com>>
> Sent: Saturday, September 8, 2018 1:54 PM
> To: users@nifi.apache.org <mailto:users@nifi.apache.org>
> Subject: Re: Nifi Registry + Git: target registry ignores git flows
> 
> Mike is correct – it is likely due to mismatch of metadata (bucket ids and 
> flow ids) in the two environments. The recommended way to move flow snapshots 
> across air-gapped environments at this time is and export/import with the 
> NiFi CLI [1], a tool included the NiFi Toolkit, which you can download here 
> [2]. The import step will create the necessary metadata for you.
> 
> Let me know if you have any questions!
> 
> [1] https://github.com/apache/nifi/tree/master/nifi-toolkit/nifi-toolkit-cli 
> <https://github.com/apache/nifi/tree/master/nifi-toolkit/nifi-toolkit-cli>
> [2] https://nifi.apache.org/download.html 
> <https://nifi.apache.org/download.html>
> 
> Kevin
> 
> 
> From: Mike Thomsen <mikerthom...@gmail.com <mailto:mikerthom...@gmail.com>>
> Reply-To: "users@nifi.apache.org <mailto:users@nifi.apache.org>" 
> <users@nifi.apache.org <mailto:users@nifi.apache.org>>
> Date: Saturday, September 8, 2018 at 13:17
> To: "users@nifi.apache.org <mailto:users@nifi.apache.org>" 
> <users@nifi.apache.org <mailto:users@nifi.apache.org>>
> Subject: Re: Nifi Registry + Git: target registry ignores git flows
> 
> It probably has to do with the database the registry used not being migrated 
> to your new environment. Try setting up a snapshot of that too.
> On Sat, Sep 8, 2018 at 1:06 PM David Gallagher <dgallag...@cleverdevices.com 
> <mailto:dgallag...@cleverdevices.com>> wrote:
> Hi – I have a dev registry server (1.7.1) set up with git, and am trying to 
> use git bundle to move the buckets and flows to a test registry instance (I’m 
> using git bundle because there’s going to be an air gap in production). 
> Everything looks fine, but when I start the production registry it ignores 
> the buckets from the clone. I’ve got this in the error message:
> 
> 2018-09-08 11:57:39,084 INFO [main] o.a.n.r.provider.StandardProviderFactory 
> Instantiated FlowPersistenceProvider with class name 
> org.apache.nifi.registry.provider.flow.git.GitFlowPersistenceProvider
> 2018-09-08 11:57:40,077 WARN [main] o.a.n.r.p.flow.git.GitFlowMetaData Git 
> object id for Flow 0df59975-2683-4e84-91f5-f616bbed207a version 1 with path 
> CleverGit\LogonTransactions_to_CleverReports.snapshot in bucket 
> CleverGit:34658e23-c138-4085-9280-6359f322672d was not found. Ignoring this 
> entry.
> 
> I can see that the structure is present and (seemingly) correct on the ‘Prod’ 
> registry. Anything obvious that I’m missing, or things I can try out?
> 
> Thanks,
> 
> Dave

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to