Mark Payne created NIFI-10371:
---------------------------------

             Summary: NiFi can fail to startup with error: 
IllegalStateException: Cannot add Connection to Process Group because source is 
an Output Port that does not belong to a child Process Group
                 Key: NIFI-10371
                 URL: https://issues.apache.org/jira/browse/NIFI-10371
             Project: Apache NiFi
          Issue Type: Bug
          Components: Core Framework
            Reporter: Mark Payne
            Assignee: Mark Payne


There was an issue brought up in Apache Slack for version 1.16 of NiFi:
{code:java}
Question - I’m having a major issue where i restarted nifi and now it crashes 
on startup with:
2022-07-31 03:10:05,448 INFO [main] o.a.n.c.s.AffectedComponentSet Starting the 
following components: AffectedComponentSet[inputPorts=[], outputPorts=[], 
remoteInputPorts=[], remoteOutputPorts=[], processors=[], 
controllerServices=[], reportingTasks=[]]
2022-07-31 03:10:05,452 WARN [main] org.eclipse.jetty.webapp.WebAppContext 
Failed startup of context 
o.e.j.w.WebAppContext@3ed03652{nifi-api,/nifi-api,file:///opt/nifi/nifi-current/work/jetty/nifi-web-api-1.16.0.war/webapp/,UNAVAILABLE}{./work/nar/extensions/nifi-server-nar-1.16.0.nar-unpacked/NAR-INF/bundled-dependencies/nifi-web-api-1.16.0.war}
org.apache.nifi.controller.serialization.FlowSynchronizationException: 
java.lang.IllegalStateException: Cannot add Connection to Process Group because 
source is an Output Port that does not belong to a child Process Group {code}
Additional debug logging was used to determine that when NiFi started up, it 
was attempting to create a connection from an Output Port to a Processor within 
the same Process Group, which is not allowed.

The issue appears to be the result of the fact that there are multiple Output 
Ports with the same Versioned Component ID.

One in the 'parent' process group and one in the child. Because of this, NiFi 
was mistakenly using the Output Port in the 'parent' group instead of the one 
in the child group in order to create the connection.

We should address this in two ways:
 # When obtaining the source or destination of a connection, we should first 
attempt to fetch the component by Instance ID instead of 'identifier' (which is 
the Versioned Component ID / "Tracking ID"). We should always prefer the 
instance id.
 # We should not allow two components with the same Versioned Component ID to 
exist in the same Process Group. It's ok for 2 components to have the same 
Versioned Component ID in different Process Groups, but if the components get 
moved to parent/child groups, it can create an issue.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to