Environment
Situation
ERROR:
Error: settings.category.contentStatus.err.saving
com.novell.zenworks.datamodel.exceptions.InternalDataModelException: org.hibernate.exception.ConstraintViolationException: ORA-02291: integrity constraint (ZENWORKS.FK_ZACOCONTENTS_CONTENTSERVERS) violated - parent key not found
Resolution
- Run ZENworks Diagnostic Center (ZDC) on the Primary
server
- Gather the exact steps that were used to remove Primary or Satellite server(s) from the zone
- Run the following query on the database and gather the
results:
SELECT * FROM zSystemSetting WHERE Name LIKE 'com.novell.zenworks.content.%'; - Contact Novell Support with the gathered information
Option A
Option B
- Select "Configuration"
- Select "Content"
- Select "Satellite Server Replication"
- Select "New Satellite Servers added to the system will include content in this container by default"
- Select "Apply"
- Select "New Satellite Servers added to the system will exclude content in this container by default"
- Select "Apply"
Additional Information
The replication settings are set to replicate to all Primary servers (except those listed) and the list has a guid that does not match with anything in the zDevice or zZenObject tables, which means there is no device or object matching that guid. This is what causes the exception. So, changing the settings (Workaround Options, Option B), causes the list to clear out the db and allow replication to work.
So, if the error is related to primary servers, change the primary server replication settings, save / apply, and then set it back to the other value and save / apply. If it's satellite, changing the satellite replication settings to the other radio button and save / apply and then set it back and save / apply. This should clear up the issue by removing the orphaned db entry.
22 Jun 2011 14:42:49 Exception occured
com.novell.zenworks.datamodel.exceptions.InternalDataModelException: com.novell.zenworks.datamodel.exceptions.InternalDataModelException: org.hibernate.exception.ConstraintViolationException: could not insert collection: [com.novell.zenworks.datamodel.objects.assignablecontent.AssignableContentObject.ContentServers#2228684c74fe7304ca7e19c83aef687a]
at com.novell.zenworks.datamodel.session.hibernate.HibernateBasicSession._create(HibernateBasicSession.java:1253)
at com.novell.zenworks.datamodel.session.hibernate.HibernateBasicSession.create(HibernateBasicSession.java:97)
at com.novell.zenworks.datamodel.session.hibernate.HibernateAdministratorSession.create(HibernateAdministratorSession.java:1339)
at com.novell.zenworks.datamodel.services.BasicAdminImpl.create(BasicAdminImpl.java:104)
at com.novell.zenworks.datamodel.services.assignablecontent.AssignableContentObjectAdminImpl.create(AssignableContentObjectAdminImpl.java:63)
at com.novell.zenworks.datamodel.services.actions.ActionAdminImpl.create(ActionAdminImpl.java:61)
at com.novell.zenworks.datamodel.services.policies.PolicyAdminImpl.create(PolicyAdminImpl.java:80)
at com.novell.zenworks.admin.pages.policies.wizards.newPolicy.PolicyBean.execute(PolicyBean.java:597)
at com.novell.zenworks.admin.pages.policies.wizards.newPolicy.Controller.onFinish(Controller.java:295)
at com.novell.zenworks.fw.web.layout.WizardController.onWizardEvent(WizardController.java:262)
at com.novell.zenworks.fw.web.internal.layout.Wizard.verifyActionWithController(Wizard.java:693)
at com.novell.zenworks.fw.web.internal.layout.Wizard.finishButton_Click(Wizard.java:448)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.novell.web.controls.WebControl.fireEvent(WebControl.java:1977)
at com.novell.web.controls.WebControl.fireEvent(WebControl.java:1952)
at com.novell.web.controls.Button.raisePostBackEvent(Button.java:475)
at com.novell.web.controls.Page.raisePostBackEvent(Page.java:885)
at com.novell.web.controls.Page.raisePostBackEvents(Page.java:872)
at com.novell.web.controls.Page.internalProcessRequest(Page.java:584)
at com.novell.web.controls.Page.processRequest(Page.java:528)
at com.novell.zenworks.fw.web.internal.layout.Index.processRequest(Index.java:586)
at com.novell.web.internal.controls.PageTag.doEndTag(PageTag.java:86)
at org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:178)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:364)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at com.novell.web.NJWCServlet.serviceImpl(NJWCServlet.java:97)
at com.novell.zenworks.fw.web.internal.ZENworksServlet.service(ZENworksServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.patchlink.sapphire.web.pages.vulnerability.session.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at com.novell.zenworks.tomcat.ZENRequestValve.invoke(ZENRequestValve.java:1196)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.novell.zenworks.datamodel.exceptions.InternalDataModelException: org.hibernate.exception.ConstraintViolationException: could not insert collection: [com.novell.zenworks.datamodel.objects.assignablecontent.AssignableContentObject.ContentServers#2228684c74fe7304ca7e19c83aef687a]
at com.novell.zenworks.datamodel.database.AbstractDatabaseTypeHelper.newStandardDataModelException(AbstractDatabaseTypeHelper.java:436)
at com.novell.zenworks.datamodel.database.AbstractDatabaseTypeHelper.throwStandardDataModelException(AbstractDatabaseTypeHelper.java:421)
at com.novell.zenworks.datamodel.session.hibernate.AbstractHibernateSessionImpl.handleException(AbstractHibernateSessionImpl.java:177)
at com.novell.zenworks.datamodel.session.hibernate.AbstractHibernateSessionImpl.simpleSave(AbstractHibernateSessionImpl.java:356)
at com.novell.zenworks.datamodel.session.hibernate.HibernateBasicSession._create(HibernateBasicSession.java:1243)
... 59 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert collection: [com.novell.zenworks.datamodel.objects.assignablecontent.AssignableContentObject.ContentServers#2228684c74fe7304ca7e19c83aef687a]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1058)
at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:26)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:988)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:337)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.novell.zenworks.datamodel.session.hibernate.HibernateTransactionImpl._commit(HibernateTransactionImpl.java:42)
at com.novell.zenworks.datamodel.session.hibernate.AbstractHibernateTransactionImpl.commit(AbstractHibernateTransactionImpl.java:46)
at com.novell.zenworks.datamodel.session.hibernate.AbstractHibernateSessionImpl.simpleSave(AbstractHibernateSessionImpl.java:345)
... 60 more
Caused by: java.sql.SQLException: The INSERT statement conflicted with the FOREIGN KEY constraint "fk_zACOContentS_ContentServers". The conflict occurred in database "Zenworks", table "dbo.zDevice", column 'ZUID'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:525)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:487)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:421)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1039)
... 72 more