[ https://issues.apache.org/jira/browse/CLOUDSTACK-3507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rayees Namathponnan updated CLOUDSTACK-3507: -------------------------------------------- Attachment: CLOUDSTACK-3507 and 3508.rar > [Automation] Failed to clean up account with DB Exception > --------------------------------------------------------- > > Key: CLOUDSTACK-3507 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3507 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Automation, Snapshot > Affects Versions: 4.2.0 > Environment: KVM > Build from 4.2 > Reporter: Rayees Namathponnan > Priority: Blocker > Fix For: 4.2.0 > > Attachments: CLOUDSTACK-3507 and 3508.rar > > > Account cleanup failed during regression automation run, observed below > exception in log > 2013-07-12 11:49:03,191 WARN [cloud.user.AccountManagerImpl] > (AccountChecker-1:null) Failed to cleanup account Acct[318-test-NLZNHA] due to > com.cloud.utils.exception.CloudRuntimeException: DB Exception on: > com.mysql.jdbc.PreparedStatement@541f294: DELETE FROM snapshots WHERE > snapshots.id= 10 > at com.cloud.utils.db.GenericDaoBase.expunge(GenericDaoBase.java:1137) > at > com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) > at > com.cloud.storage.snapshot.SnapshotManagerImpl.deleteSnapshotDirsForAccount(SnapshotManagerImpl.java:682) > at > com.cloud.user.AccountManagerImpl.cleanupAccount(AccountManagerImpl.java:581) > at > com.cloud.user.AccountManagerImpl$AccountCleanupTask.run(AccountManagerImpl.java:1512) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267) > 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 constraint fails > (`cloud`.`snapshot_store_ref`, CONSTRAINT > `fk_snapshot_store_ref__snapshot_id` FOREIGN KEY (`snapshot_id`) REFERENCES > `snapshots` (`id`)) > at sun.reflect.GeneratedConstructorAccessor460.newInstance(Unknown > Source) > 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) > ... 16 more > 2013-07-12 11:49:03,192 INFO [cloud.user.AccountManagerImpl] > (AccountChecker-1:null) Cleanup for account 318 is needed. > 2013-07-12 11:49:03,194 INFO [cloud.user.AccountManagerImpl] > (AccountChecker-1:null) Found 0 disabled accounts to cleanup > 2013-07-12 11:49:03,195 INFO [cloud.user.AccountManagerImpl] > (AccountChecker-1:null) Found 0 inactive domains to cleanup > 2013-07-12 11:49:03,196 INFO [cloud.user.AccountManagerImpl] > (AccountChecker-1:null) Found 0 disabled projects to cleanup > 2013-07-12 11:49:03,198 INFO [cloud.user.AccountManagerImpl] > (AccountChecker-1:null) Found 4 removed accounts to cleanup > 2013-07-12 11:49:03,198 DEBUG [cloud.user.AccountManagerImpl] > (AccountChecker-1:null) Cleaning up 102 -- 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