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 2020/08/21 18:06:11 UTC

[GitHub] [cloudstack] GabrielBrascher opened a new pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

GabrielBrascher opened a new pull request #4279:
URL: https://github.com/apache/cloudstack/pull/4279


   ## Description
   <!--- Describe your changes in detail -->
   When executing request [assignVirtualMachine](https://cloudstack.apache.org/api/apidocs-4.14/apis/assignVirtualMachine.html) with null `domainID` and a valid `projectID` then a `NullPointerException` happens at [DomainChecker.java](https://github.com/apache/cloudstack/blob/bb73bedb5511880c91abaa409462ba879cb0d7b7/server/src/main/java/com/cloud/acl/DomainChecker.java#L109).
   
   Command example:
   ```
   assign virtualmachine virtualmachineid=VM-ID projectid=ProjectID account=admin
   ```
   
   The `NullPointerException` that is thrown at `DomainChecker` is handled at [AssignVMCmd.java#L142](https://github.com/apache/cloudstack/blob/bb73bedb5511880c91abaa409462ba879cb0d7b7/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java#L142), resulting in the following log message: `Failed to move vm null`.
   
   
   **My question is:** does it make sense to assign VM to a project with `domainID=null`? If so, then the handling should be different. However, I think that it should not be `null` and therefore I added a proper log message.
   
   Prior to commit 
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [ ] 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)
   
   ## How Has This Been Tested?
   Via API request of API command  [assignVirtualMachine](https://cloudstack.apache.org/api/apidocs-4.14/apis/assignVirtualMachine.html).


----------------------------------------------------------------
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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   @rhtyd 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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   LGTM merging this based on Travis tests pass.


----------------------------------------------------------------
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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   Test manually rekicked


----------------------------------------------------------------
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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   @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] rhtyd commented on pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   @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] GabrielBrascher commented on a change in pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
##########
@@ -139,7 +139,13 @@ public void execute() {
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
         } catch (Exception e) {
             e.printStackTrace();

Review comment:
       Agree, we should indeed, I will add Stack trace on log.




----------------------------------------------------------------
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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   Packaging result: ✔centos7 ✖centos8 ✔debian. JID-1817


----------------------------------------------------------------
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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


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

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



[GitHub] [cloudstack] davidjumani commented on pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   @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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   Packaging result: ✔centos7 ✖centos8 ✔debian. JID-1836


----------------------------------------------------------------
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] GabrielBrascher commented on a change in pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
##########
@@ -139,7 +139,13 @@ public void execute() {
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
         } catch (Exception e) {
             e.printStackTrace();

Review comment:
       @rhtyd I added a commit with the Stack logged.




----------------------------------------------------------------
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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


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

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



[GitHub] [cloudstack] rhtyd commented on pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   @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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


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

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



[GitHub] [cloudstack] rhtyd commented on pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   @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] rhtyd commented on a change in pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
##########
@@ -139,7 +139,13 @@ public void execute() {
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
         } catch (Exception e) {
             e.printStackTrace();

Review comment:
       Can we log the stack trace? 




----------------------------------------------------------------
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 #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   Packaging result: ✔centos7 ✔centos8 ✔debian. JID-1819


----------------------------------------------------------------
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 merged pull request #4279: Avoid Null pointer at DomainChecker and enhance AssignVMCmd

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


   


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