You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "markap14 (via GitHub)" <gi...@apache.org> on 2026/04/23 15:27:42 UTC

[PR] Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

markap14 opened a new pull request, #11175:
URL: https://github.com/apache/nifi/pull/11175

   …mes modifiable and user-managed (temporarily) rather than Connector managed.
   
   <!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
   <!-- contributor license agreements.  See the NOTICE file distributed with -->
   <!-- this work for additional information regarding copyright ownership. -->
   <!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
   <!-- (the "License"); you may not use this file except in compliance with -->
   <!-- the License.  You may obtain a copy of the License at -->
   <!--     http://www.apache.org/licenses/LICENSE-2.0 -->
   <!-- Unless required by applicable law or agreed to in writing, software -->
   <!-- distributed under the License is distributed on an "AS IS" BASIS, -->
   <!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
   <!-- See the License for the specific language governing permissions and -->
   <!-- limitations under the License. -->
   
   # Summary
   
   [NIFI-00000](https://issues.apache.org/jira/browse/NIFI-00000)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   - Pull request contains [commits signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) with a registered key indicating `Verified` status
   
   ### Pull Request Formatting
   
   - Pull Request based on current revision of the `main` branch
   - Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `./mvnw clean install -P contrib-check`
     - [ ] JDK 21
     - [ ] JDK 25
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4652791755

   Heads-up on a related backend bug I've been hitting while testing this branch end-to-end against the Connector REST endpoints. Flagging it here because it's the same family as the `findProcessGroup` fix you just landed in `42fbdd9`, and the fix would likely sit in the same area — but happy to split it into its own JIRA if you'd prefer.
   
   ### Symptom
   
   `GET /nifi-api/processors/{id}/descriptors?propertyName=<csTypedProp>&sensitive=false` returns `"allowableValues": []` for any controller-service-typed property on a processor that lives inside a Connector's managed flow — including when the processor's currently configured CS exists in that connector's group and is returned by `GET /nifi-api/flow/process-groups/{parentGroupId}/controller-services`. The same empty `allowableValues` shows up on CS-typed descriptors embedded in `GET /processors/{id}` and on the descriptor returned by the inline "create new service" round-trip from `PropertyTableHelper`. Flow-designer is unaffected; only the Connector context reproduces it (regardless of whether the connector is in `TROUBLESHOOTING` — I see it in normal `RUNNING` state too).
   
   Downstream UI effect: the value cell renders the CS UUID instead of its name, the combo box can't enumerate other compatible CSes, and a freshly-created inline CS also comes back as a UUID with no allowable-values context.
   
   ### Trace
   
   `StandardNiFiServiceFacade.getProcessorPropertyDescriptor` →
   
   ```java
   return dtoFactory.createPropertyDescriptorDto(descriptor, processor.getProcessGroup().getIdentifier());
   ```
   
   `DtoFactory#createPropertyDescriptorDto` (CS-typed branch) →
   
   ```java
   final List<String> controllerServiceIdentifiers = new ArrayList<>(
       controllerServiceProvider.getControllerServiceIdentifiers(serviceDefinition, groupId));
   ```
   
   `StandardControllerServiceProvider#getControllerServiceIdentifiers`:
   
   ```java
   ProcessGroup group = getRootGroup();
   if (!FlowManager.ROOT_GROUP_ID_ALIAS.equals(groupId) && !group.getIdentifier().equals(groupId)) {
       group = group.findProcessGroup(groupId);
   }
   
   if (group == null) {
       return Collections.emptySet();
   }
   ```
   
   Even with the `findProcessGroup` change from `42fbdd9` applied, the call from `mainRoot.findProcessGroup(connectorManagedPgId)` still returns null:
   
   - `flowManager.getGroup(id)` (unconditional) finds the managed PG fine.
   - `isOwner(group.getParent())` then walks parents. The connector's managed root only has `setExplicitParentAuthorizable(connectorNode)` set on it in `StandardFlowManager.createConnector(...)` — there is no `setParent(...)` linking it under the main root group. So `getParent()` returns `null`, the `isOwner` loop terminates immediately, and `findProcessGroup` returns null.
   - `getControllerServiceIdentifiers` short-circuits to `Collections.emptySet()` before the class/scope filter ever runs — hence the totally empty `allowableValues` array (not "wrong CSes filtered out").
   
   The same `getRootGroup().findProcessGroup(...)` pattern exists in a handful of other places in `StandardControllerServiceProvider` (`getControllerServiceNodes(String)` and friends) and would presumably miss connector-managed groups in the same way for any caller that resolves a group from a connector-context id starting at main root.
   
   ### Suggested shape of the fix
   
   Smallest change that matches the direction this PR has been heading (i.e. the new `ConnectorManagedComponentLookup` facades and the `locateProcessGroup(..., includeConnectorManaged=true)` calls in `StandardProcessGroupDAO`): inside `StandardControllerServiceProvider#getControllerServiceIdentifiers(serviceType, groupId)`, replace the `getRootGroup().findProcessGroup(groupId)` traversal with a direct `flowManager.getGroup(groupId)` lookup. The existing class filter (`service.getProxiedControllerService().getClass()` / `isAssignableFrom`) and the per-group `getControllerServices(true, false)` enumeration still do the right thing once the group is reachable. Auth has already happened on the owning processor, so the `isOwner` hierarchy gate isn't load-bearing for this code path.
   
   ### Repro
   
   1. Open a Connector whose managed flow contains a processor with a CS-typed property already configured to point at a CS that lives in the same connector group (e.g. PublishKafkaRecord → KafkaConnectionService).
   2. `GET /nifi-api/processors/{procId}/descriptors?propertyName=Kafka%20Connection%20Service&sensitive=false` → response below.
   3. `GET /nifi-api/flow/process-groups/{parentGroupId}/controller-services` → returns the CS with full details, confirming it exists and is enabled.
   
   ```json
   {
     "propertyDescriptor": {
       "name": "Kafka Connection Service",
       "displayName": "Kafka Connection Service",
       "allowableValues": [],
       "identifiesControllerService": "org.apache.nifi.kafka.service.api.KafkaConnectionService",
       "identifiesControllerServiceBundle": {
         "group": "org.apache.nifi",
         "artifact": "nifi-kafka-service-api-nar",
         "version": "2.10.0-SNAPSHOT"
       },
       "dependencies": []
     }
   }
   ```
   
   Reproducible regardless of Troubleshooting state — the connector was in normal `RUNNING` state when I captured this. Happy to file a separate JIRA if that's a cleaner home; just wanted to flag it here since you're already in the area and the fix would fit the same shape.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4665022092

   [claude-opus-4.6] **CI update: both Ubuntu system-test shards failed again — all pre-existing cluster timing flakes, unrelated to this PR. Rerun triggered.**
   
   **Run:** https://github.com/apache/nifi/actions/runs/27238660428
   
   **`ubuntu-24.04 Java 25`** — 1 failure:
   - `ClusteredRegistryClientIT.testControllerServiceUpdateWhileRunning`: HTTP 409 Conflict during test teardown (node still connecting when queue empty was requested)
   
   **`ubuntu-24.04 Java 21`** — 6 failures, all cluster timing races:
   - `ClusteredConnectorIT.testDeleteConnectorOnConnect`: timed out after 5 minutes
   - `LoadBalanceIT.testPartitionByAttribute`: HTTP 500 listing queue (node still connecting)
   - `ClusteredRegistryClientIT.testChangeVersionOnParentThatCascadesToChild`: HTTP 500 emptying queue during teardown
   - `ClusteredRegistryClientIT.testNewComponentsStartedDuringVersionChange`: HTTP 500 emptying queue during teardown
   - `ClusteredReplayProvenanceIT.testReplayLastEvent`: HTTP 500 emptying queue during teardown
   - `OffloadIT.testOffloadCompletesAfterStoppingAndTerminatingProcessorThatRetainsSessions`: HTTP 500 emptying queue during teardown
   
   Every failure is an HTTP 409/500 during cluster operations where a node hadn't finished connecting, or a timeout waiting for cluster coordination. The failing tests are spread across unrelated test classes and differ from the previous run's failures, confirming non-deterministic flakes. All other checks pass (macOS, Windows, build, Validate, CodeQL).
   
   Rerunned failed shards via `gh run rerun 27238660428 --failed`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4665702495

   [claude-opus-4.6] **CI update: Ubuntu system-test flakes are a pre-existing main-branch issue — not caused by this PR.**
   
   After three attempts, the Ubuntu system-test shards continue to fail with different cluster timing errors each time. The one consistent failure across all attempts, `LoadBalanceIT.testPartitionByAttribute`, also fails on **main** — the [latest main branch system-tests run](https://github.com/apache/nifi/actions/runs/27207646193) (June 9) shows `LoadBalanceIT.testPartitionByAttribute` as the only failure on both Ubuntu shards.
   
   **Attempt 3 failures (run 27238660428):**
   
   `ubuntu-24.04 Java 21` — 4 errors:
   - `LoadBalanceIT.testPartitionByAttribute` (also fails on main)
   - `OffloadIT.testOffload`
   - `OffloadContentClaimTruncationIT.testOffloadedFlowFileContentNotPrematurelyTruncated`
   - `ClusteredParameterContextIT.testAssetReplacement`
   
   `ubuntu-24.04 Java 25` — 2 errors:
   - `LoadBalanceIT.testPartitionByAttribute` (also fails on main)
   - `ClusterFlowDefinitionExportImportStateIT.testClusterExportCapturesBothScopes`
   
   All connector-specific tests pass on every attempt, including `ConnectorTroubleshootingIT` and `ClusteredConnectorTroubleshootingIT`. All non-Ubuntu checks pass (macOS Java 21 + 25, Windows, build, Validate, Scan, CodeQL). Triggered a fourth rerun attempt.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3250856181


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java:
##########
@@ -637,12 +663,155 @@ public void verifyCanDelete() {
 
     @Override
     public void verifyCanStart() {
+        if (getCurrentState() == ConnectorState.TROUBLESHOOTING) {
+            throw new IllegalStateException("Cannot start " + this + " because it is in Troubleshooting mode.");
+        }
         final ValidationState state = performValidation();
         if (state.getStatus() != ValidationStatus.VALID) {
             throw new IllegalStateException("Cannot start " + this + " because it is not valid: " + state.getValidationErrors());
         }
     }
 
+    @Override
+    public void verifyCanEnterTroubleshooting() {
+        if (isExtensionMissing()) {
+            throw new IllegalStateException("Cannot enter Troubleshooting mode for " + this + " because it is a Ghost Connector (its underlying extension is missing).");
+        }
+
+        final ConnectorState currentState = getCurrentState();
+        switch (currentState) {
+            case TROUBLESHOOTING -> throw new IllegalStateException("Cannot enter Troubleshooting mode for " + this + " because it is already in Troubleshooting mode.");
+            case STARTING, STOPPING, DRAINING, PURGING, PREPARING_FOR_UPDATE, UPDATING ->
+                throw new IllegalStateException("Cannot enter Troubleshooting mode for " + this + " because its state is currently "
+                    + currentState + "; it must be in a stable state before entering Troubleshooting.");
+            default -> {
+                // STOPPED, RUNNING, UPDATED, UPDATE_FAILED are all acceptable to enter Troubleshooting from
+            }
+        }
+    }
+
+    @Override
+    public void verifyCanEndTroubleshooting() {
+        if (getCurrentState() != ConnectorState.TROUBLESHOOTING) {
+            throw new IllegalStateException("Cannot end Troubleshooting mode for " + this + " because it is not currently in Troubleshooting mode; current state is " + getCurrentState());
+        }
+
+        // Verify that every component inside the managed flow is stopped/disabled BEFORE doing any other validation.
+        // The flow-update check below relies on components being stopped/disabled in order to produce meaningful results. Otherwise,
+        // the update check may succeed and then the running flow puts it into a bad state.
+        final ProcessGroup managedGroup = getActiveFlowContext().getManagedProcessGroup();
+        verifyAllComponentsStoppedAndDisabled(managedGroup);
+
+        // After confirming all components are stopped or disabled, check if the managed flow can be safely reverted.
+        // Connector's authoritative flow would succeed. This mirrors exactly what endTroubleshooting() will do so that
+        // any problem (e.g. a Connection whose contents cannot be preserved or a component that cannot be replaced)
+        // is reported synchronously at the REST verify-phase rather than surfacing halfway through the state change.
+        final VersionedExternalFlow authoritativeFlow = resolveAuthoritativeFlow();
+        try {
+            initializationContext.verifyUpdateFlow(activeFlowContext, authoritativeFlow, BundleCompatibility.RESOLVE_BUNDLE);
+        } catch (final FlowUpdateException e) {
+            throw new IllegalStateException("Cannot end Troubleshooting mode for " + this
+                + " because the Managed Process Group cannot be reverted to the Connector's authoritative flow: " + e.getMessage(), e);
+        }
+    }
+
+    private VersionedExternalFlow resolveAuthoritativeFlow() {
+        final VersionedExternalFlow authoritativeFlow;
+        try (final NarCloseable ignored = NarCloseable.withComponentNarLoader(extensionManager, getConnector().getClass(), getIdentifier())) {
+            authoritativeFlow = getConnector().getActiveFlow(activeFlowContext);
+        }
+
+        if (authoritativeFlow == null || authoritativeFlow.getFlowContents() == null) {
+            logger.warn("Connector {} returned a null authoritative flow from getActiveFlow; using an empty flow.", this);
+            final VersionedExternalFlow empty = new VersionedExternalFlow();
+            empty.setFlowContents(new VersionedProcessGroup());
+            return empty;
+        }
+
+        return authoritativeFlow;
+    }
+
+    private void verifyAllComponentsStoppedAndDisabled(final ProcessGroup group) {
+        for (final ProcessorNode processor : group.getProcessors()) {
+            if (!STOPPED_STATES.contains(processor.getScheduledState())) {
+                throw new IllegalStateException("Cannot end Troubleshooting mode for " + this + " because Processor " + processor.getIdentifier()
+                    + " is in state " + processor.getScheduledState() + "; it must be STOPPED or DISABLED.");
+            }

Review Comment:
   The way this works currently is a bit confusing. You can enter troubleshooting mode while the processor is running, but you can't end troubleshooting with it still running. This forces the user to have to manually stop all processors before they would be allowed to end troubleshooting. For large connectors, this will be a tedious process of manually stopping everything.
   
   It might be more palatable if STOP was a valid action on the connector as a whole while in troubleshooting mode. But it is explicitly not allowed in the current state.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3343066370


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardProcessGroupDAO.java:
##########


Review Comment:
   To support enabling/disabling controller services for a process group in a connector there are a couple of changes that will need to be made in this file to properly locate the process group:
   
   * in `scheduleComponents`, line 305 should probably be:
   ```java
           final ProcessGroup group = locateProcessGroup(flowController, groupId, true);
   ```
   
   * in `activateControllerServices`, line 414 should probably be:
   ```java
           final ProcessGroup group = locateProcessGroup(flowController, groupId, true);
   ```
   
   Otherwise, the lookup fails with a 400 error indicating it "Cannot activate Controller Services with IDs [] because the associated Process Group (id=<<pgid>>) could not be found"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3343066370


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardProcessGroupDAO.java:
##########


Review Comment:
   To support enabling/disabling controller services for a process group in a connector there are a couple of changes that will need to be made in this file to properly locate the process group:
   
   * in `scheduleComponents`, line 305 should probably be:
   ```java
           final ProcessGroup group = locateProcessGroup(flowController, groupId, true);
   ```
   
   * in `activateControllerServices`, line 414 should probably be:
   ```java
           final ProcessGroup group = locateProcessGroup(flowController, groupId, true);
   ```
   
   Otherwise, the lookup fails with a 400 error indicating it "Cannot activate Controller Services with IDs [] because the associated Process Group (id=[[pgid]]) could not be found"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3343066370


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardProcessGroupDAO.java:
##########


Review Comment:
   To support enabling/disabling controller services for a process group in a connector there are a couple of changes that will need to be made in this file to properly locate the process group:
   
   `in scheduleComponents`, line 305 should probably be:
   ```java
           final ProcessGroup group = locateProcessGroup(flowController, groupId, true);
   ```
   
   in `activateControllerServices`, line 414 should probably be:
   ```java
           final ProcessGroup group = locateProcessGroup(flowController, groupId, true);
   ```
   
   Otherwise, the lookup fails with a 400 error indicating it "Cannot activate Controller Services with IDs [] because the associated Process Group (id=<<pgid>>) could not be found"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4665354400

   [claude-opus-4.6] **CI update: Ubuntu system-test shards flaked again on rerun — different tests each time, confirming non-deterministic cluster timing issues. Triggered another rerun.**
   
   **Rerun results (run 27238660428):**
   
   **`ubuntu-24.04 Java 21`** — 3 errors in 454 tests:
   - `LoadBalanceIT.testPartitionByAttribute`: HTTP 500 listing queue
   - `LoadBalanceIT` teardown: HTTP 500 emptying queue
   - `ClusteredGetLatestProvenanceEventsIT` teardown: HTTP 500 emptying queue
   
   **`ubuntu-24.04 Java 25`** — 4 errors in 454 tests:
   - `OffloadIT.testOffload`: HTTP 500
   - `ClusteredConnectorDrainIT` teardown: purge connector request failed
   - `LoadBalanceIT.testPartitionByAttribute`: HTTP 500
   - `OffloadContentClaimTruncationIT.testOffloadedFlowFileContentNotPrematurelyTruncated`: HTTP 500
   
   All failing tests are different from the previous run's failures. All connector-specific tests passed, including `ConnectorTroubleshootingIT` and `ClusteredConnectorTroubleshootingIT`.
   
   All other checks pass: Scan, Validate, CodeQL, macOS (Java 21 + 25), Windows, build (3 OS/JDK combos).
   
   Triggered another rerun of the failed shards.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3268944990


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java:
##########


Review Comment:
   ConnectorRepository.getConnectors() got a required ConnectorSyncMode parameter. But FlowController is still calling getConnectors() with no args. Results in a compile error.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4653604722

   [claude-opus-4.6] **CI: `ubuntu-24.04 Java 25` system-tests failed — pre-existing flake, not related to this PR.**
   
   **Failing check:** [ubuntu-24.04 Java 25](https://github.com/apache/nifi/actions/runs/27164357082/job/80187641690) (system-tests)
   
   **Failing test:** `ClusteredConnectorIT.testBundleResolutionResolveNewestBundle`
   
   **Error:**
   ```
   org.apache.nifi.toolkit.client.NiFiClientException: Error deleting purge request for Connector
   a8ed95db-019e-1000-0000-000002955768: Cluster is unable to service request to change flow:
   Node localhost:5671 is currently connecting
   Caused by: jakarta.ws.rs.ClientErrorException: HTTP 409 Conflict
   ```
   
   **Why this is unrelated:** The failure is a cluster timing race during test cleanup — a node hadn't finished connecting when the test tried to delete a purge request. This PR's latest commit changed `StandardControllerServiceProvider#getControllerServiceIdentifiers` (a controller service lookup path), which is not involved in connector purge or cluster join operations. `ClusteredConnectorIT` also [failed on main](https://github.com/apache/nifi/actions/runs/26846547987) on June 2 with a similar cluster timing issue (`testDeleteConnectorOnConnectWithDataQueued` timed out).
   
   **Plan:** Will rerun the failed shard once the parent workflow completes (sibling jobs are still in progress).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4654264946

   [claude-opus-4.6] **CI update: Ubuntu system-test shards failed again on rerun — all pre-existing flakes, unrelated to this PR.**
   
   Both `ubuntu-24.04 Java 21` and `ubuntu-24.04 Java 25` failed with different tests this time, all cluster timing races:
   
   | Test | Error | Shards |
   |------|-------|--------|
   | `ClusteredConnectorTroubleshootingIT.testConfigurationAndAuthoritativeFlowRestoredAfterTroubleshootingRestart` | Node failed to reconnect within 60s after restart | Java 25 |
   | `LoadBalanceIT.testPartitionByAttribute` | HTTP 409 — node still connecting during queue listing | Both |
   | `ClusteredRegistryClientIT.testControllerServiceUpdateWhileRunning` | Cluster conflict | Java 25 |
   | `OffloadContentClaimTruncationIT.testOffloadedFlowFileContentNotPrematurelyTruncated` | Timeout | Java 21 |
   
   All failing tests are different from the initial run (which failed on `ClusteredConnectorIT.testBundleResolutionResolveNewestBundle`), confirming these are non-deterministic cluster timing flakes rather than a consistent regression. `OffloadContentClaimTruncationIT` [also fails on main](https://github.com/apache/nifi/actions/runs/26792184340). macOS shards (`macos-15 Java 21`, `macos-15 Java 25`) both pass all system tests cleanly.
   
   All other checks pass: build (3 OS/JDK combos), code-compliance (Validate + Scan), docker-tests, integration-tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4653092664

   [claude-opus-4.6] @rfellows Fixed in 69fe7f2: replaced `group.findProcessGroup(groupId)` with `flowManager.getGroup(groupId)` in `StandardControllerServiceProvider#getControllerServiceIdentifiers`, consistent with the approach used elsewhere in this PR. Added a unit test that verifies the lookup succeeds for a group that is not under the main root.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "kevdoran (via GitHub)" <gi...@apache.org>.
kevdoran merged PR #11175:
URL: https://github.com/apache/nifi/pull/11175


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on PR #11175:
URL: https://github.com/apache/nifi/pull/11175#issuecomment-4652814916

   [claude-opus-4.6] @rfellows Thanks for the detailed trace — the analysis is spot-on. The `getRootGroup().findProcessGroup(groupId)` pattern in `StandardControllerServiceProvider#getControllerServiceIdentifiers` will indeed return null for connector-managed groups since they're not children of the main root, leading to the empty `allowableValues`.
   
   Since this reproduces regardless of TROUBLESHOOTING state (i.e., it's a pre-existing issue with connector-managed flows, not something introduced by this PR), it would be cleanest to track it as a separate JIRA so this PR stays focused on the TROUBLESHOOTING feature. The fix shape you described (`flowManager.getGroup(groupId)` in place of the root-group walk) is consistent with the direction of the other `findProcessGroup` fixes already in this PR, so it should be a straightforward follow-up. Would you mind filing that?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3389663801


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectorDAO.java:
##########
@@ -157,6 +158,34 @@ public void verifyCancelDrainFlowFile(final String id) {
         connector.verifyCancelDrainFlowFiles();
     }
 
+    @Override
+    public void verifyEnterTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().verifyEnterTroubleshooting(connector);
+    }
+
+    @Override
+    public void enterTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().enterTroubleshooting(connector);
+    }
+
+    @Override
+    public void verifyEndTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().verifyEndTroubleshooting(connector);
+    }
+
+    @Override
+    public void endTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        try {
+            getConnectorRepository().endTroubleshooting(connector);
+        } catch (final FlowUpdateException e) {
+            throw new IllegalStateException("Failed to exit troubleshooting mode for Connector " + id + ": " + e, e);
+        }
+    }
+

Review Comment:
   [claude-opus-4.6] Good catch — you're right, these should use `LOCAL_ONLY` like the other mutation methods in this class. There's no reason to sync with the provider before entering or exiting troubleshooting. Fixed in 49cb599: all four troubleshooting methods now use `requireConnector(id, ConnectorSyncMode.LOCAL_ONLY)`. Also took the opportunity to fix the `+ e` → `+ e.getMessage()` in the `endTroubleshooting` error message per the earlier review feedback.



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java:
##########
@@ -3704,7 +3734,8 @@ public ConnectorEntity updateConnector(final Revision revision, final ConnectorD
 
     @Override
     public void verifyDeleteConnector(final String id) {
-        // For now, DAO will enforce state; expose hook for symmetry
+        final ConnectorNode connector = connectorDAO.getConnector(id);
+        connector.verifyCanDelete();

Review Comment:
   [claude-opus-4.6] Agreed — `verifyDeleteConnector` was bypassing the DAO/Repository path and going directly to the node, which means a `ConnectorConfigurationProvider` wouldn't be consulted during the pre-check phase. Fixed in the same commit (49cb599): added `verifyDelete(ConnectorNode)` to `ConnectorRepository`, `verifyDelete(String)` to `ConnectorDAO`, and routed `StandardNiFiServiceFacade.verifyDeleteConnector` through the DAO. The repository implementation currently delegates to `connector.verifyCanDelete()`, but this provides the hook point for provider consultation in the future, consistent with the `verifyCreate` pattern.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15880: Allow Connectors to enter a Troublehshooting mode where the flow beco… [nifi]

Posted by "kevdoran (via GitHub)" <gi...@apache.org>.
kevdoran commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3384943314


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java:
##########
@@ -3704,7 +3734,8 @@ public ConnectorEntity updateConnector(final Revision revision, final ConnectorD
 
     @Override
     public void verifyDeleteConnector(final String id) {
-        // For now, DAO will enforce state; expose hook for symmetry
+        final ConnectorNode connector = connectorDAO.getConnector(id);
+        connector.verifyCanDelete();

Review Comment:
   Not a blocker as this was pre-existing, and improving it could be a future extensibility API enhancement, but `verifyCanDelete()` should probably use the `ConnectorDAO->ConnectorRepository` path to mirror `verifyCanCreate()`, in case the `ConnectorRepository` wants to consult with the optional `ConnectorConfigurationProvider`



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectorDAO.java:
##########
@@ -157,6 +158,34 @@ public void verifyCancelDrainFlowFile(final String id) {
         connector.verifyCancelDrainFlowFiles();
     }
 
+    @Override
+    public void verifyEnterTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().verifyEnterTroubleshooting(connector);
+    }
+
+    @Override
+    public void enterTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().enterTroubleshooting(connector);
+    }
+
+    @Override
+    public void verifyEndTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().verifyEndTroubleshooting(connector);
+    }
+
+    @Override
+    public void endTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        try {
+            getConnectorRepository().endTroubleshooting(connector);
+        } catch (final FlowUpdateException e) {
+            throw new IllegalStateException("Failed to exit troubleshooting mode for Connector " + id + ": " + e, e);
+        }
+    }
+

Review Comment:
   should any of these use `requireConnector(id, ConnectorSyncMode.LOCAL_ONLY);` rather than `getConnector(id)`? Just making sure this is intentional.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org