2

We have DXA 1.5 website and recently we have noticed that sometime the site goes down. Checking the logs shows the below error. I can see the context service error that says "An error occurred while resolving evidence using the Context Service". Can anyone suggest what could be the possible reason behind this issue?

2017-05-02 03:54:00,180 [39] ERROR - Failed to execute query
Sdl.Web.Delivery.Service.ServiceQueryException: Failed to execute query ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.OData.Client.ClientEdmModel.<>c__DisplayClass19.<GetOrCreateEdmTypeInternal>b__d(IEdmSchemaElement et)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmTypeInternal(IEdmStructuredType edmBaseType, Type type, PropertyInfo[] keyProperties, Boolean isEntity, Nullable`1 hasProperties)
   at Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmType(Type type)
   at Microsoft.OData.Client.ClientEdmModel.CreateEdmProperty(IEdmStructuredType declaringType, PropertyInfo propertyInfo)
   at Microsoft.OData.Client.ClientEdmModel.<>c__DisplayClass19.<GetOrCreateEdmTypeInternal>b__e(EdmEntityTypeWithDelayLoadedProperties entityType)
   at Microsoft.OData.Client.Providers.EdmEntityTypeWithDelayLoadedProperties.EnsurePropertyLoaded()
   at Microsoft.OData.Client.Providers.EdmEntityTypeWithDelayLoadedProperties.get_DeclaredProperties()
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.<DiscoverEdmProperties>d__8.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.EdmProperties()
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.BuildPropertyCache()
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.GetProperty(String propertyName, Boolean ignoreMissingProperties)
   at Microsoft.OData.Client.Materialization.StructuralValueMaterializationPolicy.MaterializeDataValues(ClientTypeAnnotation actualType, IEnumerable`1 values, Boolean ignoreMissingProperties)
   at Microsoft.OData.Client.Materialization.EntryValueMaterializationPolicy.MaterializeResolvedEntry(MaterializerEntry entry, Boolean includeLinks)
   at Microsoft.OData.Client.Materialization.ODataEntityMaterializer.DirectMaterializePlan(ODataEntityMaterializer materializer, MaterializerEntry entry, Type expectedEntryType)
   at Microsoft.OData.Client.Materialization.ODataEntityMaterializer.ReadImplementation()
   at Microsoft.OData.Client.MaterializeAtom.MoveNextInternal()
   at Microsoft.OData.Client.MaterializeAtom.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__94`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Sdl.Web.Delivery.Service.MemoryCacheProvider.AddOrGetExisting(String key, Func`1 addFactory, Boolean useCache)
   at Sdl.Web.Delivery.Service.ODataV4Service.<>c__DisplayClass19_0`1.<Execute>b__0()
   --- End of inner exception stack trace ---
   at DynamicModule.ns.Wrapped_ILocalizationResolver_390cbb24db8647618694a34aa022c00f.ResolveLocalization(Uri url)
   at Sdl.Web.Mvc.Configuration.WebRequestContext.GetCurrentLocalization() in C:\TeamCity\buildAgent\work\531db7af87a3c68e\.deploy\source code\web application\Sdl.Web.Mvc\Configuration\WebRequestContext.cs:line 196
   at Sdl.Web.Mvc.Configuration.WebRequestContext.get_Localization() in C:\TeamCity\buildAgent\work\531db7af87a3c68e\.deploy\source code\web application\Sdl.Web.Mvc\Configuration\WebRequestContext.cs:line 23
   at Sdl.Web.Mvc.Statics.StaticContentModule.BeginRequest(Object sender, EventArgs e) in C:\TeamCity\buildAgent\work\531db7af87a3c68e\.deploy\source code\web application\Sdl.Web.Mvc\Statics\StaticContentModule.cs:line 55
2017-05-02 03:54:00,187 [39] ERROR - Internal Server Error
System.Web.HttpException (0x80004005): Internal Server Error ---> Sdl.Web.Delivery.Service.ServiceQueryException: Failed to execute query ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.OData.Client.ClientEdmModel.<>c__DisplayClass19.<GetOrCreateEdmTypeInternal>b__d(IEdmSchemaElement et)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmTypeInternal(IEdmStructuredType edmBaseType, Type type, PropertyInfo[] keyProperties, Boolean isEntity, Nullable`1 hasProperties)
   at Microsoft.OData.Client.ClientEdmModel.GetOrCreateEdmType(Type type)
   at Microsoft.OData.Client.ClientEdmModel.CreateEdmProperty(IEdmStructuredType declaringType, PropertyInfo propertyInfo)
   at Microsoft.OData.Client.ClientEdmModel.<>c__DisplayClass19.<GetOrCreateEdmTypeInternal>b__e(EdmEntityTypeWithDelayLoadedProperties entityType)
   at Microsoft.OData.Client.Providers.EdmEntityTypeWithDelayLoadedProperties.EnsurePropertyLoaded()
   at Microsoft.OData.Client.Providers.EdmEntityTypeWithDelayLoadedProperties.get_DeclaredProperties()
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.<DiscoverEdmProperties>d__8.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.EdmProperties()
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.BuildPropertyCache()
   at Microsoft.OData.Client.Metadata.ClientTypeAnnotation.GetProperty(String propertyName, Boolean ignoreMissingProperties)
   at Microsoft.OData.Client.Materialization.StructuralValueMaterializationPolicy.MaterializeDataValues(ClientTypeAnnotation actualType, IEnumerable`1 values, Boolean ignoreMissingProperties)
   at Microsoft.OData.Client.Materialization.EntryValueMaterializationPolicy.MaterializeResolvedEntry(MaterializerEntry entry, Boolean includeLinks)
   at Microsoft.OData.Client.Materialization.ODataEntityMaterializer.DirectMaterializePlan(ODataEntityMaterializer materializer, MaterializerEntry entry, Type expectedEntryType)
   at Microsoft.OData.Client.Materialization.ODataEntityMaterializer.ReadImplementation()
   at Microsoft.OData.Client.MaterializeAtom.MoveNextInternal()
   at Microsoft.OData.Client.MaterializeAtom.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__94`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Sdl.Web.Delivery.Service.MemoryCacheProvider.AddOrGetExisting(String key, Func`1 addFactory, Boolean useCache)
   at Sdl.Web.Delivery.Service.ODataV4Service.<>c__DisplayClass19_0`1.<Execute>b__0()
   --- End of inner exception stack trace ---
   at DynamicModule.ns.Wrapped_ILocalizationResolver_390cbb24db8647618694a34aa022c00f.ResolveLocalization(Uri url)
   at Sdl.Web.Mvc.Configuration.WebRequestContext.GetCurrentLocalization() in C:\TeamCity\buildAgent\work\531db7af87a3c68e\.deploy\source code\web application\Sdl.Web.Mvc\Configuration\WebRequestContext.cs:line 196
   at Sdl.Web.Mvc.Configuration.WebRequestContext.get_Localization() in C:\TeamCity\buildAgent\work\531db7af87a3c68e\.deploy\source code\web application\Sdl.Web.Mvc\Configuration\WebRequestContext.cs:line 23
   at Sdl.Web.Mvc.Statics.StaticContentModule.BeginRequest(Object sender, EventArgs e) in C:\TeamCity\buildAgent\work\531db7af87a3c68e\.deploy\source code\web application\Sdl.Web.Mvc\Statics\StaticContentModule.cs:line 82
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2017-05-02 03:54:00,214 [39] ERROR - Exception:An error occurred while resolving evidence using the Context Service.   at Sdl.Web.Tridion.Context.ContextServiceClaimsProvider.GetContextClaims(String aspectName) in C:\TeamCity\buildAgent\work\531db7af87a3c68e\.deploy\source code\web application\Sdl.Web.Tridion\Context\ContextServiceClaimsProvider.cs:line 83
   at DynamicModule.ns.Wrapped_IContextClaimsProvider_7bc41cf2d5c24b3583df10aa29d1fdb8.<GetContextClaims_DelegateImplementation>__0(IMethodInvocation inputs, GetNextInterceptionBehaviorDelegate getNext)
2017-05-02 03:54:00,223 [39] ERROR - Error thrown while showing Server error:An error occurred while resolving evidence using the Context Service.
  • Anything in the Context Service log file? – Rick Pannekoek May 2 '17 at 12:27
  • BTW: There are two other "interesting" errors besides the Context Service error: a {{NullReferenceException}} deep down in CIL.NET when trying to resolve the URL to a Publication and an "Error while showing Server error". I guess the {{NullReferenceException}} is the root cause and the Context Service error happens during error handling. – Rick Pannekoek May 2 '17 at 13:23
2

Check whether the "SDL Web Context Service" is running properly and "ContextServiceCapability"also properly registered in the discovery service.

<Role Name="ContextServiceCapability" Url="http://tridion.sdldemo.com:8081/context.svc"/>
  • Hi Rajesh Context service is running properly. Just to give you for info we have three web servers means (three DXA website hosted) web1, web2 and web3. The sites are working properly on web1 and web3. But issue is with web2. The configuration are same in all the three servers. The issue happens intermittently. So difficult to find the root cause. – Indra May 2 '17 at 10:40
  • @Indra, It's possibly missing value/content somewhere that's why getting NullReferenceException or web application is not able to communicate properly with Content, context services, what is the version of CM / CD is that 8.1.1 or 8.5? – Velmurugan Sep 4 '17 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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