Unable to Validate Data

L

Logician

Question


Does the server need a patch or do I need to change the config file?


Problem


My system is dogged by the viewstate error which happens after the page

is left inactive for about 10 mins. If I close and re-open it works
normally, but sometimes needs two re-opens.


It happens on all my aspx code, but my code is very simple. One example

is the shopping cart, which just updates a basket and displays a grid.
There is no session id, no checking, and no user input.


See http://www.merrows.co.uk/accounts/cart.aspx for the cart.


I use IE under Win XP (pro).


I think this is something connnected with timeout as after 10 mins it
happens, and I read somewhere that 10 mins was a timeout period by
default for a session.


I do need viewstates.


I am not using Farms, I rent a dedicated Windows server from
hostway.com. Several end users complain it does not work. I have
searched the Web and found the normal viewstate and farm reasons.


I use the defaults for config:


<!-- Web.Config Configuration File -->


<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Example Dump


Unable to validate data.
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: Unable to validate data.


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.Machi­neKey.GetDecodedData(Byte[] buf,
Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +196
System.Web.UI.LosFormatter.Des­erialize(String input) +60


[HttpException (0x80004005): Authentication of viewstate failed. 1) If

this is a cluster, edit <machineKey> configuration so all servers use
the same validationKey and validation algorithm. AutoGenerate cannot
be used in a cluster. 2) Viewstate can only be posted back to the same

page. 3) The viewstate for this page might be corrupted.]
System.Web.UI.LosFormatter.Des­erialize(String input) +118
System.Web.UI.Page.LoadPageSta­teFromPersistenceMedium() +102


[HttpException (0x80004005): Invalid_Viewstate
Client IP: 82.34.178.148
Port: 2717
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
..NET
CLR 1.1.4322; Alexa Toolbar)
ViewState:
dDwtMTg2MzMxODYxMzt0PDtsPGk8MT­47PjtsPHQ8O2w8aTwyMT47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­c3RhbjtSdWdzIENoaW5lc2U7UnVncy­BJbmRpYW47UnVncyBNYWNoaW5lIE1h­ZGU7VG95cyBBbmltYWxzO1RveXMgUm­9sbHk7PjtAPDE7Mzs0OzU7Njs3Ozg7­MjQ7OTsyOzEwOzUxOzExOzIzOzEyOz­EzOzU4OzI1OzE0OzE1OzE2OzU2OzE3­OzM1OzE4OzU5OzUzOzE5OzIwOzIxOz­IyOzMzOzUwOzQ3OzQwOzQ2OzMwOzMx­OzQxOzMyOzQ4OzI3OzI4OzM2OzM0Oz­I5Oz4+O2w8aTwxOT47Pj47Oz47Pj47­Pj47PhXSW+j0QOCokmjqlGc8JWy/Nf­ri

Http-Referer:

System.Web.UI.Page.LoadPageSta­teFromPersistenceMedium() +448
System.Web.UI.Page.LoadPageVie­wState() +18
System.Web.UI.Page.ProcessRequ­estMain() +444


------------------------------­------------------------------­--------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300
 
G

Guest

This knowledge base article might help troubleshooting your issue.

http://support.microsoft.com/default.aspx?scid=kb;en-us;829743

Even though you say there is no Web Farm, you might want to check with your
server provider if they have setup some kind of cluster configuration for
(NLB) load balancing or fault tolerance. If yes, you have to keep the
machineKey consistent in all servers that participate in cluster or NLB
configuration. For more details: http://support.microsoft.com/kb/312906/

Magdelin



Logician said:
Question


Does the server need a patch or do I need to change the config file?


Problem


My system is dogged by the viewstate error which happens after the page

is left inactive for about 10 mins. If I close and re-open it works
normally, but sometimes needs two re-opens.


It happens on all my aspx code, but my code is very simple. One example

is the shopping cart, which just updates a basket and displays a grid.
There is no session id, no checking, and no user input.


See http://www.merrows.co.uk/accounts/cart.aspx for the cart.


I use IE under Win XP (pro).


I think this is something connnected with timeout as after 10 mins it
happens, and I read somewhere that 10 mins was a timeout period by
default for a session.


I do need viewstates.


I am not using Farms, I rent a dedicated Windows server from
hostway.com. Several end users complain it does not work. I have
searched the Web and found the normal viewstate and farm reasons.


I use the defaults for config:


<!-- Web.Config Configuration File -->


<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Example Dump


Unable to validate data.
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: Unable to validate data.


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.Machi­neKey.GetDecodedData(Byte[] buf,
Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +196
System.Web.UI.LosFormatter.Des­erialize(String input) +60


[HttpException (0x80004005): Authentication of viewstate failed. 1) If

this is a cluster, edit <machineKey> configuration so all servers use
the same validationKey and validation algorithm. AutoGenerate cannot
be used in a cluster. 2) Viewstate can only be posted back to the same

page. 3) The viewstate for this page might be corrupted.]
System.Web.UI.LosFormatter.Des­erialize(String input) +118
System.Web.UI.Page.LoadPageSta­teFromPersistenceMedium() +102


[HttpException (0x80004005): Invalid_Viewstate
Client IP: 82.34.178.148
Port: 2717
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
..NET
CLR 1.1.4322; Alexa Toolbar)
ViewState:
dDwtMTg2MzMxODYxMzt0PDtsPGk8MT­47PjtsPHQ8O2w8aTwyMT47PjtsPHQ8­dDw7dDxpPDQ2PjtAPEJhdGhyb29tcy­BBZXN0dXM7QmF0aHJvb21zIEFtYmVy­O0JhdGhyb29tcyBBcXVhbGlzYTtCYX­Rocm9vbXMgQmFyYmVyIFdpbHNvbnM7­QmF0aHJvb21zIEJDIERlc2lnbnM7Qm­F0aHJvb21zIEJyaXN0YW47QmF0aHJv­b21zIENsZWFyd2F0ZXI7QmF0aHJvb2­1zIENyb3Nzd2F0ZXI7QmF0aHJvb21z­IERldmE7QmF0aHJvb21zIEV1cm9iYX­RoO0JhdGhyb29tcyBHcm9oZTtCYXRo­cm9vbXMgSG9sbHlzIG9mIEJhdGg7Qm­F0aHJ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-Referer:

System.Web.UI.Page.LoadPageSta­teFromPersistenceMedium() +448
System.Web.UI.Page.LoadPageVie­wState() +18
System.Web.UI.Page.ProcessRequ­estMain() +444


------------------------------­------------------------------­--------------------

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top