Bug 847652

Summary: NPE when deleting a template from export domain
Product: Red Hat Enterprise Virtualization Manager Reporter: Asaf Shakarchi <asaf>
Component: ovirt-engineAssignee: Gilad Chaplik <gchaplik>
Status: CLOSED CURRENTRELEASE QA Contact: Dafna Ron <dron>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: abaron, amureini, dfediuck, dyasny, ecohen, gchaplik, hateya, iheim, lnatapov, lpeer, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: SI17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Asaf Shakarchi 2012-08-13 08:49:03 UTC
Description of problem:
A NPE occurs when trying to delete a template from export domain.
---
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: java.lang.NullPointerException
	at org.ovirt.engine.core.bll.RemoveVmTemplateCommand.<init>(RemoveVmTemplateCommand.java:42) [engine-bll.jar:]
	at org.ovirt.engine.core.bll.RemoveVmTemplateFromImportExportCommand.<init>(RemoveVmTemplateFromImportExportCommand.java:42) [engine-bll.jar:]
	... 58 more



Version-Release number of selected component (if applicable):
si13.2

How reproducible:
Delete a template from export domain.

Steps to Reproduce:
1. Export a template
2. Delete the exported template from Storage tab->'Template Import' sub tab
  
Actual results:
NPE in backend log while task execution repeats over and over again.

Expected results:
A clean delete of the template.

Additional info:

Comment 1 Ayal Baron 2012-08-15 08:55:57 UTC
Asaf, does this *always* happen?
Do you know what the issue is?

Comment 2 Allon Mureinik 2012-08-27 09:52:46 UTC
Seems like this was introduced in I62ab5130 with the line "setStoragePoolId(getVmTemplate().getstorage_pool_id())" in RemoveVmTemplateCommand's ctor.

extracting this to a lazy getter or an init method should do the trick.

Comment 3 Gilad Chaplik 2012-08-27 14:36:40 UTC
A simple Null check will do the trick.

Comment 4 Gilad Chaplik 2012-08-28 07:32:16 UTC
pushed to gerrit (http://gerrit.ovirt.org/#/c/7523/)

Comment 9 Dafna Ron 2012-09-05 12:14:45 UTC
verified on si17