[ https://issues.apache.org/jira/browse/CLOUDSTACK-4003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13731202#comment-13731202 ]
Min Chen commented on CLOUDSTACK-4003: -------------------------------------- This bug happens after failure to create a volume from the same snapshot. Due to create volume failure, we incorrectly removed that snapshot entry from snapshot_store_ref, causing this NPE. > [Upgrade][2.2.16 to 4.2] After upgrade creation of template from a snapshot > which was existing before upgrade, fails with NPE > ----------------------------------------------------------------------------------------------------------------------------- > > Key: CLOUDSTACK-4003 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4003 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Snapshot, Storage Controller, Upgrade > Affects Versions: 4.2.0 > Environment: upgraded environment from 2.2.16 to 4.2 > Hypervisor : XEN 6.0.2 > Reporter: Abhinav Roy > Assignee: Min Chen > Priority: Critical > Fix For: 4.2.0 > > Attachments: CS4003.zip, DB_DUMP_2216_cloud-31jul.sql, > DB_DUMP_420_cloud-1Aug.sql, management-server.log > > > Steps : > ==================== > 1. Deploy CS advanced zone setup with Xen 6.0.2 hypervisor > 2. Create VMs. v1, v2 > 3. Create snapshots on the ROOT volumes of the VMs created in step2 , s1,s2 > 4. Upgrade CS to 4.2 > 5. Now try to create templates from snapshots s1/s2 > Expected behaviour : > =================== > Creation of templates should be successful. > Observed behaviour : > =================== > 1. The template creation fails with NPE > 2013-08-01 13:24:23,936 DEBUG [cloud.api.ApiServlet] (catalina-exec-14:null) > ===END=== 10.144.7.7 -- GET > command=createTemplate&response=json&sessionkey=e6y2vkO969W8moD6GKiQkvMwjA8%3D&snapshotid=2&name=Temp+au+snapshot+root5&displayText=Temp+au+snapshot+root5&osTypeId=12&isPublic=false&passwordEnabled=false&isdynamicallyscalable=false&_=1375343454027 > 2013-08-01 13:24:23,943 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-13:job-38 = [ 830dd460-ea5c-47bd-bd30-764b0600dfac ]) Executing > org.apache.cloudstack.api.command.user.template.CreateTemplateCmd for job-38 > = [ 830dd460-ea5c-47bd-bd30-764b0600dfac ] > 2013-08-01 13:24:23,985 DEBUG [agent.manager.AgentManagerImpl] > (AgentManager-Handler-6:null) SeqA 4-10107: Processing Seq 4-10107: { Cmd , > MgmtId: -1, via: 4, Ver: v1, Flags: 11, > [{"com.cloud.agent.api.ConsoleProxyLoadReportCommand":{"_proxyVmId":2,"_loadInfo":"{\n > \"connections\": []\n}","wait":0}}] } > 2013-08-01 13:24:23,994 DEBUG [agent.manager.AgentManagerImpl] > (AgentManager-Handler-6:null) SeqA 4-10107: Sending Seq 4-10107: { Ans: , > MgmtId: 226870599129537, via: 4, Ver: v1, Flags: 100010, > [{"com.cloud.agent.api.AgentControlAnswer":{"result":true,"wait":0}}] } > 2013-08-01 13:24:24,017 DEBUG [storage.image.TemplateDataFactoryImpl] > (Job-Executor-13:job-38 = [ 830dd460-ea5c-47bd-bd30-764b0600dfac ]) template > 210 is already in store:2, type:Image > 2013-08-01 13:24:24,048 ERROR [cloud.async.AsyncJobManagerImpl] > (Job-Executor-13:job-38 = [ 830dd460-ea5c-47bd-bd30-764b0600dfac ]) > Unexpected exception while executing > org.apache.cloudstack.api.command.user.template.CreateTemplateCmd > java.lang.NullPointerException > at > org.apache.cloudstack.storage.motion.DataMotionServiceImpl.copyAsync(DataMotionServiceImpl.java:45) > at > org.apache.cloudstack.storage.image.TemplateServiceImpl.copyAsync(TemplateServiceImpl.java:549) > at > org.apache.cloudstack.storage.image.TemplateServiceImpl.createTemplateFromSnapshotAsync(TemplateServiceImpl.java:556) > at > com.cloud.template.TemplateManagerImpl.createPrivateTemplate(TemplateManagerImpl.java:1358) > at > com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) > at > org.apache.cloudstack.api.command.user.template.CreateTemplateCmd.execute(CreateTemplateCmd.java:263) > at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:158) > at > com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:531) > 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:1110) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:636) > 2013-08-01 13:24:24,050 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-13:job-38 = [ 830dd460-ea5c-47bd-bd30-764b0600dfac ]) Complete > async job-38 = [ 830dd460-ea5c-47bd-bd30-764b0600dfac ], jobStatus: 2, > resultCode: 530, result: Error Code: 530 Error text: null > 2013-08-01 13:24:26,999 DEBUG [cloud.api.ApiServlet] (catalina-exec-21:null) > ===START=== 10.144.7.7 -- GET command=queryAsyncJo -- 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