Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-103774

Documents that have failed preview generation are still continuously checked for metadata extraction.

    Details

      Description

      Reproduction Steps:

      1. Start an instance of Liferay.
      2. Navigate to Documents & Media.
      3. Upload a PDF that is encrypted/password locked. Note the EncryptedDocumentExceptions that are generated.
      4. Return to Documents & Media. Note that your PDF has been successfully uploaded.
      5. Select the PDF you have just uploaded. The UI should state that no preview could be generated.

      Expected: No further exceptions are thrown

      Actual: Exceptions are thrown. See below:

       

      2019-10-23 02:19:06.849 WARN  [liferay/document_library_raw_metadata_processor-1][TikaRawMetadataProcessor:194] Unable to extract metadata
      2019-10-23 02:19:06.850 WARN  [liferay/document_library_raw_metadata_processor-1][RawMetadataProcessorMessageListener:38] Unable to save metadata for file version 33013
      com.liferay.portal.kernel.exception.SystemException: java.io.IOException: org.apache.tika.exception.EncryptedDocumentException: Unable to process: document is encrypted
      	at com.liferay.portal.metadata.TikaRawMetadataProcessor.extractMetadata(TikaRawMetadataProcessor.java:103)
      	at com.liferay.portal.metadata.BaseRawMetadataProcessor.getRawMetadataMap(BaseRawMetadataProcessor.java:71)
      	at com.liferay.portal.kernel.metadata.RawMetadataProcessorUtil.getRawMetadataMap(RawMetadataProcessorUtil.java:40)
      	at com.liferay.portlet.documentlibrary.util.RawMetadataProcessorImpl.saveMetadata(RawMetadataProcessorImpl.java:131)
      	at com.liferay.document.library.kernel.util.RawMetadataProcessorUtil.saveMetadata(RawMetadataProcessorUtil.java:113)
      	at com.liferay.portlet.documentlibrary.messaging.RawMetadataProcessorMessageListener.doReceive(RawMetadataProcessorMessageListener.java:34)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:58)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.io.IOException: org.apache.tika.exception.EncryptedDocumentException: Unable to process: document is encrypted
      	at com.liferay.portal.metadata.TikaRawMetadataProcessor$ExtractMetadataProcessCallable.extractMetadata(TikaRawMetadataProcessor.java:201)
      	at com.liferay.portal.metadata.TikaRawMetadataProcessor.extractMetadata(TikaRawMetadataProcessor.java:99)
      	... 11 more
      Caused by: org.apache.tika.exception.EncryptedDocumentException: Unable to process: document is encrypted
      	at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:177)
      	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
      	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
      	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
      	at com.liferay.portal.metadata.TikaRawMetadataProcessor$ExtractMetadataProcessCallable.extractMetadata(TikaRawMetadataProcessor.java:177)
      	... 12 more
      Caused by: org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException: Cannot decrypt PDF, the password is incorrect
      	at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.prepareForDecryption(StandardSecurityHandler.java:256)
      	at org.apache.pdfbox.pdfparser.COSParser.prepareDecryption(COSParser.java:2904)
      	at org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:284)
      	at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:173)
      	at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:226)
      	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1200)
      	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1173)
      	at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:154)
      	... 16 more
      

      Reproduced in:

      Master

      7.2.x

      7.1.x

      7.0.x - behavior is currently different than in all other branches due to the fact that LPS-86455 has not been backported yet. This fix will still be needed once it's backported, however.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                beck.liu Beck Liu
                Reporter:
                lianne.louie Lianne Louie
                Participants of an Issue:
                Recent user:
                Csaba Turcsan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  35 weeks, 6 days ago

                  Packages

                  Version Package
                  7.0.X
                  7.1.10 DXP FP16
                  7.1.X
                  7.2.10 DXP FP4
                  7.2.X
                  7.2.1 CE GA2
                  7.3.0 CE GA1
                  Master