[
https://issues.apache.org/jira/browse/NIFI-10371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17581471#comment-17581471
]
Mark Payne commented on NIFI-10371:
-----------------------------------
I managed to replicate the issue by following these steps:
1. Create Process Group: Outer. Go into group.
2. Create Process Group: Inner. Go into group.
3. Add Output Port.
4. Go up a level.
5. Version Control "Outer" PG. This establishes a VersionedComponentId for
components.
6. Copy & Paste PG "Inner". This creates an Output Port in the new PG with the
same Versioned Component ID as the first PG. Go into newly created copy.
7. Click on Output Port. Right click and choose "Move to Parent". This now
results in an Output Port within the "Outer" PG AND an Output Port within the
"Inner" PG with the same Versioned Component ID.
8. Delete the "Copy of Inner" PG
9. Add a ReplaceText Processor.
10. Connect Inner PG to ReplaceText.
11. Restart NiFi.
> 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
> Affects Versions: 1.16.0, 1.17.0, 1.16.1, 1.16.2, 1.16.3
> Reporter: Mark Payne
> Assignee: Mark Payne
> Priority: Major
>
> 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)