[ https://issues.apache.org/jira/browse/CLOUDSTACK-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Min Chen resolved CLOUDSTACK-2578. ---------------------------------- Resolution: Fixed > [Object_Store_Refactor] NPE while deleting template from CS > ----------------------------------------------------------- > > Key: CLOUDSTACK-2578 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2578 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Management Server > Affects Versions: 4.2.0 > Environment: Build from object_store feature branch > Reporter: Sanjeev N > Assignee: Min Chen > Priority: Critical > Fix For: 4.2.0 > > Attachments: management-server.rar > > > NPE while deleting template from CS > Steps to Reproduce: > ================= > 1.Bring up CS in advanced zone with S3 as storage provider > 2.Register a custom template through CS > 3.Delete template registered at step2 > Observations: > ============ > 1.Deleting template failed with NPE: > 2013-05-20 11:10:08,972 DEBUG [cloud.api.ApiServlet] (catalina-exec-15:null) > ===START=== 10.146.0.15 -- GET > command=deleteTemplate&id=62db41de-b5a4-4108-9d9b-091063acef6f&zoneid=b030eb90-53a5-4dda-942d-c7b13b50c54d&response=json&sessionkey=YUyQ2NNnnp%2FGwC0zjw71QxChfHQ%3D&_=1369042897758 > 2013-05-20 11:10:09,046 DEBUG [cloud.async.AsyncJobManagerImpl] > (catalina-exec-15:null) submit async job-15, details: AsyncJobVO {id:15, > userId: 2, accountId: 2, sessionKey: null, instanceType: Template, > instanceId: 203, cmd: > org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd, > cmdOriginator: null, cmdInfo: > {"response":"json","id":"62db41de-b5a4-4108-9d9b-091063acef6f","sessionkey":"YUyQ2NNnnp/GwC0zjw71QxChfHQ\u003d","ctxUserId":"2","zoneid":"b030eb90-53a5-4dda-942d-c7b13b50c54d","httpmethod":"GET","_":"1369042897758","ctxAccountId":"2","ctxStartEventId":"62"}, > cmdVersion: 0, callbackType: 0, callbackAddress: null, status: 0, > processStatus: 0, resultCode: 0, result: null, initMsid: 7332683579487, > completeMsid: null, lastUpdated: null, lastPolled: null, created: null} > 2013-05-20 11:10:09,049 DEBUG [cloud.api.ApiServlet] (catalina-exec-15:null) > ===END=== 10.146.0.15 -- GET > command=deleteTemplate&id=62db41de-b5a4-4108-9d9b-091063acef6f&zoneid=b030eb90-53a5-4dda-942d-c7b13b50c54d&response=json&sessionkey=YUyQ2NNnnp%2FGwC0zjw71QxChfHQ%3D&_=1369042897758 > 2013-05-20 11:10:09,052 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-2:job-15) Executing > org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd for job-15 > 2013-05-20 11:10:09,111 INFO [cloud.template.HypervisorTemplateAdapter] > (Job-Executor-2:job-15) Delete template from image store: > 95a64c8f-2128-4502-b5b4-0d7aa77406d2 > 2013-05-20 11:10:09,166 ERROR [cloud.async.AsyncJobManagerImpl] > (Job-Executor-2:job-15) Unexpected exception while executing > org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd > java.lang.NullPointerException > at > org.apache.cloudstack.storage.datastore.driver.S3ImageStoreDriverImpl.deleteTemplate(S3ImageStoreDriverImpl.java:293) > at > org.apache.cloudstack.storage.datastore.driver.S3ImageStoreDriverImpl.deleteAsync(S3ImageStoreDriverImpl.java:386) > at > org.apache.cloudstack.storage.image.TemplateServiceImpl.deleteTemplateAsync(TemplateServiceImpl.java:529) > at > com.cloud.template.HypervisorTemplateAdapter.delete(HypervisorTemplateAdapter.java:253) > at > com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) > at > com.cloud.template.TemplateManagerImpl.deleteTemplate(TemplateManagerImpl.java:1108) > at > com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) > at > org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd.execute(DeleteTemplateCmd.java:112) > at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:155) > at > com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:437) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) > at java.util.concurrent.FutureTask.run(FutureTask.java:166) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:679) > 2013-05-20 11:10:09,171 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-2:job-15) Complete async job-15, jobStatus: 2, resultCode: 530, > result: Error Code: 530 Error text: null > 2.In vm_template table template state shows as "Destroying" > mysql> select * from vm_template where id=203\G; > *************************** 1. row *************************** > id: 203 > unique_name: 203-2-dd29a628-6f00-378e-8556-6d1c668d3697 > name: cent5.3 > uuid: 62db41de-b5a4-4108-9d9b-091063acef6f > public: 1 > featured: 1 > type: USER > hvm: 1 > bits: 64 > url: http://10.147.28.7/templates/CentOS5.3/CentOS5.3HVM.vhd > format: VHD > created: 2013-05-20 12:28:18 > removed: NULL > account_id: 2 > checksum: NULL > display_text: cent5.3 > enable_password: 0 > enable_sshkey: 0 > guest_os_id: 12 > bootable: 1 > prepopulate: 0 > cross_zones: 1 > extractable: 1 > hypervisor_type: XenServer > source_template_id: NULL > template_tag: NULL > sort_key: 0 > size: 3820110336 > state: Destroying > update_count: 4 > updated: 2013-05-20 15:10:09 > 1 row in set (0.00 sec) > ERROR: > No query specified > 3. template state from template_store_ref: > mysql> select * from template_store_ref where template_id=203\G; > *************************** 1. row *************************** > id: 8 > store_id: 1 > template_id: 203 > created: 2013-05-20 12:28:18 > last_updated: 2013-05-20 12:33:22 > job_id: 2ad91868-fad6-487c-9b3f-a0a4ea223f12 > download_pct: 100 > size: 3820110336 > store_role: Image > physical_size: 3820110336 > download_state: DOWNLOADED > error_str: > local_path: > template/tmpl/2/203/203-2-dd29a628-6f00-378e-8556-6d1c668d3697/CentOS5.3HVM.vhd > install_path: template/tmpl/2/203/203-2-dd29a628-6f00-378e-8556-6d1c668d3697 > url: NULL > state: Destroying > destroyed: 0 > is_copy: 0 > update_count: 4 > updated: 2013-05-20 15:10:09 > *************************** 2. row *************************** > id: 9 > store_id: 2 > template_id: 203 > created: 2013-05-20 14:43:02 > last_updated: NULL > job_id: NULL > download_pct: 100 > size: 3820110336 > store_role: ImageCache > physical_size: 0 > download_state: DOWNLOADED > error_str: NULL > local_path: NULL > install_path: template/tmpl/2/203/1b018d29-809e-45a2-b66d-55c3b81629ac.vhd > url: NULL > state: Ready > destroyed: 0 > is_copy: 0 > update_count: 2 > updated: 2013-05-20 14:45:59 > 2 rows in set (0.00 sec) > ERROR: > No query specified -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira