You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Rohit Yadav (JIRA)" <ji...@apache.org> on 2014/09/02 15:56:21 UTC

[jira] [Commented] (CLOUDSTACK-6945) Null pointer exception when starting a VM that had its template deleted

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-6945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14118218#comment-14118218 ] 

Rohit Yadav commented on CLOUDSTACK-6945:
-----------------------------------------

This is the corner case when the template has been removed and ACS throws NPE as template is null. The fix would be to check template and if it's null we throw resource not available exception;
https://reviews.apache.org/r/25248/

I was not sure what else could break, so submitted it as a review

> Null pointer exception when starting a VM that had its template deleted
> -----------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-6945
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6945
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.3.0
>         Environment: Hosts are Debian 7.4.0 with Xen hypervisor e Xen Cloud Platform packages installed and properly configured.
>            Reporter: Rafael Weingartner
>            Assignee: Rohit Yadav
>            Priority: Minor
>             Fix For: 4.3.1
>
>
> It seems that you have a bug in CS 4.3.0(and probably previous versions?) when starting a machine that was created from a template that has been deleted.
> There will happen a null pointer exception in "com.cloud.vm.VirtualMachineManagerImpl.orchestrateStart":
> “858 -        if (volTemplateId != null && volTemplateId.longValue() != template.getId())”
> The object, “template” is going to be null, because in:
> “811 -  VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId());”
> The findById, will add a where clause, looking for template that have the column removed that is null, therefore It will return a null object.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)