1

I'm receiving an error while trying to edit any content item in the Content Tree,

this is the error message

enter image description here

Can you help how to fix it?

Updated: Trace information

[InvalidOperationException: ContentEditorDataContext] Sitecore.Diagnostics.Assert.IsNotNull(Object value, String message) +55 Sitecore.Shell.Applications.ContentManager.ContentEditorForm.OnLoad(EventArgs e) +184

[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) +76
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35 Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +337 System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

Update: the issue appears on a load balancing environment where having two Sitecore CMS instances that point to the same databases.

  • A full stack trace might help ;) Or any other information - Sitecore version, environment - is this on all environments? Just upgraded? – Gatogordo Jul 2 '17 at 11:52
  • SiteCore version is 8.2 and it's on the production environmnet, I restored the databases from the staging environment to the production – Mahmoud Shaaban Jul 2 '17 at 13:33
  • When restoring the Databases, did you performed a Database cleanup? – Hishaam Namooya Jul 2 '17 at 17:27
  • @HishaamNamooya, no I didn't, I kept all data because they are the same as the production – Mahmoud Shaaban Jul 2 '17 at 22:05
  • @MahmoudShaaban normally when you restore a database from one environment to another you need to cleanup the eventqueue and the properties table as they store values about the previous environment and this can cause strange issue in the future. Concerning the current error, it seems that the content editor cannot load the item properly. Try to perform a cleanup database, rebuild the link table and also rebuild the master and core indexes – Hishaam Namooya Jul 2 '17 at 22:09
2

It seems like your issue is related to the load balancer setup - Sitecore content management (CM instance) should be a single server in your pool (eg give one server the host cms.yoursite.com, setup the loadbalancer to forward to that one machine, or use external ip on 1 server for instance); or you need to configure sticky sessions to ensure the request goes back to the same instance. The issue you are seeing is related to one server sending the response, and when you save the second server tries to process the response, but it doesn't match what it would have generated so it throws an exception.

Sitecore provide detailed instructions on how to scale for production, it's quite complex and there are number of considerations you (may) need to address for instance do you need to scale dbs, and your indexing solution - Sitecore recommend using solr and not lucene if you have multiple content delivery servers.

Check on Sitecore's document site Configure a Content management server for your version and advice they provide.

You will also need to follow the documentation for security hardening on your servers.

  • Can you please add a little more detail with regard to configuration, as well as some links to documentation, as needed? Also, since many of our users are new to Sitecore and are trying to follow along with the documentation, it is often helpful to outline that a CA instance is the same as a CM instance, since Sitecore doesn't mention CA instances in their documentation. – Zachary Kniebel Jul 11 '17 at 13:14
  • Edited with a link to the documentation and expanded my answer a bit more. – Ian Harley Jul 11 '17 at 14:19
  • Thanks @ZacharyKniebel for your response, your answer makes sense, we do need to have a single CA server, the current configuration includes two CA servers in the load balancing setup. can you give more details on how to configure sticky sessions to ensure the request goes back to the same instance??. we might also create a separate SiteCore instance for the CM and leave the other instance on the load balancer setup, ref csuwannarat.wordpress.com/2011/12/20/… – Mahmoud Shaaban Jul 11 '17 at 15:05
  • Configuring sticky sessions depends on your load balancer - you'll need to read the documentation for that. You may be able to add an external IP to one server and setup that to be your CM instance, give it a subdomain or something like that and not use the loadbalancer for it. – Ian Harley Jul 11 '17 at 15:17
  • Link is broken now. Can someone provide an alternative? – Muhammad Osama Jan 28 at 10:32
1

The problem reproduces when CM servers are distributed under a load balancer without sticky session properly set. The error occurs when LB serves you requests from one CM and suddenly when you post back data to the server the other CM responds - the request cannot find the initial ViewState values on the other CM disk (by default Sitecore stores ViewState on disk).

To solve it, store ViewState in the database and Sitecore has settings for it (Sitecore 8.1). Add the following settings in your own include config file:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/">
  <sitecore>
      <setting name="ViewStateStore">
        <patch:attribute name="value">Sitecore.Data.DataProviders.DatabaseViewStateStore, Sitecore.Kernel</patch:attribute>
      </setting>
      <setting name="PageStateStore">
        <patch:attribute name="value">Sitecore.Web.UI.DatabasePageStateStore, Sitecore.Kernel</patch:attribute>
      </setting>
      <setting name="Caching.CacheViewState">
        <patch:attribute name="value">false</patch:attribute>
      </setting>
  </sitecore>
</configuration>

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.