2

While reindexing my master / web indexes, the reindex failed and I saw these error messages in the logs:

Sitecore.ContentSearch.ContentExtraction.Common.DefaultMediaItemTextExtractor

Exception: System.IO.FileLoadException
Message: Expected pdf format
Source: Sitecore.ContentSearch.ContentExtraction
at Sitecore.ContentSearch.ContentExtraction.Readers.PdfSharpReader.ValidateIsPdf(String path)
at Sitecore.ContentSearch.ContentExtraction.Readers.PdfSharpReader.ReadAll(String filePath)
at Sitecore.ContentSearch.ContentExtraction.Common.DefaultMediaItemTextExtractor.ExtractTextFromMedia(MediaItem mediaItem)

On further inspection, the media library items in question did in fact have PDF files attached, but when I downloaded the attachment, its size was 0 bytes. However, the PDF must have had a size at some point, because the Size field has a value greater than 0.

media item fields

How might this have happened? Worth noting is that the solution does make use of Azure blob storage to store media items.

1 Answer 1

2

This can happen if the blob of the media item (the actual media data) no longer exists in the configured blob storage provider - in your case Azure Blob storage.

As a first step, check the credentials for the Azure Blob storage provider still work correctly as perhaps it is just a permission issue reading the blob.

Some other scenarios to consider that could lead to this issue:

  • Another Sitecore instance connected to the same storage endpoint and perhaps deleted that media item
  • Your instance or another instance ran the blob migration tool and didn't complete the process correctly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.