Getting below error while trying to start the CAS service. The CAS won’t start.

logs at <Endeca-Installation>/CAS/workspace/logs/cas-service.log

2020-01-29 09:00:09,463 ERROR [] [main] com.endeca.itl.bootstrap.CasBootStrapServlet: Failed to initialize CAS: com.endeca.itl.ItlRuntimeException: java.sql.SQLIntegrityConstraintViolationException: integrity constraint violation: unique constraint or index violation; SYS_PK_10030 table: HISTORY_CATALOG

com.endeca.itl.ItlRuntimeException: com.endeca.itl.ItlRuntimeException: java.sql.SQLIntegrityConstraintViolationException: integrity constraint violation: unique constraint or index violation; SYS_PK_10030 table: HISTORY_CATALOG

at com.endeca.itl.service.ServiceHubServlet.loadBus(ServiceHubServlet.java:118)

at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:67)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.endeca.itl.plugin.ThreadContextRunner$1$1.doWork(ThreadContextRunner.java:66)

at com.endeca.itl.plugin.ThreadContextRunner.run(ThreadContextRunner.java:157)

at com.endeca.itl.plugin.ThreadContextRunner$1.invoke(ThreadContextRunner.java:72)

at com.sun.proxy.$Proxy1.init(Unknown Source)

at com.endeca.itl.bootstrap.CasBootStrapServlet.init(CasBootStrapServlet.java:89)

at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)

at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:736)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)

at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)

at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)

at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)

at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

at org.mortbay.jetty.Server.doStart(Server.java:224)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at com.endeca.itl.jetty.Main.main(Main.java:135)

….

….

2020-01-29 09:00:08,261 FATAL [cas] [main] hsqldb.db.HSQLDB69A1A1D959.ENGINE: could not reopen database

org.hsqldb.HsqlException: integrity constraint violation: unique constraint or index violation; SYS_PK_10030 table: HISTORY_CATALOG

at org.hsqldb.error.Error.error(Error.java:134)

at org.hsqldb.Constraint.getException(Constraint.java:872)

at org.hsqldb.index.IndexAVL.insert(IndexAVL.java:730)

at org.hsqldb.persist.RowStoreAVL.indexRow(RowStoreAVL.java:171)

at org.hsqldb.persist.RowStoreAVLDisk.indexRow(RowStoreAVLDisk.java:169)

at org.hsqldb.persist.RowStoreAVLDisk.rollbackRow(RowStoreAVLDisk.java:246)

at org.hsqldb.TransactionManager2PL.rollbackPartial(TransactionManager2PL.java:193)

at org.hsqldb.TransactionManager2PL.rollback(TransactionManager2PL.java:127)

at org.hsqldb.Session.rollback(Session.java:591)

at org.hsqldb.Session.close(Session.java:216)

at org.hsqldb.SessionManager.closeAllSessions(SessionManager.java:202)

Reason-

This can happen when you stop CAS forcefully when it is performing some action like running crawl. It messes up CAS’s locking mechanism

Fix –

  • Go to cas state

cd <Endeca-Installation>/CAS/workspace/state/cas

  • take a backup of db directory

mv db db_bk

  • start Cas service

<Endeca-Installation>/CAS/11.3.0/bin/cas-service.sh

Once CAS starts remvoe the db_bk directory

 

Leave a Reply