cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alena Prokharchyk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-7210) [Automation] VM Operations failed due to CloudRuntimeException/DB Exception
Date Fri, 01 Aug 2014 17:05:39 GMT

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

Alena Prokharchyk commented on CLOUDSTACK-7210:
-----------------------------------------------

The problem happens because we have 2 duplicated constraints on async_job_join_map table,
and the second one doesn't have the "ON DELETE CASCADE" set, meaning that the parent row can't
be removed until all dependencies are cleaned up.

CONSTRAINT `fk_async_job_join_map__job_id` FOREIGN KEY (`job_id`) REFERENCES `async_job` (`id`)
ON DELETE CASCADE,
  CONSTRAINT `fk_async_job_join_map__join_job_id` FOREIGN KEY (`join_job_id`) REFERENCES `async_job`
(`id`)


Solution: remove the second constraint as it duplicates the first one. Leave the constraint
where ON DELETE CASCADE is specified.

> [Automation] VM Operations failed due to CloudRuntimeException/DB Exception
> ---------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-7210
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7210
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.5.0
>         Environment: CI
>            Reporter: Raja Pullela
>            Assignee: Alena Prokharchyk
>            Priority: Critical
>
> Following SQL exception was seen in the mgmt server log.  
> 02:27:49,102 DEBUG [c.c.u.d.T.Transaction] (Vm-Operations-Cleanup-1:ctx-237bef21) Rolling
back the transaction: Time = 19 Name =  Vm-Operations-Cleanup-1; called by -TransactionLegacy.rollback:902-TransactionLegacy.removeUpTo:845-TransactionLegacy.close:669-TransactionContextInterceptor.invoke:36-ReflectiveMethodInvocation.proceed:161-ExposeInvocationInterceptor.invoke:91-ReflectiveMethodInvocation.proceed:172-JdkDynamicAopProxy.invoke:204-$Proxy184.expungeCompletedWorkJobs:-1-VirtualMachineManagerImpl$CleanupTask.runInContext:2389-ManagedContextRunnable$1.run:49-DefaultManagedContext$1.call:56
> 2014-07-28 02:27:49,105 ERROR [c.c.v.VirtualMachineManagerImpl] (Vm-Operations-Cleanup-1:ctx-237bef21)
VM Operations failed due to 
> com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.jdbc.JDBC4PreparedStatement@31c304ae:
DELETE FROM async_job WHERE async_job.id= 318
> 	at com.cloud.utils.db.GenericDaoBase.expunge(GenericDaoBase.java:1178)
> 	at org.apache.cloudstack.framework.jobs.dao.VmWorkJobDaoImpl.expungeCompletedWorkJobs(VmWorkJobDaoImpl.java:149)
> 	at sun.reflect.GeneratedMethodAccessor555.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> 	at com.cloud.utils.db.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:34)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
> 	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> 	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> 	at com.sun.proxy.$Proxy184.expungeCompletedWorkJobs(Unknown Source)
> 	at com.cloud.vm.VirtualMachineManagerImpl$CleanupTask.runInContext(VirtualMachineManagerImpl.java:2389)
> 	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
> 	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
> 	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
> 	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
> 	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> 	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:744)
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot delete or update a parent row: a foreign key constraint fails (`cloud`.`async_job_join_map`,
CONSTRAINT `fk_async_job_join_map__join_job_id` FOREIGN KEY (`join_job_id`) REFERENCES `async_job`
(`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:526)
> 	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:1169)
> 	... 26 more
> 2014-07-28 02:27:49,118 DEBUG [o.a.c.f.j.i.SyncQueueManagerImpl] (Work-Job-Executor-114:ctx-218b824a
job-317/job-318) Sync queue (114) is currently empty
> 2014-07-28 02:27:49,118 INFO  [o.a.c.f.j.i.AsyncJobMonitor] (Work-Job-Executor-114:ctx-218b824a
job-317/job-318) Remove job-318 from job monitoring
> 2014-07-28 02:27:49,125 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-46:ctx-b27d1243
job-317 ctx-def49fc2) Complete async job-317, jobStatus: SUCCEEDED, resultCode: 0, result:
org.apache.cloudstack.api.response.UserVmResponse/virtualmachine/{"id":"bdcd30f2-c7ef-4439-b5d7-042ddfca726c","name":"VM-bdcd30f2-c7ef-4439-b5d



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message