# Compound sub-files must have a valid codec header and footer: file is too small (0 bytes)

**URL:** <https://discuss.elastic.co/t/compound-sub-files-must-have-a-valid-codec-header-and-footer-file-is-too-small-0-bytes/194936>\
**Category:** Elasticsearch\
**Created:** [August 13, 2019, 12:27am UTC](https://discuss.elastic.co/t/compound-sub-files-must-have-a-valid-codec-header-and-footer-file-is-too-small-0-bytes/194936 "2019-08-13T00:27:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![liulinisgood](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@liulinisgood](https://discuss.elastic.co/u/liulinisgood)\
**Post date:** [August 13, 2019, 12:27am UTC](https://discuss.elastic.co/t/compound-sub-files-must-have-a-valid-codec-header-and-footer-file-is-too-small-0-bytes/194936/1 "2019-08-13T00:27:39Z")

</div>

I met a error for a long time, it occurs at 23:10 every day , I am very puzzled. I don't find any period run task .  
ES version: 5.5.3  
os: centos7 3.10.0-327.el7.x86\_64  
disk: ssd  
jdk8, g1

[2019-08-11T23:08:20,178][WARN][o.e.i.e.Engine] [10.32.144.131\_1] [index-2019-08-11][12] failed engine [refresh failed]  
org.apache.lucene.index.CorruptIndexException: Problem reading index from store(mmapfs(/data3/nodes/1/indices/P3GEjUvnSKCnYOf\_giLm7w/12/index)) (resource=store(mmapfs(/data3/nodes/1/indices/P3GEjUvnSKCnYOf\_giLm7w/12/index)))  
at org.apache.lucene.index.SegmentCoreReaders.(SegmentCoreReaders.java:140) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.SegmentReader.(SegmentReader.java:74) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.ReadersAndUpdates.getReader(ReadersAndUpdates.java:145) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.ReadersAndUpdates.getReadOnlyClone(ReadersAndUpdates.java:197) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:103) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:467) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.StandardDirectoryReader.doOpenFromWriter(StandardDirectoryReader.java:291) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:266) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:256) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.FilterDirectoryReader.doOpenIfChanged(FilterDirectoryReader.java:104) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.index.DirectoryReader.openIfChanged(DirectoryReader.java:140) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.search.SearcherManager.refreshIfNeeded(SearcherManager.java:156) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.search.SearcherManager.refreshIfNeeded(SearcherManager.java:58) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.search.ReferenceManager.doMaybeRefresh(ReferenceManager.java:176) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.search.ReferenceManager.maybeRefreshBlocking(ReferenceManager.java:253) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.elasticsearch.index.engine.InternalEngine.refresh(InternalEngine.java:910) [elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.shard.IndexShard.refresh(IndexShard.java:632) [elasticsearch-5.5.3.jar:5.5.3]

I got these error logs above, then shard unassigned, unrecovered. The cluster health was red. I use checkIndex tool to check shard, but result was no problem.

Today I also find another problem in the other node  
Caused by: org.apache.lucene.index.CorruptIndexException: compound sub-files must have a valid codec header and footer: file is too small (0 bytes) (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/data2/nodes/0/indices/pY29xR2URgmcYuuGFhcYcA/1/index/\_p0g.fdx")))  
at org.apache.lucene.codecs.CodecUtil.verifyAndCopyIndexHeader(CodecUtil.java:282) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]  
at org.apache.lucene.codecs.lucene50.Lucene50CompoundFormat.write(Lucene50CompoundFormat.java:96) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46]

These errors make me discouraged with Elasticsearch. Help me.

---

<div class="post-metadata">

**Author:** ![liulinisgood](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@liulinisgood](https://discuss.elastic.co/u/liulinisgood)\
**Post date:** [August 13, 2019, 3:33pm UTC](https://discuss.elastic.co/t/compound-sub-files-must-have-a-valid-codec-header-and-footer-file-is-too-small-0-bytes/194936/2 "2019-08-13T15:33:12Z")

</div>

nobody reply me ,emmm

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 14, 2019, 8:13am UTC](https://discuss.elastic.co/t/compound-sub-files-must-have-a-valid-codec-header-and-footer-file-is-too-small-0-bytes/194936/3 "2019-08-14T08:13:38Z")

</div>

be aware that this a community forum. there is no SLA tied to any post over here. To me it seems rude to bump a post after 3 hours. If you require commercial assistance tied to SLAs, you can purchase such. See [https://www.elastic.co/subscriptions](https://www.elastic.co/subscriptions)

Also, please take a look at the `what other information is useful` section at [https://www.elastic.co/help](https://www.elastic.co/help)

This looks like a data corruption, that may stem from a broken hard disk. However the main question is, what happens every evening at ten past eleven that could trigger this? Are running any cronjob, curator job? Have you ever run out of disk space - a reason that might have left this file with a size of 0.

I am also puzzled if you say this happens every day as the referenced index `index-2019-08-11` seems to be relatively new. Does it happen every day with different indices?

---

<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:** [September 11, 2019, 8:13am UTC](https://discuss.elastic.co/t/compound-sub-files-must-have-a-valid-codec-header-and-footer-file-is-too-small-0-bytes/194936/4 "2019-09-11T08:13:39Z")

</div>

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