[ https://issues.apache.org/jira/browse/CLOUDSTACK-2481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13719804#comment-13719804 ]
ASF subversion and git services commented on CLOUDSTACK-2481: ------------------------------------------------------------- Commit f350e34574de2b2dfd0943de148cfb7af887b8ae in branch refs/heads/4.2 from [~edison] [ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=f350e34 ] CLOUDSTACK-2481: the wait is in seconds in copycommand > Object_Store_Refactor - Templates - Not able to create a template from > snapshot. > -------------------------------------------------------------------------------- > > Key: CLOUDSTACK-2481 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2481 > 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 > Reporter: Sangeetha Hariharan > Assignee: edison su > Priority: Critical > Fix For: 4.2.0 > > Attachments: cloud.dmp, management-server.rar > > > Steps to reproduce the problem: > Deploy a VM. > Take a snapshot of the root volume. > Create a template from this snapshot. > API fails with following error message: > "DB Exception on: com.mysql.jdbc.JDBC4PreparedStatement@bb917d1: DELETE FROM > vm_template WHERE vm_template.id= 203" > Management server logs: > 2013-05-14 09:32:33,964 DEBUG [cloud.api.ApiServlet] (catalina-exec-3:null) > ===START=== 10.217.252.128 -- GET command=createTemplate&response=json > &sessionkey=X%2FK09rgZ%2BYIUuGYkv7UGa0FoBEc%3D&snapshotid=d44ae73f-3cbd-49d3-8964-6c3325c24286&name=template1&displayText=template1&osTypeId=fce76ff > 6-bc28-11e2-8a23-6a01c7e420f0&isPublic=true&passwordEnabled=false&_=1368552572710 > 2013-05-14 09:32:34,059 DEBUG [cloud.template.TemplateManagerImpl] > (catalina-exec-3:null) This template is getting created from other template, > sett > ing source template Id to: 202 > 2013-05-14 09:32:34,118 DEBUG [cloud.async.AsyncJobManagerImpl] > (catalina-exec-3:null) submit async job-18, details: AsyncJobVO {id:18, > userId: 2, a > ccountId: 2, sessionKey: null, instanceType: Template, instanceId: 203, cmd: > org.apache.cloudstack.api.command.user.template.CreateTemplateCmd, cmdO > riginator: null, cmdInfo: > {"sessionkey":"X/K09rgZ+YIUuGYkv7UGa0FoBEc\u003d","ctxUserId":"2","httpmethod":"GET","osTypeId":"fce76ff6-bc28-11e2-8a23-6 > a01c7e420f0","isPublic":"true","response":"json","id":"203","displayText":"template1","snapshotid":"d44ae73f-3cbd-49d3-8964-6c3325c24286","passwordE > nabled":"false","name":"template1","_":"1368552572710","ctxAccountId":"2","ctxStartEventId":"61"}, > cmdVersion: 0, callbackType: 0, callbackAddress: > null, status: 0, processStatus: 0, resultCode: 0, result: null, initMsid: > 206915885079359, completeMsid: null, lastUpdated: null, lastPolled: null, > created: null} > 2013-05-14 09:32:34,119 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-20:job-18) Executing > org.apache.cloudstack.api.command.user.template.C > reateTemplateCmd for job-18 > 2013-05-14 09:32:34,122 DEBUG [cloud.api.ApiServlet] (catalina-exec-3:null) > ===END=== 10.217.252.128 -- GET command=createTemplate&response=json&s > essionkey=X%2FK09rgZ%2BYIUuGYkv7UGa0FoBEc%3D&snapshotid=d44ae73f-3cbd-49d3-8964-6c3325c24286&name=template1&displayText=template1&osTypeId=fce76ff6- > bc28-11e2-8a23-6a01c7e420f0&isPublic=true&passwordEnabled=false&_=1368552572710 > 2013-05-14 09:32:34,207 DEBUG [agent.transport.Request] > (Job-Executor-20:job-18) Seq 3-178062289: Sending { Cmd , MgmtId: > 206915885079359, via: 3, > Ver: v1, Flags: 100111, > [{"org.apache.cloudstack.storage.command.CopyCommand":{"srcTO":{"org.apache.cloudstack.storage.to.SnapshotObjectTO":{"path": > "snapshots/2/1/29d8dd25-c221-4bbc-bc8b-b89d37e362de","volume":{"uuid":"5d0bd6d7-4ebe-4fb6-98ad-5df52850e739","volumeType":"ROOT","dataStore":{"org.a > pache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"e97b5727-d157-3dc1-b32c-065b99806623","id":1,"poolType":"NetworkFilesystem","host":"10.223. > 110.232","path":"/export/home/sangeetha/campo-systemp-1/primary","port":2049}},"name":"ROOT-5","size":8589934592,"path":"86b8d3a8-44c9-4bb0-b4fb-1ba > 98d3e4f75","volumeId":5,"vmName":"i-2-5-VM","accountId":2,"id":5},"dataStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"nfs://10.223.110.232/export/h > ome/sangeetha/campo-systemp-1/secondary","_role":"Image"}},"vmName":"i-2-5-VM","name":"test-2_ROOT-5_20130514161859","hypervisorType":"XenServer","i > d":1}},"destTO":{"org.apache.cloudstack.storage.to.TemplateObjectTO":{"path":"template/tmpl/2/203","uuid":"7f10ae7a-0e78-40ed-9b51-3a6a23c9dc66","id > ":203,"format":"RAW","accountId":2,"hvm":true,"displayText":"template1","imageDataStore":{"com.cloud.agent.api.to.NfsTO":{"_url":"nfs://10.223.110.2 > 32/export/home/sangeetha/campo-systemp-1/secondary","_role":"Image"}},"name":"25860e266-0bd4-3eab-abe5-190cd2cafb8b"}},"wait":10800}}] > } > 2013-05-14 09:32:37,151 DEBUG [cloud.api.ApiServlet] (catalina-exec-18:null) > ===START=== 10.217.252.128 -- GET command=queryAsyncJobResult&jobId=8 > 21ce4f1-c8a8-42ce-a095-70144886b536&response=json&sessionkey=X%2FK09rgZ%2BYIUuGYkv7UGa0FoBEc%3D&_=1368552575986 > 2013-05-14 09:32:37,203 DEBUG [cloud.api.ApiServlet] (catalina-exec-18:null) > ===END=== 10.217.252.128 -- GET command=queryAsyncJobResult&jobId=821 > ce4f1-c8a8-42ce-a095-70144886b536&response=json&sessionkey=X%2FK09rgZ%2BYIUuGYkv7UGa0FoBEc%3D&_=1368552575986 > 2013-05-14 09:32:38,145 DEBUG [cloud.server.StatsCollector] > (StatsCollector-1:null) VmStatsCollector is running... > 2013-05-14 09:32:38,161 DEBUG [agent.manager.DirectAgentAttache] > (DirectAgent-329:null) Seq 1-738331920: Executing request > 2013-05-14 09:32:38,400 DEBUG [xen.resource.CitrixResourceBase] > (DirectAgent-329:null) Vm cpu utilization 0.0010937499999999999 > 2013-05-14 09:32:38,400 DEBUG [xen.resource.CitrixResourceBase] > (DirectAgent-329:null) Vm cpu utilization 0.00125 > 2013-05-14 09:32:38,400 DEBUG [agent.manager.DirectAgentAttache] > (DirectAgent-329:null) Seq 1-738331920: Response Received: > 2013-05-14 09:32:38,400 DEBUG [agent.transport.Request] > (StatsCollector-1:null) Seq 1-738331920: Received: { Ans: , MgmtId: > 206915885079359, via: 1 > , Ver: v1, Flags: 10, { GetVmStatsAnswer } } > 2013-05-14 09:32:39,181 DEBUG [agent.manager.DirectAgentAttache] > (DirectAgent-111:null) Ping from 1 > 2013-05-14 09:32:39,549 DEBUG [agent.transport.Request] > (AgentManager-Handler-5:null) Seq 3-178062289: Processing: { Ans: , MgmtId: > 206915885079359 > , via: 3, Ver: v1, Flags: 110, > [{"org.apache.cloudstack.storage.command.CopyCmdAnswer":{"result":false,"details":"java.io.FileNotFoundException: > /mn > t/SecStorage/6cbcf976-4416-3c80-8c9e-319590e1d160/template/tmpl/2/203/template.properties > (No such file or directory)","wait":0}}] } > 2013-05-14 09:32:39,549 DEBUG [agent.manager.AgentAttache] > (AgentManager-Handler-5:null) Seq 3-178062289: No more commands found > 2013-05-14 09:32:39,549 DEBUG [agent.transport.Request] > (Job-Executor-20:job-18) Seq 3-178062289: Received: { Ans: , MgmtId: > 206915885079359, via: > 3, Ver: v1, Flags: 110, { CopyCmdAnswer } } > 2013-05-14 09:32:39,609 DEBUG [cloud.template.TemplateManagerImpl] > (Job-Executor-20:job-18) Failed to create > templatejava.io.FileNotFoundException: > /mnt/SecStorage/6cbcf976-4416-3c80-8c9e-319590e1d160/template/tmpl/2/203/template.properties > (No such file or directory) > 2013-05-14 09:32:39,615 DEBUG [db.Transaction.Transaction] > (Job-Executor-20:job-18) Rolling back the transaction: Time = 4 Name = > -AsyncJobManagerI > mpl$1.run:401-Executors$RunnableAdapter.call:471-FutureTask$Sync.innerRun:334-FutureTask.run:166-ThreadPoolExecutor.runWorker:1110-ThreadPoolExecuto > r$Worker.run:603-Thread.run:679; called by > -Transaction.rollback:890-Transaction.removeUpTo:833-Transaction.close:657-TransactionContextBuilder.inte > rceptException:63-ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept:133-TemplateManagerImpl.createPrivateTemplate:1424-ComponentIn > stantiationPostProcessor$InterceptorDispatcher.intercept:125-CreateTemplateCmd.execute:258-ApiDispatcher.dispatch:155-AsyncJobManagerImpl$1.run:437- > Executors$RunnableAdapter.call:471-FutureTask$Sync.innerRun:334 > 2013-05-14 09:32:39,636 ERROR [cloud.async.AsyncJobManagerImpl] > (Job-Executor-20:job-18) Unexpected exception while executing > org.apache.cloudstack. > api.command.user.template.CreateTemplateCmd > com.cloud.utils.exception.CloudRuntimeException: DB Exception on: > com.mysql.jdbc.JDBC4PreparedStatement@bb917d1: DELETE FROM vm_template WHERE > vm_te > mplate.id= 203 > at com.cloud.utils.db.GenericDaoBase.expunge(GenericDaoBase.java:1137) > at > com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:12 > 5) > at > com.cloud.template.TemplateManagerImpl.createPrivateTemplate(TemplateManagerImpl.java:1424) > at > com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:12 > 5) > at > org.apache.cloudstack.api.command.user.template.CreateTemplateCmd.execute(CreateTemplateCmd.java:258) > 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:1110) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:679) > Caused by: > com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: > Cannot delete or update a parent row: a foreign key constrain > t fails (`cloud`.`template_store_ref`, CONSTRAINT > `fk_template_store_ref__template_id` FOREIGN KEY (`template_id`) REFERENCES > `vm_template` (`id`)) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at java.lang.reflect.Constructor.newInstance(Constructor.java:532) > at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) > at com.mysql.jdbc.Util.getInstance(Util.java:386) > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040) > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074) > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629) > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719) > at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155) > at > com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2450) > at > com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2371) > at > com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2355) > at > org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) > at > org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) > at com.cloud.utils.db.GenericDaoBase.expunge(GenericDaoBase.java:1128) > ... 20 more > 2013-05-14 09:32:39,637 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-20:job-18) Complete async job-18, jobStatus: 2, resultCode: > 530, resul > t: Error Code: 530 Error text: DB Exception on: > com.mysql.jdbc.JDBC4PreparedStatement@bb917d1: DELETE FROM vm_template WHERE > vm_template.id= 203 -- 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