Support Migration Notice: To update migrated JIRA cases click here to open a new case use www.vmware.com/go/sr | vFabric Hyperic 5.7.0 is Now Available

Hyperic HQ

tc Server plugin deployment fails after upgrade due to Foreign Key Constraint violation when removing old server type

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Deferred
  • Affects Version/s: 4.2.0.6
  • Fix Version/s: None
  • Component/s: Plugins
  • Case Links:
    none
  • Regression:
    No

Description

The tc Server plugin has removed server type "SpringSource tc Server" and replaced with "SpringSource tc Runtime". After an upgrade, plugin deployment is failing when trying to remove the old server type due to the Exception below. Looks like this is related to the fact that they also changed their UI plugins to use the new "SpringSource tc Runtime" as an attach point? I'm guessing since product plugin deployment occurs first, the old ui plugin attach points are still present?

See https://issuetracker.springsource.com/browse/TCSRV-1267, specifically the server.log (agent.log stack trace in tkt looks to just be a symptom of this problem)

2010-03-23 08:23:51,793 ERROR [main] [org.hibernate.util.JDBCExceptionReporter@78] Cannot delete or update a parent row: a foreign key constraint fails (`HQ/EAM_UI_ATTACH_RSRC`, CONSTRAINT `FKD9F7A78FFC176AE` FOREIGN KEY (`RESOURCE_ID`) REFERENCES `EAM_RESOURCE` (`ID`))
2010-03-23 08:23:51,797 ERROR [main] [org.hibernate.event.def.AbstractFlushingEventListener@301] Could not synchronize database state with session
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.hyperic.hq.authz.server.session.ResourceDAO.createPrivate(ResourceDAO.java:83)
at org.hyperic.hq.authz.server.session.ResourceDAO.create(ResourceDAO.java:59)
at org.hyperic.hq.authz.server.session.ResourceManagerEJBImpl.createResource(ResourceManagerEJBImpl.java:151)
at sun.reflect.GeneratedMethodAccessor436.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.hyperic.hq.application.HQApp$Snatcher.invokeNextBoth(HQApp.java:572)
at org.hyperic.hq.application.HQApp$Snatcher.invokeNext(HQApp.java:647)
at org.hyperic.txsnatch.TxSnatch.invoke(TxSnatch.java:71)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.hyperic.hq.application.HQApp$Snatcher.invokeNextBoth(HQApp.java:572)
at org.hyperic.hq.application.HQApp$Snatcher.invokeNext(HQApp.java:647)
at org.hyperic.txsnatch.TxSnatch.invoke(TxSnatch.java:71)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy346.createResource(Unknown Source)
at org.hyperic.hq.appdef.server.session.AppdefSessionEJB.createAuthzResource(AppdefSessionEJB.java:158)
at org.hyperic.hq.appdef.server.session.AppdefSessionEJB.createAuthzResource(AppdefSessionEJB.java:139)
at org.hyperic.hq.appdef.server.session.ServerManagerEJBImpl.updateServerTypes(ServerManagerEJBImpl.java:1429)

Activity

Hide
Todd Rader added a comment -

Scott, please evaluate the possible cause(s) of the exception. This one is very time-critical.

Show
Todd Rader added a comment - Scott, please evaluate the possible cause(s) of the exception. This one is very time-critical.
Hide
Todd Rader added a comment -

NOTE: Ryan is also looking at this in the context of what can be done for tcServer, right now. But if the longer-term answer is different, we need to get that sorted out also.

Show
Todd Rader added a comment - NOTE: Ryan is also looking at this in the context of what can be done for tcServer, right now. But if the longer-term answer is different, we need to get that sorted out also.
Hide
Ryan Morgan added a comment -

The issue here is in the way we deploy the plugins. On deployment the hq-plugin.xml gets deployed and then later in the start up process the UI plugins are registered. This dependency is due to fact that UI plugins may want to attach to resources defined during the plugin deployment. (as is the case here).

The problem with this approach is that in the case of a rename, the hq-plugin.xml deployment tries to delete the old server type, which is referenced from EAM_UI_ATTACH_RSRC. I think there are a couple of quick ways we could address this:

1) On the upgrade (in db-upgrade.xml) add a statement that does 'delete from EAM_UI_ATTACH_RSRC'
or
2) Change the code in the areas that delete resource types to ensure that any UI attachpoints are removed.

So on Todds comment above, I'd recommend we:

1) Implement the short term approach in db-upgrade.xml to get the tc Server release unblocked
and
2) Longer term fix the code in Platform/Server/Service managers to account for this case of a UI plugin attachment.

Show
Ryan Morgan added a comment - The issue here is in the way we deploy the plugins. On deployment the hq-plugin.xml gets deployed and then later in the start up process the UI plugins are registered. This dependency is due to fact that UI plugins may want to attach to resources defined during the plugin deployment. (as is the case here). The problem with this approach is that in the case of a rename, the hq-plugin.xml deployment tries to delete the old server type, which is referenced from EAM_UI_ATTACH_RSRC. I think there are a couple of quick ways we could address this: 1) On the upgrade (in db-upgrade.xml) add a statement that does 'delete from EAM_UI_ATTACH_RSRC' or 2) Change the code in the areas that delete resource types to ensure that any UI attachpoints are removed. So on Todds comment above, I'd recommend we: 1) Implement the short term approach in db-upgrade.xml to get the tc Server release unblocked and 2) Longer term fix the code in Platform/Server/Service managers to account for this case of a UI plugin attachment.
Hide
Ryan Morgan added a comment -

Fix for #1 is in. Unfortunately it was a bit more complicated than what I proposed above. Instead of 1 SQL statement, 6 were required to completely remove the old tc server plugin attachments. After the upgrade these attach-points will be re-created pointing to the correct resources.

New Revision: 14417
URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14417

We should test the upgrade on both MySQL and Oracle. (I tested MySQL, Jason tested Postgres).

Leaving this open for now to address #2 from above.

Show
Ryan Morgan added a comment - Fix for #1 is in. Unfortunately it was a bit more complicated than what I proposed above. Instead of 1 SQL statement, 6 were required to completely remove the old tc server plugin attachments. After the upgrade these attach-points will be re-created pointing to the correct resources. New Revision: 14417 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14417 We should test the upgrade on both MySQL and Oracle. (I tested MySQL, Jason tested Postgres). Leaving this open for now to address #2 from above.
Hide
Idan Hod added a comment -

As part of our continuous effort to improve product quality, The Hyperic product team has decided to implement a "zero bug policy" methodology.

Following this methodology, only defects that are planned to be handled in the near future will remain open. Any other defect will be deferred, with the option to be reevaluated if the need arises, or if changes to the Hyperic road-map make such defect a candidate for a fix.

We believe this new process will help create clarity and focus in the Hyperic road-map and ultimately benefit our customer base.

This bug has been deferred as part of the new policy.

We appreciate your cooperation and continues contribution to the improvement of Hyperic.

Show
Idan Hod added a comment - As part of our continuous effort to improve product quality, The Hyperic product team has decided to implement a "zero bug policy" methodology. Following this methodology, only defects that are planned to be handled in the near future will remain open. Any other defect will be deferred, with the option to be reevaluated if the need arises, or if changes to the Hyperic road-map make such defect a candidate for a fix. We believe this new process will help create clarity and focus in the Hyperic road-map and ultimately benefit our customer base. This bug has been deferred as part of the new policy. We appreciate your cooperation and continues contribution to the improvement of Hyperic.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:
    Last comment:
    41 weeks, 1 day ago