Validation of viewstate MAC failed.

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/19/2007 6:37:29 AM
Gravatar
Total Posts 112

Validation of viewstate MAC failed.

 

Hi All,

I wrote my own module where a pushbutton changes a label to "Hello " + date+time, and another pushbutton changes it to "Label " + date+time. Also there are two asp:gridviews displaying information selected from msSQL tables. When I push one button and wait 4 seconds and push the other button everything works fine. But, when I push each button without waiting so long between button pushes, I get the following error in Data/currentlog.config.

2007-06-19 06:22:09,819 [7500] ERROR mojoPortal.Web.Global [(null)] - 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. ---> System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: 75.38.55.178
Port: 64045
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)
ViewState: hKdDH+MHGnnpc/TO92ZmxAdal4+KxO/u+Ed/RW4Vd5OPolAiLP8opI2K+fa38ClS00UjwCFfeRaLYsje5rrEENBoaO5OSEPjJckWPw5ktY1eTgft7i7EBJeIeBIVEmTF0EkmuAE3tuCyNoVmxQZ3Y2H2vAGQ68uCB03Xs3K+eK5xD8YsbUjxx4pjzcGdiHVHXh4ByNqQrkqxNWdKhmfeWBBf7kqvROxJGHPxlbItbcP4KlmaZHi/1EXhVoLLIDAT5MEPeZk1R6dD0Ejigqds+uZxA5JDQ4uQOIkYDfGdQdnimjEAtxbb5iQjKoGg7BUODt6VNFaR/5nzL5n7s4Z7Obc+prs86vm3TwdQfX2ovWdeKlw7eHogm/2CZ8E3RTLRgAZTnvfLiCplVHmoCYkfK2/xO6GcKu1TNZiIx+1w3BiegR/CHr0j1/anoGFBLvbaHhpIbVDIdk+7N4GaEReRUwCHbjnIkWnLiHtji02CZmhM97MiPy+GKEVEFlIh3/Q3Dq+VhEn2zuXTcFt7KwXHBxNlVY0cgaeG6oT1UL0nqA9YQESD5xkNm7YpQKx5NclIHlU4lRYXZkJuyL3k/h75eRJLQVnsFgmawKohMTEa2QcH1m26d/WT47XUSpglKmxkgCpXsPWxeLmAual2GjGKhZLA4qq2mddc51C33NILq3QCTW+pf5eWnWhhCXLId3QHlUadHCh1/B7E/6nvThglGr3qZfpMGfUZDppzTgRqIa4HM9a4ZsKd2pAcI/fpFeNaFAzxywYv2lAT7CNDqCqIs4u95gvCcF3NxwKiQQB99tTxPrJszYtTj4NRpqH8KCJXvFvj8hIxhzBVy4XUrFGZuG... ---> System.Web.HttpException: Unable to validate data.
at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\cms\dfe05af0\fefca3e4\App_Web_7rac0qjv.10.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Many thanks for any help you can provide,
Dale E. Moore

6/20/2007 4:02:45 PM
Gravatar
Total Posts 18439

Re: Validation of viewstate MAC failed.

Hi Dale,

This is not a mojoPortal bug is it? This question would be better in the developer forum.

I would suggest some google research as I know of several things that can cause this. in your case it sounds like double postback, that is clicking the second button before it has completed processing the first postback. You might try disabling the buttons using javascript after the first button is pushed and then re-enable it after processing the postback.

Hope it helps,

Joe

6/20/2007 4:51:46 PM
Gravatar
Total Posts 112

Re: Validation of viewstate MAC failed.

Thanks Joe! I've continued this thread here a more appropriate place. Dale E. Moore

You must sign in to post in the forums. This thread is closed to new posts.