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/11/26 11:05:20 UTC

[GitHub] [cloudstack] ravening opened a new pull request #5723: server: Fix NPE while adding network to VPC

ravening opened a new pull request #5723:
URL: https://github.com/apache/cloudstack/pull/5723


   ### Description
   Sometimes adding network to VPC fails because of libirt error.
   In that case the new network wont have any VR's associated with it
   and hence it will return null.
   
   
   ```
   { Ans: , MgmtId: 95537038070, via: 346, Ver: v1, Flags: 110, [{"com.cloud.agent.api.PlugNicAnswer":
   {"result":false,"details":
   " Plug Nic failed due to org.libvirt.LibvirtException: internal error: No more available PCI slots","wait":0}}] }
   ```
   <!--- 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)
   - [ ] 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
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- 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.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,7 +348,7 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
-        if (routers.size() > 0) {
+        if (routers != null && routers.size() > 0) {

Review comment:
       @ravening can you update this ^^^




-- 
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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       > 
   
   @ravening Did NPE happen when deploy a vm or list routers ?




-- 
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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache you need any more clarifications?




-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2004


-- 
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] sureshanaparti commented on pull request #5723: server: Fix NPE while adding network to VPC

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


   @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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache I updated the code




-- 
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] sureshanaparti commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,7 +348,7 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
-        if (routers.size() > 0) {
+        if (router != null && routers.size() > 0) {

Review comment:
       @ravening typo here, pls correct. packaging failed due to this.
   
   ```suggestion
           if (routers != null && routers.size() > 0) {
   ```




-- 
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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       > 
   a bit confused. deploy vm -> plug nic to VR -> libvirt issue -> NPE ?
   




-- 
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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache I tried to deploy a new vpc, with tiers and vm in it but the control never reached the line 356 of this 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 #5723: server: Fix NPE while adding network to VPC

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


   <b>Trillian test result (tid-2737)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 35391 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5723-t2737-kvm-centos7.zip
   Smoke tests completed. 91 look OK, 0 have errors
   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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @ravening 
   I think the normal way to fix NPE is adding a check like below.
   ```
    
            //1st time it runs the domain router of the VM shall be returned
            List<DomainRouterVO> routers = super.getRouters(network, dest);
   -        if (routers.size() > 0) {
   +        if (routers != null && routers.size() > 0) {
                return routers;
            }
    
   ```
   
   then I got following error when I create the 24th vpc tier
   `
   Unable to add NIC to VM instance {id: \"1693\", name: \"i-2-1693-VM\", uuid: \"f79f121f-65bb-4212-82b8-99f3be9d3654\", type=\"User\"}: com.cloud.exception.ResourceUnavailableException: Resource [DataCenter:1] is unreachable: Unable to apply network rules as a part of network Ntwk[3521|Guest|11] implement`
   
   What is the error in your testing result ?
   
   both options are good to me.
   
   




-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   @sureshanaparti 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] blueorangutan commented on pull request #5723: server: Fix NPE while adding network to VPC

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


   @sureshanaparti 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] sureshanaparti commented on pull request #5723: server: Fix NPE while adding network to VPC

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


   @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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache NPE happened while deploying vm




-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   @weizhouapache 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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @ravening 
   this might cause some issues. 
   the codes from line 371 to line 379 which create and deploy virtual routers will be ignored.
   




-- 
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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @ravening 
   Sorry I still did not get why you made this change.
   you said that there was a libvirt issue when you added new vpc tier. Was the vpc tier added successfully ? I think the vpc tier should not be added.




-- 
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] sureshanaparti merged pull request #5723: server: Fix NPE while adding network to VPC

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


   


-- 
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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache `PlugNicAnswer` may not solve the issue. the NPE happens when the code tries to list the VR's for the network but it gets a null rather than empty list or list with size > 0




-- 
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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache worked fine 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.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       Hi @ravening is this PR ready, or any further changes to be done based on the feedback? 




-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 1839


-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   @sureshanaparti 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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @ravening
   destroy all routers and then deploy vm ?




-- 
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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache yes, I want to fix the NPE ... let me check the code in PlugNicAnswer




-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_multiplication_x: debian :heavy_check_mark: suse15. SL-JID 2001


-- 
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] sureshanaparti commented on pull request #5723: server: Fix NPE while adding network to VPC

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


   @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] weizhouapache commented on pull request #5723: server: Fix NPE while adding network to VPC

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


   code lgtm
   did not test it.


-- 
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] weizhouapache commented on pull request #5723: server: Fix NPE while adding network to VPC

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


   @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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @weizhouapache vpc tier was already added successfully but when i tried to deploy a vm in that tier, it failed because of libvirt issue and also the vm deployment failed saying "internal server error". In the logs I could see that there NPE at this code location. So I navigated to networks -> select vpc tier -> virtual routers, it was empty. for other tiers in the same vpc, i could see VR




-- 
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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @ravening 
   Got it. so what do you want to solve, the NPE exception ? can you try to change the code which process the PlugNicAnswer ?




-- 
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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       yes..
   
   when i try to deploy a vm, it send plugnic command to agent and that failed. after that we get this NPE




-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_multiplication_x: suse15. SL-JID 1846


-- 
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] weizhouapache commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,6 +348,9 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
+        if (routers == null) {

Review comment:
       @ravening 
   I noticed the issue you mentioned in the description. 
   could you please look for other ways to fix the issue ?




-- 
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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,7 +348,7 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
-        if (routers.size() > 0) {
+        if (routers != null && routers.size() > 0) {

Review comment:
       @sureshanaparti done




-- 
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 #5723: server: Fix NPE while adding network to VPC

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


   @weizhouapache 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] weizhouapache commented on pull request #5723: server: Fix NPE while adding network to VPC

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


   @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] ravening commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,7 +348,7 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
-        if (routers.size() > 0) {
+        if (router != null && routers.size() > 0) {

Review comment:
       @sureshanaparti  done




-- 
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 #5723: server: Fix NPE while adding network to VPC

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



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,7 +348,7 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
-        if (routers.size() > 0) {
+        if (routers != null && routers.size() > 0) {

Review comment:
       We could use `org.apache.commons.collections.CollectionUtils#isNotEmpty` here.




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