+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Validation of viewstate MAC failed

Validation of viewstate MAC failed

2 posts, 0 answered
  1. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    02 Mar 2009
    Link to this post

    I've moved a site to a new server, however, i'm periodically getting an error when trying to save the editor:

    Version is 3.1 sp1
    Is this a server setup issue?

    Server Error in '/' Application.


    Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    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: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    Source Error:

    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

      <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>

    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.


    Stack Trace:

    [HttpException (0x80004005): Unable to validate data.]
       System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +289
       System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +140
     
    [ViewStateException: Invalid viewstate. 
            Client IP: 213.105.241.9
            Port: 33442
            User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
            ViewState: /wEPDwUENTM4MQ9kFgJmD2QWAgIDEGRkFgRmD2QWBGYPZBYEZg9kFgJmDw8WBB4LXyFEYXRhQm91bmRnHgtfIUl0ZW1Db3VudAICZBYEZg8PFgIeBFRleHQFB0NsYXNzZXNkZAICDw8WAh8CBQZZZWFyIDFkZAIBD2QWAgIBDw8WAh4LTmF2aWdhdGVVcmwFJy9DbGFzc2VzL1llYXIxLmFzcHg/Y21zcGFnZW1vZGU9cHJldmlld2RkAgEPZBYEZg9kFgJmDw9kFgIeBXRpdGxlBT5JZiB0aGUgdG9vbGJveCByZXN0cmljdHMgeW91ciB2aWV3LCBjbGljayBoZXJlIHRvIGNvbGxhcHNlIGl0LmQCAQ8WAh4Fc3R5bGUFCWRpc3BsYXk6OxYCAgQPEGQQFQgGSGVhZGVyCUxlZnRfUG9kMQlMZWZ0X1BvZDILTWlkZGxlX1BvZDELTWlkZGxlX1BvZDIKUmlnaHRfUG9kMQpSaWdodF9Qb2QyBkZvb3RlchUIBmhlYWRlcglsZWZ0X3BvZDEJbGVmdF9wb2QyC21pZGRsZV9wb2QxC21pZGRsZV9wb2QyCnJpZ2h0X3BvZDEKcmlnaHRfcG9kMgZmb290ZXIUKwMIZ2dnZ2dnZ2dkZAIBD2QWAmYPZBYQAgEPZBYCZg8PFgIfAgUGSGVhZGVyZBYCAgEPZBYCAgEPZBYCAgIPFCsAAw8WAh8AZ2QUKwAJFCsAAg8WCB8CBQRIb21lHwMFC34vSG9tZS5hc3B4HgVWYWx1ZQUESG9tZR4HVG9vbFRpcGVkZBQrAAIPFggfAgUGU2Nob29sHwMFDX4vU2Nob29sLmFzcHgfBgUG...]
     
    [HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
       System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106
       System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
       System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +242
       System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
       System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
       System.Web.UI.HiddenFieldPageStatePersister.Load() +207
       System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105
       System.Web.UI.Page.LoadAllState() +43
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
       System.Web.UI.Page.ProcessRequest() +80
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.gemview_admin_editpage_aspx.ProcessRequest(HttpContext context) +4
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

     


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Mar 2009
    Link to this post
    Hello Quade,

    Please take a look at the following article in our Troubleshooting section Validation of viewstate MAC failed.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered