# Index corrupt exception

**URL:** <https://discuss.elastic.co/t/index-corrupt-exception/319883>\
**Category:** Elasticsearch\
**Created:** [November 27, 2022, 4:20pm UTC](https://discuss.elastic.co/t/index-corrupt-exception/319883 "2022-11-27T16:20:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JAYALAKSHMI](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@JAYALAKSHMI](https://discuss.elastic.co/u/JAYALAKSHMI)\
**Post date:** [November 27, 2022, 4:20pm UTC](https://discuss.elastic.co/t/index-corrupt-exception/319883/1 "2022-11-27T16:20:35Z")

</div>

Hi,

We are seeing the Filesystem corruption issue. Due to this two shards are not accessible on the cluster. There is no issue from the hardware end and all other shards are accessible and available.

**Error** :

```auto
"store_exception" : {
          "type" : "corrupt_index_exception",
          "reason" : "failed engine (reason: [merge failed]) (resource=preexisting_corruption)",
          "caused_by" : {
            "type" : "i_o_exception",
            "reason" : "failed engine (reason: [merge failed])",
            "caused_by" : {
              "type" : "corrupt_index_exception",
              "reason" : """checksum failed (hardware problem?) : expected=c0axxx actual=540xxx (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/x/x/x/x")))"""
            }
          }
        }

```

While we try to execute the check index command getting the below error

Command:  
java -cp lucene-core\*.jar -ea:org.apache.lucene… org.apache.lucene.index.CheckIndex path

Error:

```auto
ERROR: could not read any segments file in directory
java.lang.IllegalArgumentException: Could not load codec 'Lucene84'. Did you forget to add lucene-backward-codecs.jar?
        at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:449)
        at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:356)
        at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:291)
        at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:522)
        at org.apache.lucene.index.CheckIndex.doCheck(CheckIndex.java:2962)
        at org.apache.lucene.index.CheckIndex.doMain(CheckIndex.java:2860)
        at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:2786)
        Suppressed: org.apache.lucene.index.CorruptIndexException: checksum passed (74xxxxx). possibly transient resource issue, or a Lucene or JVM bug (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/x/x/Segment")))
                at org.apache.lucene.codecs.CodecUtil.checkFooter(CodecUtil.java:466)
                at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:434)
                ... 5 more
Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene84' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classpath supports the following names: [Lucene87]
        at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:116)
        at org.apache.lucene.codecs.Codec.forName(Codec.java:116)
        at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:445)
        ... 6 more

```

Can someone please suggest the next steps

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [November 27, 2022, 4:46pm UTC](https://discuss.elastic.co/t/index-corrupt-exception/319883/2 "2022-11-27T16:46:31Z")

</div>

> [@JAYALAKSHMI](#):
>
> There is no issue from the hardware end

... except for the reported checksum failure, which means the data on disk isn't the data Elasticsearch wrote. Either some other software has changed it or there _is_ a hardware issue. It's rather common for there to be no other symptoms of a hardware issue apart from this kind of checksum failure.

I would suggest replacing the suspect disks and then restoring this index from a recent snapshot.

---

<div class="post-metadata">

**Author:** ![JAYALAKSHMI](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@JAYALAKSHMI](https://discuss.elastic.co/u/JAYALAKSHMI)\
**Post date:** [November 28, 2022, 6:48am UTC](https://discuss.elastic.co/t/index-corrupt-exception/319883/3 "2022-11-28T06:48:33Z")

</div>

Hi David,

Is there a way to delete the corrupted records alone from the index

Thanks,  
Jaya

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [November 28, 2022, 7:43am UTC](https://discuss.elastic.co/t/index-corrupt-exception/319883/4 "2022-11-28T07:43:03Z")

</div>

No, you'll need to restore from a snapshot.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 28, 2022, 7:52am UTC](https://discuss.elastic.co/t/index-corrupt-exception/319883/5 "2022-11-28T07:52:09Z")

</div>

What type of storage are you using?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 26, 2022, 7:52am UTC](https://discuss.elastic.co/t/index-corrupt-exception/319883/6 "2022-12-26T07:52:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
