Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-38552

Bug in the PDFBox Plugin Causes Blockage during Content Reindexing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 5.8.4, 5.8.5
    • None

    Description

      Summary

      Bug - PDFBOX-2522 in the PDFBox plugin causes blockage during content reindexing. Confluence 5.7.x - 5.8.9, which ships with PDFBox version 1.8.4 is affected by the bug.

      Steps to Reproduce
      1. Add the problematic .pdf attachment to your Confluence page.
      2. Try to manually rebuild the contents index of your Confluence instance.
      3. Notice that during content reindexing the following warnings are thrown in the <Confluence-Home>/logs/atlassian-confluence.log file which then blocks the indexing process:
        2015-07-14 16:44:49,004 WARN [scheduler_Worker-9] [bonnie.search.extractor.BaseAttachmentContentExtractor] addFields Error indexing attachment (Attachment: xxx.pdf v.1 (22544563))
        com.atlassian.bonnie.search.extractor.ExtractorException: Error getting content of PDF document
                at com.atlassian.bonnie.search.extractor.PdfContentExtractor.extractText(PdfContentExtractor.java:96)
                at com.atlassian.bonnie.search.extractor.BaseAttachmentContentExtractor.addFields(BaseAttachmentContentExtractor.java:41)
                at com.atlassian.confluence.plugin.descriptor.ExtractorModuleDescriptor$BackwardsCompatibleExtractor.addFields(ExtractorModuleDescriptor.java:40)
                at com.atlassian.confluence.search.lucene.ConfluenceDocumentBuilder.extractWithLuceneExtractors(ConfluenceDocumentBuilder.java:155)
                at com.atlassian.confluence.search.lucene.ConfluenceDocumentBuilder.getDocument(ConfluenceDocumentBuilder.java:102)
                at com.atlassian.confluence.search.lucene.tasks.AddDocumentIndexTask.perform(AddDocumentIndexTask.java:49)
                at com.atlassian.confluence.search.lucene.tasks.UpdateDocumentIndexTask.perform(UpdateDocumentIndexTask.java:43)
                at com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager$IndexTaskWriter.apply(DefaultConfluenceIndexManager.java:473)
                at com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager$IndexTaskWriter.apply(DefaultConfluenceIndexManager.java:457)
        ...
        Caused by: java.io.IOException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher
                at javax.crypto.CipherInputStream.getMoreData(CipherInputStream.java:115)
                at javax.crypto.CipherInputStream.read(CipherInputStream.java:233)
                at javax.crypto.CipherInputStream.read(CipherInputStream.java:209)
                at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptData(SecurityHandler.java:312)
                at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decryptStream(SecurityHandler.java:413)
                at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decrypt(SecurityHandler.java:386)
                at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decryptObject(SecurityHandler.java:361)
                at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.proceedDecryption(SecurityHandler.java:192)
                at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.decryptDocument(StandardSecurityHandler.java:158)
                at org.apache.pdfbox.pdmodel.PDDocument.openProtection(PDDocument.java:1600)
                at org.apache.pdfbox.pdmodel.PDDocument.decrypt(PDDocument.java:946)
                at com.atlassian.bonnie.search.extractor.PdfContentExtractor.extractText(PdfContentExtractor.java:64)
                ... 42 more
        Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher
                at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:913)
                at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:824)
                at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:436)
                at javax.crypto.Cipher.doFinal(Cipher.java:2048)
                at javax.crypto.CipherInputStream.getMoreData(CipherInputStream.java:112)
        
      Workaround
      1. Disable the indexing of PDF attachments using this guide
        OR
      2. Update the PDFBox plugin manually in <Confluence-Installation>/confluence/WEB-INF/lib folder by replacing the original PDFBox plugin with a version 1.8.8 or newer. Download the newer version here.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lrura Lauretha Rura
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: