This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 297bf489800 NIFI-16134 Fixed Controller Service enable failure 
Bulletins not attributed to source component (#11461)
297bf489800 is described below

commit 297bf4898005be693b47e681dec34f2bf65f5b8a
Author: Pierre Villard <[email protected]>
AuthorDate: Wed Jul 22 17:24:56 2026 +0200

    NIFI-16134 Fixed Controller Service enable failure Bulletins not attributed 
to source component (#11461)
    
    Signed-off-by: David Handermann <[email protected]>
---
 .../service/StandardControllerServiceProvider.java | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
index b3072695842..a6dbf238315 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
@@ -35,7 +35,9 @@ import org.apache.nifi.nar.ExtensionDefinition;
 import org.apache.nifi.nar.ExtensionManager;
 import org.apache.nifi.registry.flow.FlowRegistryClientNode;
 import org.apache.nifi.registry.flow.mapping.VersionedComponentStateLookup;
+import org.apache.nifi.reporting.Bulletin;
 import org.apache.nifi.reporting.BulletinRepository;
+import org.apache.nifi.reporting.ComponentType;
 import org.apache.nifi.reporting.Severity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -286,8 +288,8 @@ public class StandardControllerServiceProvider implements 
ControllerServiceProvi
             } catch (Exception e) {
                 logger.error("Failed to enable {}", controllerServiceNode, e);
                 if (this.bulletinRepo != null) {
-                    
this.bulletinRepo.addBulletin(BulletinFactory.createBulletin("Controller 
Service",
-                            Severity.ERROR.name(), "Could not start " + 
controllerServiceNode + " due to " + e));
+                    
this.bulletinRepo.addBulletin(createControllerServiceBulletin(controllerServiceNode,
+                            "Could not start " + controllerServiceNode + " due 
to " + e, e));
                 }
             }
         }
@@ -369,8 +371,8 @@ public class StandardControllerServiceProvider implements 
ControllerServiceProvi
                         }
 
                         if (this.bulletinRepo != null) {
-                            
this.bulletinRepo.addBulletin(BulletinFactory.createBulletin("Controller 
Service",
-                                Severity.ERROR.name(), "Could not enable " + 
controllerServiceNode + " due to " + e));
+                            
this.bulletinRepo.addBulletin(createControllerServiceBulletin(controllerServiceNode,
+                                "Could not enable " + controllerServiceNode + 
" due to " + e, e));
                         }
 
                         break;
@@ -379,8 +381,8 @@ public class StandardControllerServiceProvider implements 
ControllerServiceProvi
             } catch (Exception e) {
                 logger.error("Failed to enable {}", controllerServiceNode, e);
                 if (this.bulletinRepo != null) {
-                    
this.bulletinRepo.addBulletin(BulletinFactory.createBulletin("Controller 
Service",
-                        Severity.ERROR.name(), "Could not start " + 
controllerServiceNode + " due to " + e));
+                    
this.bulletinRepo.addBulletin(createControllerServiceBulletin(controllerServiceNode,
+                        "Could not start " + controllerServiceNode + " due to 
" + e, e));
                 }
             }
         }
@@ -829,4 +831,12 @@ public class StandardControllerServiceProvider implements 
ControllerServiceProvi
     public ExtensionManager getExtensionManager() {
         return extensionManager;
     }
+
+    private Bulletin createControllerServiceBulletin(final 
ControllerServiceNode serviceNode, final String message, final Throwable t) {
+        final ProcessGroup processGroup = serviceNode.getProcessGroup();
+        final String groupId = processGroup == null ? null : 
processGroup.getIdentifier();
+        final String groupName = processGroup == null ? null : 
processGroup.getName();
+        return BulletinFactory.createBulletin(groupId, groupName, 
serviceNode.getIdentifier(),
+                ComponentType.CONTROLLER_SERVICE, serviceNode.getName(), 
"Controller Service", Severity.ERROR.name(), message, t);
+    }
 }

Reply via email to