org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.MMapDirectory@C:\tmp\testdir lockFactory=org.apache.lucene.store.NativeFSLockFactory@6ee00df: files: [write.lock, _0.fdt, _0.fdx]

Apache's JIRA Issue Tracker | Billow Gao | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    1. Start a NEW IndexWriterBuilder on an empty folder, add some documents to the index 2. Call commit 3. When the segments_1 file with 0 byte was created, kill the JVM We will end with a corrupted index with an empty segments_1. We only have issue with the first commit crash. Also, if you tried to open an IndexSearcher on a new index. And the first commit on the index was not finished yet. Then you will see exception like: =========================================================================== org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.MMapDirectory@C:\tmp\testdir lockFactory=org.apache.lucene.store.NativeFSLockFactory@6ee00df: files: [write.lock, _0.fdt, _0.fdx] at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:741) at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:52) at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:65) =========================================================================== So when a new index was created, we should first create an empty index. We should not wait for the commit/close call to create the segment file. If we had an empty index there. It won't leave a corrupted index when there were a power issue on the first commit. And a concurrent IndexSearcher can access to the index(No match is better than exception).

    Apache's JIRA Issue Tracker | 4 years ago | Billow Gao
    org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.MMapDirectory@C:\tmp\testdir lockFactory=org.apache.lucene.store.NativeFSLockFactory@6ee00df: files: [write.lock, _0.fdt, _0.fdx]
  2. 0

    Unable to create core: primary - SolrException - Error opening new searcher

    GitHub | 3 years ago | gowthamgutha
    org.apache.solr.common.SolrException: Error opening new searcher
  3. 0

    Exception in thread "main" org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.SimpleFSDirectory

    Stack Overflow | 4 years ago | user173037
    org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.SimpleFSDirectory@C:\<PATH>lockFactory=org.apache.lucene.store.NativeFSLockFactory@52fe85: files: [write.lock, _0.fdt, _0.fdx, _0.fnm, _0.nvd, _0.nvm, _0.si, _0_Lucene41_0.doc, _0_Lucene41_0.pos, _0_Lucene41_0.tim, _0_Lucene41_0.tip, _1.fdt, _1.fdx, _1.fnm, _1.nvd, _1.nvm, _1.si, _1_Lucene41_0.doc, _1_Lucene41_0.pos, _1_Lucene41_0.tim, _1_Lucene41_0.tip, _2.fdt, _2.fdx, _2.fnm, _2.nvd, _2.nvm, _2.si, _2_Lucene41_0.doc, _2_Lucene41_0.pos, _2_Lucene41_0.tim, _2_Lucene41_0.tip, _3.fdt, _3.fdx, _3.fnm, _3.nvd, _3.nvm, _3.si, _3_Lucene41_0.doc, _3_Lucene41_0.pos, _3_Lucene41_0.tim, _3_Lucene41_0.tip, _4.cfe, _4.cfs, _4.si, _5.cfe, _5.cfs, _5.si, _6.cfe, _6.cfs, _6.si, _7.cfe, _7.cfs, _7.si, _8.fdt, _8.fdx]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Loading a lucene index that was previously written to HDFS into a RamDirectory

    Stack Overflow | 3 years ago | Varun
    org.apache.lucene.index.IndexNotFoundException: no segments* file found in RAMDirectory@1cff1d4a lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@2ddf0c3: files: [/prod/hdfs/LUCENE/index/140601/_0.cfe, /prod/hdfs/LUCENE/index/140601/segments_2, /prod/hdfs/LUCENE/index/140601/_0.si, /prod/hdfs/LUCENE/index/140601/segments.gen, /prod/hdfs/LUCENE/index/140601/_0.cfs]

    3 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.apache.lucene.index.IndexNotFoundException

      no segments* file found in org.apache.lucene.store.MMapDirectory@C:\tmp\testdir lockFactory=org.apache.lucene.store.NativeFSLockFactory@6ee00df: files: [write.lock, _0.fdt, _0.fdx]

      at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run()
    2. Lucene
      DirectoryReader.open
      1. org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:741)
      2. org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:52)
      3. org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:65)
      3 frames