cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-2525) Object_Store_Refactor - In case of template creation failure , we are not able to remove the tempalte entries. We are not able to delete these templates later.
Date Mon, 20 May 2013 23:25:16 GMT

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

ASF subversion and git services commented on CLOUDSTACK-2525:
-------------------------------------------------------------

Commit 565bdfb27b0e5a151d7acbc6471c676bb1e2ec25 in branch refs/heads/object_store from [~minchen07]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=565bdfb ]

Fix CLOUDSTACK-2525: clean up db entries in vm_template and
template_store_ref in case of template creation failure.
                
> Object_Store_Refactor - In case of template creation failure , we are not able to remove
the tempalte entries. We are not able to delete these templates later.
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-2525
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2525
>             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 master
>            Reporter: Sangeetha Hariharan
>            Assignee: Min Chen
>             Fix For: 4.2.0
>
>
> 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"
> This template is still listed in the UI.
> After this when I attempt to delete this template from the UI , it fails with following
exception:
> "Failed to update statecom.cloud.utils.fsm.NoTransitionException: Unable to transition
to a new state from Allocated via DestroyRequested"
> 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 
> Management server log when trying to delete such a template entry:
> 2013-05-15 14:05:02,402 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-22:job-22)
Executing org.apache.cloudstack.api.command.user.t
> emplate.DeleteTemplateCmd for job-22
> 2013-05-15 14:05:02,404 DEBUG [cloud.api.ApiServlet] (catalina-exec-5:null) ===END===
 10.217.252.128 -- GET  command=deleteTemplate&id=56a
> 68668-1556-4bb3-aab6-30a45734976a&response=json&sessionkey=ib%2Fu45bTvsBcdvb7im6shxTbLHM%3D&_=1368655322571
> 2013-05-15 14:05:02,420 DEBUG [cloud.user.AccountManagerImpl] (Job-Executor-22:job-22)
Access to Tmpl[202-RAW-3c1f36a89-aa83-3ec2-97ae-4d58
> e6cb6de1 granted to Acct[3-sangee] by DomainChecker_EnhancerByCloudStack_9de4226a
> 2013-05-15 14:05:02,425 INFO  [cloud.template.HypervisorTemplateAdapter] (Job-Executor-22:job-22)
Delete template from image store: nfs://1
> 0.223.110.232/export/home/sangeetha/campo-systemp-1/secondary
> 2013-05-15 14:05:02,443 ERROR [cloud.async.AsyncJobManagerImpl] (Job-Executor-22:job-22)
Unexpected exception while executing org.apache.cl
> oudstack.api.command.user.template.DeleteTemplateCmd
> com.cloud.utils.exception.CloudRuntimeException: Failed to update statecom.cloud.utils.fsm.NoTransitionException:
Unable to transition to a
>  new state from Allocated via DestroyRequested
>         at org.apache.cloudstack.storage.image.store.TemplateObject.processEvent(TemplateObject.java:197)
>         at org.apache.cloudstack.storage.image.TemplateServiceImpl.deleteTemplateAsync(TemplateServiceImpl.java:522)
>         at com.cloud.template.HypervisorTemplateAdapter.delete(HypervisorTemplateAdapter.java:253)
>         at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcesso
> r.java:125)
>         at com.cloud.template.TemplateManagerImpl.deleteTemplate(TemplateManagerImpl.java:1108)
>         at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcesso
> r.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:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:679)
> 2013-05-15 14:05:02,444 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-22:job-22)
Complete async job-22, jobStatus: 2, resultCode: 5
> 30, result: Error Code: 530 Error text: Failed to update statecom.cloud.utils.fsm.NoTransitionException:
Unable to transition to a new stat
> e from Allocated via DestroyRequested
> 2013-05-15 14:05:02,595 DEBUG [agent.manager.AgentManagerImpl] (AgentManager-Handler-8:null)
Ping from 3
> 2013-05-15 14:05:05,482 DEBUG [cloud.api.ApiServlet] (catalina-exec-13:null) ===START===
 10.217.252.128 -- GET  command=queryAsyncJobResul
> t&jobId=38879228-2777-45d1-960a-2ccd615886dc&response=json&sessionkey=ib%2Fu45bTvsBcdvb7im6shxTbLHM%3D&_=1368655325809
> 2013-05-15 14:05:05,497 DEBUG [cloud.async.AsyncJobManagerImpl] (catalina-exec-13:null)
Async job-22 completed

--
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

Mime
View raw message