You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/06/24 12:56:40 UTC

[GitHub] [cloudstack] Pearl1594 opened a new pull request #5154: Fix NPE when no recipients configured for sending alerts

Pearl1594 opened a new pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154


   ### Description
   
   This PR fixes the NPE that's encountered when `alert.email.addresses` isn't configured i.e.,no recipient.
   
   ```
   2021-06-23 04:08:46,798 ERROR [c.c.a.AlertManagerImpl] (RedundantRouterStatusMonitor-3:ctx-b0621cdd) (logid:3ad3ae67) Problem sending email alert
   java.lang.NullPointerException
   	at com.cloud.alert.AlertManagerImpl.sendAlert(AlertManagerImpl.java:722)
   	at com.cloud.alert.AlertManagerImpl.sendAlert(AlertManagerImpl.java:243)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
   	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
   	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
   	at com.sun.proxy.$Proxy121.sendAlert(Unknown Source)
   	at com.cloud.network.router.VirtualNetworkApplianceManagerImpl.updateRoutersRedundantState(VirtualNetworkApplianceManagerImpl.java:939)
   	at com.cloud.network.router.VirtualNetworkApplianceManagerImpl$RvRStatusUpdateTask.runInContext(VirtualNetworkApplianceManagerImpl.java:1083)
   	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:48)
   	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55)
   	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102)
   	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52)
   	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:45)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   
   ```
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
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.

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868407720


   @blueorangutan package


-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868934270


   <b>Trillian test result (tid-1107)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 53615 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5154-t1107-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Smoke tests completed. 85 look OK, 3 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_invalid_upgrade_kubernetes_cluster | `Failure` | 3612.36 | test_kubernetes_clusters.py
   test_02_deploy_and_upgrade_kubernetes_cluster | `Failure` | 53.48 | test_kubernetes_clusters.py
   test_03_deploy_and_scale_kubernetes_cluster | `Failure` | 47.30 | test_kubernetes_clusters.py
   test_04_basic_lifecycle_kubernetes_cluster | `Failure` | 656.76 | test_kubernetes_clusters.py
   test_05_delete_kubernetes_cluster | `Failure` | 930.28 | test_kubernetes_clusters.py
   test_07_deploy_kubernetes_ha_cluster | `Failure` | 0.06 | test_kubernetes_clusters.py
   test_08_deploy_and_upgrade_kubernetes_ha_cluster | `Failure` | 0.05 | test_kubernetes_clusters.py
   test_09_delete_kubernetes_ha_cluster | `Failure` | 0.05 | test_kubernetes_clusters.py
   ContextSuite context=TestKubernetesCluster>:teardown | `Error` | 44.97 | test_kubernetes_clusters.py
   test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | `Failure` | 345.11 | test_routers_network_ops.py
   test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | `Failure` | 341.37 | test_routers_network_ops.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 537.38 | test_vpc_redundant.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Error` | 537.39 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 543.69 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 518.37 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 518.38 | test_vpc_redundant.py
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867663991


   > @Pearl1594 does it affect 4.15?
   
   No @rhtyd , this arises due to some changes made in 4.16/main


-- 
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.

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-870209094


   @blueorangutan package


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-870217733


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 405


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867614742


   @blueorangutan package


-- 
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.

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



[GitHub] [cloudstack] RodrigoDLopez commented on a change in pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
RodrigoDLopez commented on a change in pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#discussion_r657960224



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,10 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {
+            return;

Review comment:
       Could you put a log message stating that the parameter was not set correctly?




-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868424119


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 370


-- 
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.

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



[GitHub] [cloudstack] rhtyd commented on a change in pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#discussion_r659786108



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {

Review comment:
       cc @DaanHoogland @GutoVeronezi can you review this thanks.




-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868408397


   @Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make 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.

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-870218142


   @blueorangutan test


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867615365


   @Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make 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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-870218223


   @Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke 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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] rhtyd commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-869377230


   @blueorangutan package 


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#discussion_r659817438



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {
+            s_logger.info("No recipients set in 'alert.email.addresses', skipping sending an alert");

Review comment:
       We could add subject and content to the message, e.g. `... skipping sending alert with subject [%s] and content [%s].`  
     Also, IMHO, I think it would be better to log it as `warning`.

##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {

Review comment:
       Maybe we could do this validation before instantiating the properties.
   




-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] rhtyd merged pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154


   


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] Pearl1594 edited a comment on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 edited a comment on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867663991


   > @Pearl1594 does it affect 4.15?
   
   No @rhtyd , this is caused due to some changes made in 4.16/main


-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-869863848


   <b>Trillian test result (tid-1128)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 34773 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5154-t1128-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
   Smoke tests completed. 88 look OK, 0 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-869377512


   @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make 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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867637383


   @blueorangutan test


-- 
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.

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868431548


   @blueorangutan test


-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-869863848






-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] rhtyd commented on a change in pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#discussion_r659787515



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {

Review comment:
       Nevermind Daan already LGTM'd. Let's wait for the test.




-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-869414923


   @blueorangutan test


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#discussion_r659817438



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {
+            s_logger.info("No recipients set in 'alert.email.addresses', skipping sending an alert");

Review comment:
       We could add subject and content to the message, e.g. `... skipping sending alert with subject [%s] and content [%s].`  
     Also, IMHO, I think it would be better to log it as `warning`.

##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {

Review comment:
       Maybe we could do this validation before instantiating the properties.
   




-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867637128


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 358


-- 
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.

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-870209094






-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on a change in pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#discussion_r657987389



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,10 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {
+            return;

Review comment:
       @RodrigoDLopez added an info log. Thanks




-- 
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.

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



[GitHub] [cloudstack] rhtyd commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867653987


   @Pearl1594 does it affect 4.15?


-- 
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.

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868401699


   @Pearl1594 did you test this outside your dev env? 


-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868403080


   <b>Trillian test result (tid-1093)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 73834 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5154-t1093-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
   Intermittent failure detected: /marvin/tests/smoke/test_resource_accounting.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dns.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dnsservice.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers.py
   Intermittent failure detected: /marvin/tests/smoke/test_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_snapshots.py
   Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
   Smoke tests completed. 75 look OK, 13 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 | `Failure` | 544.99 | test_internal_lb.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 1019.90 | test_privategw_acl.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDns>:setup | `Error` | 0.00 | test_router_dns.py
   ContextSuite context=TestRouterDnsService>:setup | `Error` | 0.00 | test_router_dnsservice.py
   ContextSuite context=TestRouterIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestVPCIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestIsolatedNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRedundantIsolateNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRouterServices>:setup | `Error` | 0.00 | test_routers.py
   ContextSuite context=TestCpuCapServiceOfferings>:setup | `Error` | 0.00 | test_service_offerings.py
   ContextSuite context=TestServiceOfferings>:setup | `Error` | 0.12 | test_service_offerings.py
   ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 527.78 | test_vpc_redundant.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Error` | 527.79 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 538.15 | test_vpc_redundant.py
   


-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-870209180


   @Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make 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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] rhtyd commented on a change in pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#discussion_r659786108



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {

Review comment:
       cc @DaanHoogland @GutoVeronezi can you review this thanks.

##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -718,6 +718,11 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
         mailProps.setContent(content);
         mailProps.setContentType("text/plain");
 
+        if (recipients == null) {

Review comment:
       Nevermind Daan already LGTM'd. Let's wait for the test.




-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-869415615


   @Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke 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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868431375


   > > > @Pearl1594 did you test this outside your dev env?
   > > 
   > > 
   > > Sorry @DaanHoogland I didn't quite understand what you meant, but I did test it locally on a simulator based env as well
   > 
   > I meant for instance a dedicated lab or test environment, but I see trillian output now. unfortunately no pass but surely nothing to do with your change.
   
   Yeah, most errors pertain to the host being in an invalid 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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868432099


   @Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke 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.

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



[GitHub] [cloudstack] rhtyd commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-873836072


   LGTM merging based on travis tests (job 1-2).


-- 
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: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868427514


   > > @Pearl1594 did you test this outside your dev env?
   > 
   > Sorry @DaanHoogland I didn't quite understand what you meant, but I did test it locally on a simulator based env as well
   
   I meant for instance a dedicated lab or test environment, but I see trillian output now. unfortunately no pass but surely nothing to do with your change.


-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-867638193


   @Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke 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.

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



[GitHub] [cloudstack] Pearl1594 commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-868405722


   > @Pearl1594 did you test this outside your dev env?
   
   Sorry @DaanHoogland I didn't quite understand what you meant, but I did test it locally on a simulator based env as well


-- 
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #5154: Fix NPE when no recipients configured for sending alerts

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5154:
URL: https://github.com/apache/cloudstack/pull/5154#issuecomment-869412272


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 383


-- 
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: commits-unsubscribe@cloudstack.apache.org

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