Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-4082

Extraction from Microsoft Sharepoint protected PDFs doesn't expose exception like other parsers.



    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.1
    • 2.9.0
    • parser
    • None


      I have attached a PDF file (see "MSFT Transcript FY23-Q3.pdf") that we are currently attempting to extract content from using Tika 2.4.1 (via Tika server), but since the file has had password protection added to it via Microsoft Sharepoint service, instead of getting the actual file content, we get content that says this:


      This PDF file is protected 

      You'll need a different reader in order to view this content: 

      Download a compatible PDF reader. 


      This PDF Document has been protected. 

      The reader you are using does not support opening files protected by Microsoft Office 



      Which is fine since the original content can obviously not be accessed without the password. It also throws an exception that we can see in "X-TIKA:EXCEPTION:embedded_warning" that is attached in the file "password protected pdf exception.txt".

      But we were surprised that we see any content at all as we have a similar document (see attached "PasswordProtectedWorkbook.xlsx") that we test with that is password protected in a similar way, albeit a XLSX instead of a PDF, that doesn't return any content and throws an exception in "X-TIKA:EXCEPTION:container_exception" (attached in "password protected xlsx.txt"), which we currently treat as a failure mode. whereas we don't currently treat "X-TIKA:EXCEPTION:embedded_warning" as a failure.

      I realize these are different parsers, but since it is a very similar scenario, should they not be treated in the same way, at least voiding all content and emitting a proper failing exception instead of just what appears to be considered a warning? We are hesitant to make all instances of "X-TIKA:EXCEPTION:embedded_warning" as failures as we are unsure what other kinds of errors can be surfaced in that way. But it is clear to us that password protected files should be considered as failed to process. Thoughts?


        1. MSFT Transcript FY23-Q3.pdf
          284 kB
          Carey Halton
        2. password protected pdf exception.txt
          5 kB
          Carey Halton
        3. PasswordProtectedWorkbook.xlsx
          14 kB
          Carey Halton
        4. password protected xlsx exception.txt
          4 kB
          Carey Halton
        5. screenshot-1.png
          24 kB
          Tilman Hausherr
        6. Screenshot from 2023-06-14 18-13-21.png
          66 kB
          Tim Allison

        Issue Links



              Unassigned Unassigned
              chalton Carey Halton
              0 Vote for this issue
              6 Start watching this issue