Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Error occurs when clicking after 15 minutes

Reply
Thread Tools

Error occurs when clicking after 15 minutes

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      07-31-2007
When I click after about 15 minutes on a page I wrote I recieve the
following error:

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.GetDeco dedData(Byte[] buf,
Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +2549692
System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +214

[ViewStateException: Invalid viewstate.
Client IP: 72.81.21.124
Port: 50536
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
ViewState:
/wEPDwULLTE4MzE4MzkwNDgPZBYCAgMPZBYSAgEPDxYCHgRUZXh 0BSVDb21wbGV4IENhc2UgSGlnaGxpZ2h0IChJdGVtcyAx4oCTM TApZGQCBA8PFgIfAAW7A0EgMzUteWVhci1vbGQgQWZyaWNhbi1 BbWVyaWNhbiBtYW4gcHJlc2VudHMgdG8geW91IGZvciBoaXMgY W5udWFsIOKAnHBoeXNpY2FsIGV4YW0u4oCdIEhlIGhhcyBubyB zaWduaWZpY2FudCBjb21wbGFpbnRzIGJ1dCBpcyBjb25jZXJuZ WQgYmVjYXVzZSBoaXMgb2xkZXIgc2lzdGVyIHdhcyBqdXN0IGR pYWdub3NlZCB3aXRoIHR5cGUgMiBkaWFiZXRlcy4gSGlzIGZhd GhlciBhbHNvIGhhZCB0eXBlIDIgZGlhYmV0ZXMgYW5kIGRpZWQ gYXQgYWdlIDU0IG9mIGEgbXlvY2FyZGlhbCBpbmZhcmN0aW9uL iBIZSBoYXMgdHdvIHNvbnMgYWdlIDEwIGFuZCAxMiwgYm90aCA +MTIwJSBvZiBpZGVhbCB3ZWlnaHQgZm9yIHRoZWlyIGhlaWdod C4gSGUgaXMgNuKAmTDigJ0gYW5kIHdlaWdocyAyMTAgbGJzICh CTUkgMjcga2cvbTIpOyBibG9vZCBwcmVzc3VyZSBpcyAxMzgvO DggbW0gSGcuZGQCBw8PFgIfAAU0Q3VycmVudCBsYWIgcmVzdWx 0cyBmb3IgdGhpcyBwYXRpZW50IGFyZSBhcyBmb2xsb3dzOmRkA goPDxYIHghJbWFnZVVybAUSaW1hZ2VzL01...]

[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(Except ion inner, String
persistedState, String errorPageMessage, Boolean macValidationError) +116
System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +251
System.Web.UI.ObjectStateFormatter.System.Web.UI.I StateFormatter.Deserialize(String
serializedState) +4
System.Web.UI.Util.DeserializeWithAssert(IStateFor matter formatter,
String serializedState) +37
System.Web.UI.HiddenFieldPageStatePersister.Load() +220
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +83
System.Web.UI.Page.LoadAllState() +35
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
+154
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +64



--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.210


I have no idea why this happens, and am unfamiliar with viewstate MAC. Can
anyone give me a starting point? Thanks.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      08-01-2007
One chance is that the application is shut down due to no activity, which
would make it regenerate the machine keys (in case you haven't specified
them in web.config) and when keys have changed validating viewstate etc
cannot succeed.


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net



"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When I click after about 15 minutes on a page I wrote I recieve the
> following error:
>
> 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.GetDeco dedData(Byte[] buf,
> Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +2549692
> System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +214
>
> [ViewStateException: Invalid viewstate.
> Client IP: 72.81.21.124
> Port: 50536
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
> CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
> ViewState:
> /wEPDwULLTE4MzE4MzkwNDgPZBYCAgMPZBYSAgEPDxYCHgRUZXh 0BSVDb21wbGV4IENhc2UgSGlnaGxpZ2h0IChJdGVtcyAx4oCTM TApZGQCBA8PFgIfAAW7A0EgMzUteWVhci1vbGQgQWZyaWNhbi1 BbWVyaWNhbiBtYW4gcHJlc2VudHMgdG8geW91IGZvciBoaXMgY W5udWFsIOKAnHBoeXNpY2FsIGV4YW0u4oCdIEhlIGhhcyBubyB zaWduaWZpY2FudCBjb21wbGFpbnRzIGJ1dCBpcyBjb25jZXJuZ WQgYmVjYXVzZSBoaXMgb2xkZXIgc2lzdGVyIHdhcyBqdXN0IGR pYWdub3NlZCB3aXRoIHR5cGUgMiBkaWFiZXRlcy4gSGlzIGZhd GhlciBhbHNvIGhhZCB0eXBlIDIgZGlhYmV0ZXMgYW5kIGRpZWQ gYXQgYWdlIDU0IG9mIGEgbXlvY2FyZGlhbCBpbmZhcmN0aW9uL iBIZSBoYXMgdHdvIHNvbnMgYWdlIDEwIGFuZCAxMiwgYm90aCA +MTIwJSBvZiBpZGVhbCB3ZWlnaHQgZm9yIHRoZWlyIGhlaWdod C4gSGUgaXMgNuKAmTDigJ0gYW5kIHdlaWdocyAyMTAgbGJzICh CTUkgMjcga2cvbTIpOyBibG9vZCBwcmVzc3VyZSBpcyAxMzgvO DggbW0gSGcuZGQCBw8PFgIfAAU0Q3VycmVudCBsYWIgcmVzdWx 0cyBmb3IgdGhpcyBwYXRpZW50IGFyZSBhcyBmb2xsb3dzOmRkA goPDxYIHghJbWFnZVVybAUSaW1hZ2VzL01...]
>
> [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(Except ion inner, String
> persistedState, String errorPageMessage, Boolean macValidationError) +116
> System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +251
>
> System.Web.UI.ObjectStateFormatter.System.Web.UI.I StateFormatter.Deserialize(String
> serializedState) +4
> System.Web.UI.Util.DeserializeWithAssert(IStateFor matter formatter,
> String serializedState) +37
> System.Web.UI.HiddenFieldPageStatePersister.Load() +220
> System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +83
> System.Web.UI.Page.LoadAllState() +35
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
> System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
> Boolean includeStagesAfterAsyncPoint) +154
> System.Web.UI.Page.ProcessRequest() +86
> System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +18
> System.Web.UI.Page.ProcessRequest(HttpContext context) +49
> ASP.default_aspx.ProcessRequest(HttpContext context) +29
>
> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
> +154
> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
> completedSynchronously) +64
>
>
>
> --------------------------------------------------------------------------------
> Version Information: Microsoft .NET Framework Version:2.0.50727.42;
> ASP.NET Version:2.0.50727.210
>
>
> I have no idea why this happens, and am unfamiliar with viewstate MAC. Can
> anyone give me a starting point? Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to be able to access the internet by opening my browser and not right clicking and then clicking connect. James Johnson Computer Support 1 05-15-2004 03:40 AM
PreRender Event occurs immediatley after Load event =?Utf-8?B?QWxpcmV6YSBaaWFp?= ASP .Net 1 02-09-2004 10:19 AM
Display error message if an error occurs on "open" command Geek Perl Misc 3 12-02-2003 11:04 PM
LinkedList NullPointerException occurs after switched from IBM JVM 1.4.0 to 1.4.1 Tohru Kao Java 3 07-14-2003 08:12 AM
LinkedList NullPointerException occurs after switched from IBM JVM 1.4.0 to 1.4.1 Tohru Kao Java 1 07-08-2003 09:09 AM



Advertisments