Description:
If you do *something which I do not know*, it is possible that when you try to delete a server in the UI, you can end up with the following:
2010-02-04 16:03:39,744 INFO [delete-server-server-01:com.mysql.inventory] Deleting inventory {mysql}.{StatementAnalysisSupport}.{a59af9a1-95ba-4b72-8ef6-b43354974722}
2010-02-04 16:03:40,052 INFO [delete-server-server-01:com.mysql.inventory] Deleting inventory {mysql}.{Server}.{a59af9a1-95ba-4b72-8ef6-b43354974722}
2010-02-04 16:03:40,612 WARN [delete-server-server-01:org.hibernate.util.JDBCExceptionReporter] SQL Error: 1451, SQLState: 23000
2010-02-04 16:03:40,612 ERROR [delete-server-server-01:org.hibernate.util.JDBCExceptionReporter] Cannot delete or update a parent row: a foreign key constraint fails (`mem`.`rule_schedules`, CONSTRAINT `FK317EC739E9BA6AFF` FOREIGN KEY (`instance_id`) REFERENCES `inventory_instances` (`instance_id`))
2010-02-04 16:03:40,620 ERROR [delete-server-server-01:com.mysql.infra.com.mysql.merlin.server.ReportingRunnable] running command com.mysql.etools.monitor.bo.Manager$2
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.mysql.etools.monitor.pom.hib.HibernateExecutor.asTransaction(HibernateExecutor.java:190)
at com.mysql.etools.monitor.pom.hib.SchemaMaintenanceExecutor.asTransaction(SchemaMaintenanceExecutor.java:194)
at com.mysql.etools.monitor.pom.hib.HibPersistence.asTransaction(HibPersistence.java:504)
at com.mysql.etools.monitor.pom.hib.HibPersistence.remove(HibPersistence.java:450)
at com.mysql.etools.monitor.pom.hib.HibInventoryObject.delete(HibInventoryObject.java:669)
at com.mysql.etools.monitor.pom.InvObj.delete(InvObj.java:94)
at com.mysql.etools.monitor.pom.InvObj.deleteHierarchy(InvObj.java:102)
at com.mysql.etools.monitor.bo.Server.deleteInventory(Server.java:927)
at com.mysql.etools.monitor.bo.Manager$2.run(Manager.java:564)
at com.mysql.merlin.server.ReportingRunnable.run(ReportingRunnable.java:65)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`mem`.`rule_schedules`, CONSTRAINT `FK317EC739E9BA6AFF` FOREIGN KEY (`instance_id`) REFERENCES `inventory_instances` (`instance_id`))
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2016)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1452)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 18 more
2010-02-04 16:03:40,628 ERROR [delete-server-server-01:com.mysql.infra.com.mysql.merlin.server.ReportingRunnable] Thu Feb 04 16:03:40 CET 2010 [ FAILED ] Duration: 00:00:02.498 com.mysql.etools.monitor.bo.Manager$2@422f932d
How to repeat:
Focus your computer towards sun spot activity, whilst chanting unintelligibly to the Sun God Ra.
Suggested fix:
Delete with extreme prejudice. :)