private void validateBulkCommandComponents(Map<String, StackModule> allStacks){
    if (null != stackInfo) {
      String currentStackId = stackInfo.getName() + StackManager.PATH_DELIMITER + stackInfo.getVersion();
      LOG.debug("Validate bulk command components for: {}", currentStackId);
      StackModule currentStack = allStacks.get(currentStackId);
      if (null != currentStack){
        for (ServiceModule serviceModule : currentStack.getServiceModules().values()) {
          ServiceInfo service = serviceModule.getModuleInfo();
          for(ComponentInfo component: service.getComponents()){
            BulkCommandDefinition bcd = component.getBulkCommandDefinition();
            if (null != bcd && null != bcd.getMasterComponent()){
              String name = bcd.getMasterComponent();
              ComponentInfo targetComponent = service.getComponentByName(name);
              if (null == targetComponent){
                String serviceName = service.getName();
                LOG.error(
                    String.format("%s bulk command section for service %s in stack %s references a component %s which doesn't exist.",
                        component.getName(), serviceName, currentStackId, name));
              }
            }
          }
        }
      }
    }
  }
Validate the component defined in the bulkCommand section is defined for the service
This needs to happen after the stack is resolved
ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java