0

Any ideas on how to fix this error on my Content Delivery server?

My Content Management environment is working fine.

Sitecore 7.5

Server Error in '/' Application.

Request is not available in this context 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.Web.HttpException: Request is not available in this context

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[HttpException (0x80004005): Request is not available in this context]
   System.Web.HttpContext.get_Request() +12058604
   Sitecore.Security.Authentication.FormsAuthenticationHelper.GetCurrentUser() +128
   Sitecore.Security.Authentication.AuthenticationHelper.GetActiveUser() +22
   Sitecore.Security.Authentication.AuthenticationManager.GetActiveUser() +58
   Sitecore.Security.AccessControl.ItemAccess.CanRead() +43
   Sitecore.Data.Managers.ItemProvider.ApplySecurity(Item item, SecurityCheck securityCheck) +95
   Sitecore.Data.Managers.ItemManager.GetItem(ID itemId, Language language, Version version, Database database) +142
   Sitecore.Data.TemplateRecords.GetTemplate(ID templateID, Language language) +72
   Sitecore.Data.TemplateRecords.GetTemplate(String fullName, Language language) +89
   Sitecore.Sharedsource.Tasks.TemplateConfigurationBuilder.Create(Database database, XmlNode configNode) +415
   Sitecore.Sharedsource.Tasks.NewsMover.AddTemplateConfiguration(XmlNode configNode) +31

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
   Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +869
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +643
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +275
   Sitecore.Events.EventSubscribers.Add(String eventName, XmlNode configNode) +545
   Sitecore.Events.Event.GetConfigSubscribers() +563
   Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters) +358
   Sitecore.ContentSearch.Maintenance.IndexDatabasePropertyStore.Get(String key) +216
   Sitecore.ContentSearch.LuceneProvider.SwitchOnRebuildLuceneIndex.InitializeShards() +300
   Sitecore.ContentSearch.ContentSearchConfiguration.AddIndex(ISearchIndex index) +416

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
   Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +869
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +643
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +275
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +579
   Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +266
   Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.get_Cores() +92
   Sitecore.ContentSearch.SolrProvider.NinjectIntegration.NinjectSolrStartUp.Initialize() +62

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +540
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731
  • try wrapping your custom code in the security disabler – Andrey Bobrov Mar 18 '17 at 16:31
  • Can you give us a little information about when this error is occurring? Is it happening on initialize? Do you see this whenever you try to browse to your CD? Etc. – Zachary Kniebel Mar 18 '17 at 17:21
  • it seems something is failing in initialize pipeline.could you please check Managed Pipeline mode, .Net CLR Version in IIS's App Pool. (compare with CM setup). – Balaji Kuppuswamy Mar 18 '17 at 18:03
  • I can't get any CD pages to load. This error just seemed to pop up out of nowhere. If it was custom code, why is CM fine? – ADH Mar 18 '17 at 18:48
  • 1
    @ADH Have you just recently installed the NewsMover module? The error is happening inside that module, which is probably just a bug that can be fixed by using SecurityDisabler in this class. – Dmytro Shevchenko Mar 20 '17 at 8:24
0

The NewsMover module is only required to be working on the Content Management server. It does not need to be functional on the Content Delivery servers.

The purpose of the module is that when news articles are created in the /about/news folder the News Mover automatically creates year, month, and day folders and then moves the new news article into that folder.

The NewsMover.config file was accidentally deployed to the Content Delivery server and that is what caused the error to occur.

Disabling the NewsMover Module on Content Delivery by deleting the config file (App_Config/Include/NewsMover.config) resolved the error.

The NewsMover module is still working fine on the Content Management server.

  • This is more of a workaround than an answer to the question/solution to the problem. A good answer explains what the issue is, why it occurs, and how to resolve it. The solution you provided reduces the features included in the solution, so provide an alternative. If disabling NewsMover really is the fix for the issue then explain why this is the case (e.g. module incompatible with version with explanation of how to replicate the module's functionality through custom code, module interfering with custom logic and what that logic is, etc.). – Zachary Kniebel Mar 20 '17 at 16:15

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