Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-411

LuceneSearchProvider dies with corrupted files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.4
    • 2.8.1
    • Plugins
    • None
    • LuceneSearchProvider and ReadableAttachmentProvider (

    Description

      If someone uploads a corrupted files(i.e. 0-Byte or non readable pdf-content) the lucene index crashes. Even with a new full reindex the lucene indexer chrashes every time he touches the corrupted file.

      I have analyzed the code. In the method doFullLuceneReindex() there is a Try- Catch block that catches the exception coming form the call getAttachmentContent(att.getName(), WikiProvider.LATEST_VERSION ).
      But thus the indexer stops at this points and no other attachment will be added to the lucene index.

      for( Iterator iterator = allAttachments.iterator(); iterator.hasNext(); )

      { Attachment att = (Attachment) iterator.next(); String text = getAttachmentContent( att.getName(), WikiProvider.LATEST_VERSION ); luceneIndexPage( att, text, writer ); }

      I would fixed it like this

      for( Iterator iterator = allAttachments.iterator(); iterator.hasNext(); )
      {
      Attachment att = (Attachment) iterator.next();
      try

      { String text = getAttachmentContent( att.getName(), WikiProvider.LATEST_VERSION ); luceneIndexPage( att, text, writer ); }

      catch (Throwable t)

      { //goto next Attachment iterator log.error("Error on indexing file " + att.getFileName(), t); }

      }

      Attachments

        Activity

          People

            metskem Harry Metske
            kurtstein Kurt Stein
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: