Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not run the 'getMediaStream' when indexing #69

Closed
mpnovicell opened this issue Jul 2, 2020 · 7 comments
Closed

Could not run the 'getMediaStream' when indexing #69

mpnovicell opened this issue Jul 2, 2020 · 7 comments

Comments

@mpnovicell
Copy link

mpnovicell commented Jul 2, 2020

Sitecore 9.3 / Dianoga version 5.0, getting a bunch of these errors when indexing:

564 12:24:52 ERROR Could not run the 'getMediaStream' pipeline for ''. Original media data will be used.
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Dianoga
at Dianoga.Invokers.GetMediaStreamSync.OptimizeImage.Process(GetMediaStreamPipelineArgs args)
at (Object , Object )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Resources.Media.Media.GetStreamFromPipeline(MediaOptions options, Boolean& canBeCached)

Any suggestions?

@markgibbons25
Copy link
Collaborator

That's an interesting one, it seems to be trying to read the image data during indexing. Would you be able to see if you have any custom computed index fields, such as a custom PDF indexer for example?

@mpnovicell
Copy link
Author

That's an interesting one, it seems to be trying to read the image data during indexing. Would you be able to see if you have any custom computed index fields, such as a custom PDF indexer for example?

We do have a computed field that reads PDF files with PDF box and returns the content.
I also noticed that all the errors point towards media items that are PDF files.
It makes sense that Dianoga trips over PDF files, but it does not really make sense why its trying to bother with PDF files.
I also tried adding the /Files folder (that contains the PDF files) to path exclusion, but Dianoga still errors out.

@markgibbons25
Copy link
Collaborator

Can you give me some steps to reproduce? I'll probably need code for the computed field.

@mpnovicell
Copy link
Author

mpnovicell commented Aug 20, 2020

Hi @markgibbons25 ,
I reproduced the error in a fresh Sitecore 9.3 XP0 instance.

  1. Go to Sitecore and download the UI installer for 9.3.
  2. Install a clean instance for the XP0 configuration.
  3. Create a new VS project targeted v4.7.1 .net Framework.
  4. Install Dianoga 5.0.1 package.
  5. Enable Dianoga.Strategy.GetMediaStreamSync.config (we use CDN, so we have to use this strategy).
  6. In Dianoga.ExcludePaths.config, add /Files
  7. Publish project to website root folder.
  8. Now add a PDF to the media library: https://imgur.com/a/aKrTdAE. (PDF file in screendump was serialized by Unicorn from an 8.2 instance and synchronized into an 9.3 instance).
  9. Publish the folders and PDF file.
  10. In the logs you should now find this error:

16324 09:14:51 ERROR Could not run the 'getMediaStream' pipeline for '/sitecore/media library/Files/Data Sheet Source/EN/Linear Actuator-Baselift-Data Sheet-Eng'. Original media data will be used.
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Dianoga
at Dianoga.Invokers.GetMediaStreamSync.OptimizeImage.Process(GetMediaStreamPipelineArgs args)
at (Object , Object )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Resources.Media.Media.GetStreamFromPipeline(MediaOptions options, Boolean& canBeCached)

If i download the file from Sitecore it opens with no problems, so i imagine it's not caused by corrupt files.

@mpnovicell
Copy link
Author

This is about the last thing i need to fix for our clients upgrade process to 9.3, i hope you can give a clue of to why this happens, i would like to use this cool module for the images.

@markgibbons25
Copy link
Collaborator

Thanks for the steps to reproduce, I was able to do so and find and fix the issue.

@coreymiddleton-mando
Copy link

Could you tell us the solution you found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants