Has anyone seen this error before or know how to solve it?

    996 16:35:46 WARN  Failed to execute datasource query System.NullReferenceException: Object reference not set to an instance of an object.
   at Sitecore.ContentSearch.SitecoreItemCrawler.IsExcludedFromIndex(SitecoreIndexableItem indexable, Boolean checkLocation)
   at Sitecore.ContentSearch.SitecoreItemCrawler.GetContextIndexRanking(IIndexable indexable)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.Min(IEnumerable`1 source)
   at Sitecore.ContentSearch.AbstractSearchIndex.Sitecore.ContentSearch.Pipelines.GetContextIndex.IContextIndexRankable.GetContextIndexRanking(IIndexable indexable)
   at Sitecore.ContentSearch.Pipelines.GetContextIndex.FetchIndex.<>c__DisplayClass6_0.<RankContextIndexes>b__0(ISearchIndex i)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Sitecore.ContentSearch.Pipelines.GetContextIndex.FetchIndex.GetContextIndex(IIndexable indexable, GetContextIndexArgs args)
   at Sitecore.ContentSearch.Pipelines.GetContextIndex.FetchIndex.Process(GetContextIndexArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Abstractions.CorePipelineWrapper.Run(String pipelineName, PipelineArgs args)
   at Sitecore.ContentSearch.Pipelines.GetContextIndex.GetContextIndexPipeline.Run(ICorePipeline pipeline, GetContextIndexArgs args)
   at Sitecore.Mvc.ExperienceEditor.DatasourceValidator.DatasourceValidator.IsDatasourceValid(String dataSource, Database database)
 996 16:35:46 WARN  '{9F469FDF-5697-47F7-8D55-01FBCD64E534}' is not valid datasource for master or user does not have permissions to access.

I am seeing this error when I try to set a DataSource on a rendering. I have tried this both via the Experience Editor and by setting it in the Layout manager.

  • When do you see this, during editing an item in experience editor? Can you please add more details along with the exception? Commented Mar 16, 2018 at 16:46
  • Please provide more details to get proper answer of your question from community. Commented Mar 19, 2018 at 10:10

2 Answers 2


Ok this was a stupid mistake. I haven't realized that my Solr instance has stopped running. The exception is thrown because it can't connect to Solr.

Starting Solr again solved the issue.


This is due to Solr being unavailable, as noted in the other answer. However this has also been addressed as a bug for Sitecore 9.0 Update 1 and the dependency on SOLR for the Datasource Validator has been removed.

You can download the patch here - https://github.com/SitecoreSupport/Sitecore.Support.212959

Sitecore 9 Update 2 does not require this patch.

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.