Appdev start failed due to CorruptIndexException

Appdev start failed due to CorruptIndexException

book

Article ID: KB0079669

calendar_today

Updated On:

Products Versions
TIBCO BPM Enterprise (formerly TIBCO ActiveMatrix BPM) 4.0.0, 4.1.0, 4.2.0

Description

The following lines in the logs refer to checksum mismatch in segments file.
  org.apache.lucene.index.CorruptIndexException: checksum mismatch in segments file (resource: ChecksumIndexInput(segments_3))
  
=======

:: Appdev Repo-Home :: C:\ProgramData\BPM41\tibco\data\tibcohost\Admin-AMX BPM-AMX BPM Server\data_3.2.x\nodes\BPMNode\work\cf\246f4f1f-785f-4dce-834e-74d26794e4b0\work\apaRepHome
23:30:25.083 INFO [ComponentFrameworkDelegate] c.t.c.u.engine.UpgradeUtil              : Connecting to Repository
23:30:26.272 ERROR [ComponentFrameworkDelegate] o.a.j.core.RepositoryImpl               : Failed to initialize workspace 'default'
javax.jcr.RepositoryException: Unable to initialize query handler: org.apache.jackrabbit.core.query.lucene.SearchIndex@3bfd36b1
Caused by: org.apache.lucene.index.CorruptIndexException: checksum mismatch in segments file (resource: ChecksumIndexInput(segments_3))
    at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:335) ~[lucene-core-3.6.0.jar:3.6.0 1310449 - rmuir - 2012-04-06 11:31:16]
23:30:26.278 ERROR [ComponentFrameworkDelegate] o.a.j.core.RepositoryImpl               : Unable to start repository, forcing shutdown...
23:30:26.289 ERROR [ComponentFrameworkDelegate] o.a.j.core.RepositoryImpl               : failed to start Repository: Unable to initialize query handler: org.apache.jackrabbit.core.query.lucene.SearchIndex@3bfd36b1
javax.jcr.RepositoryException: Unable to initialize query handler: org.apache.jackrabbit.core.query.lucene.SearchIndex@3bfd36b1
Caused by: org.apache.lucene.index.CorruptIndexException: checksum mismatch in segments file (resource: ChecksumIndexInput(segments_3))
    at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:335) ~[lucene-core-3.6.0.jar:3.6.0 1310449 - rmuir - 2012-04-06 11:31:16]
23:30:26.294 WARN [ComponentFrameworkDelegate] c.t.c.u.engine.UpgradeUtil              : Error Performing upgrade, please fix the problem and retry..
javax.jcr.RepositoryException: Unable to initialize query handler: org.apache.jackrabbit.core.query.lucene.SearchIndex@3bfd36b1
Caused by: org.apache.lucene.index.CorruptIndexException: checksum mismatch in segments file (resource: ChecksumIndexInput(segments_3))
    at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:335)
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : **************************************************************
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : *                                                            *
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : *                 SERIOUS ERROR.. EXITING..                  *
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : *         CANNOT CONNECT TO THE JCR SYSTEM (DATABASE)        *
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : *                                                            *
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : * HAVE YOU CREATED THE DATABASE/CAN YOU ACCESS THE DATABASE? *
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : *                                                            *
23:30:26.647 WARN [ComponentFrameworkDelegate] c.t.r.c.RepositoryComponent             : **************************************************************
23:30:26.798 INFO [ComponentFrameworkDelegate] c.t.c.w.j.r.JCSController               : Cache shutdown..

========
 

Issue/Introduction

Due to improper node restart, the appdev component file system index can get corrupted

Environment

All

Resolution

Remove the specific corrupted index (segments_3 in the above example) from file system after taking a back up. Restart the appdev component using AMX Administrator.

The index will be located in the apaRepHome under repository/index. Here is an example - CONFIG_HOME\tibcohost\Admin-AMX BPM-AMX BPM Server\data_3.2.x\nodes\BPMNode\work\cf\246f4f1f-785f-4dce-834e-74d26794e4b0\work\apaRepHome

Please note the indexes can vary depending on the environment, please look into the exception and remove the corresponding index based on it. Here the corrupted segment is 3, so mostly the index folder to be searched would be _3.

example :-
CONFIG_HOME\tibcohost\Admin-AMX BPM-AMX BPM Server\data_3.2.x\nodes\BPMNode\work\cf\246f4f1f-785f-4dce-834e-74d26794e4b0\work\apaRepHome\repository\index\_3 >  dir
_0.cfs
cache.inSegmentParents
segments_1
segments_2
segments_3
segments.gen

The deleted index folder (index\_3) will be rebuilt when starting the appdev component. 

Note : Each segment is a fully independent index, which could be searched separately, for more details about lucene indexing refer here :-
https://lucene.apache.org/core/3_0_3/fileformats.html. The corrupted segments thrown in the exception sometimes will not be there or it will be returned in multiple folder, in such cases the parent index folder (/index) can be deleted. The index will get recreated on a restart.

Additional Information

CorruptIndexException, lucene, appdev