MachineKey and validation key configuration problem
I got the following error when I clicked a radio button on my web page after a couple of hours. This error only happens when the web page was loaded quite a little while ago and then you try to refresh it. It means that your post back request was sent to another machine of the web farm that has a different ValidationKey.
============
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that 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 configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
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): Unable to validate data.]
System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +294
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +203
[ViewStateException: Invalid viewstate.
Client IP: 99.236.97.182
Port: 50004
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
ViewState: /wEPDwUKLTYxNjI5NjY2N2QYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgUFKWN0bDAwJFNhbXBsZUNvbnRlbnQkUmFkaW9CdXR0b25fTG9jYWxDaXR5BStjdGwwMCRTYW1wbGVDb250ZW50JFJhZGlvQnV0dG9uX0xvY2FsUmVnaW9uBStjdGwwMCRTYW1wbGVDb250ZW50JFJhZGlvQnV0dG9uX0xvY2FsUmVnaW9uBSxjdGwwMCRTYW1wbGVDb250ZW50JFJhZGlvQnV0dG9uX0xvY2FsQ291bnRyeQUsY3RsMDAkU2FtcGxlQ29udGVudCRSYWRpb0J1dHRvbl9Mb2NhbENvdW50cnn8SfKUQG+aHispHv2uiGGybZbOcA==
Referer: http://ndprice.com/default-loid1-orid0-ctid5885-rgid37-caid88520750-49ef-450b-8a00-4a016587f6ed.aspx
Path: /Default.aspx]
[HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that 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) +267
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +282
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() +198
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
System.Web.UI.Page.LoadAllState() +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
====================
============
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that
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
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): Unable to validate data.]
System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +294
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +203
[ViewStateException: Invalid viewstate.
Client IP: 99.236.97.182
Port: 50004
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
ViewState: /wEPDwUKLTYxNjI5NjY2N2QYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgUFKWN0bDAwJFNhbXBsZUNvbnRlbnQkUmFkaW9CdXR0b25fTG9jYWxDaXR5BStjdGwwMCRTYW1wbGVDb250ZW50JFJhZGlvQnV0dG9uX0xvY2FsUmVnaW9uBStjdGwwMCRTYW1wbGVDb250ZW50JFJhZGlvQnV0dG9uX0xvY2FsUmVnaW9uBSxjdGwwMCRTYW1wbGVDb250ZW50JFJhZGlvQnV0dG9uX0xvY2FsQ291bnRyeQUsY3RsMDAkU2FtcGxlQ29udGVudCRSYWRpb0J1dHRvbl9Mb2NhbENvdW50cnn8SfKUQG+aHispHv2uiGGybZbOcA==
Referer: http://ndprice.com/default-loid1-orid0-ctid5885-rgid37-caid88520750-49ef-450b-8a00-4a016587f6ed.aspx
Path: /Default.aspx]
[HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +267
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +282
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() +198
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
System.Web.UI.Page.LoadAllState() +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
====================
Comments
Post a Comment