Chris Sampson created NIFI-14223:
------------------------------------
Summary: NiFi Toolkit pg-import no longer works without specifying
input-source
Key: NIFI-14223
URL: https://issues.apache.org/jira/browse/NIFI-14223
Project: Apache NiFi
Issue Type: Bug
Affects Versions: 2.2.0
Reporter: Chris Sampson
NIFI-14134 (https://github.com/apache/nifi/pull/9611) introduced the abilty to
{{pg-import}} a Flow Definition from a JSON file directly into NiFi.
Unfortauntely, the same change means it is no longer possible to import a Flow
Definition from NiFi Registry when an {{input-source}} is not specified in the
NiFi Toolkit command, because a {{NullPointerException}} is thrown when trying
to create a {{File}} resource from the null/empty String {{inputSource}}:
{code:java}
org.apache.nifi.toolkit.cli.api.CommandException: Error executing command
'pg-import' : null
at
org.apache.nifi.toolkit.cli.impl.command.nifi.AbstractNiFiCommand.doExecute(AbstractNiFiCommand.java:65)
at
org.apache.nifi.toolkit.cli.impl.command.AbstractPropertyCommand.execute(AbstractPropertyCommand.java:74)
at
org.apache.nifi.toolkit.cli.impl.command.CommandProcessor.processCommand(CommandProcessor.java:248)
at
org.apache.nifi.toolkit.cli.impl.command.CommandProcessor.processGroupCommand(CommandProcessor.java:229)
at
org.apache.nifi.toolkit.cli.impl.command.CommandProcessor.process(CommandProcessor.java:184)
at
org.apache.nifi.toolkit.cli.CLIMain.runSingleCommand(CLIMain.java:148)
at org.apache.nifi.toolkit.cli.CLIMain.main(CLIMain.java:75)
Caused by: java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at
org.apache.nifi.toolkit.cli.impl.command.nifi.pg.PGImport.doExecute(PGImport.java:96)
at
org.apache.nifi.toolkit.cli.impl.command.nifi.pg.PGImport.doExecute(PGImport.java:47)
at
org.apache.nifi.toolkit.cli.impl.command.nifi.AbstractNiFiCommand.doExecute(AbstractNiFiCommand.java:63)
... 6 more
{code}
Re-create by calling {{pg-import}} without an {{input-source}}, e.g.
{code:bash}
bin/cli.sh nifi pg-import -p /usr/src/app/.nifi-cli.nifi.properties
--bucketIdentifier 8d38bda0-6ccb-4a37-bf35-d2a236f28855 --flowIdentifier
7af91c2e-27b9-4a78-aa74-cd1fb6c42fc4 --flowVersion 9
--keep-existing-parameter-context true --posX 400.0 --posY 400.0
--registryClientId c72b2b8d-0194-1000-0000-0000390eea62 --verbose
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)