Unable to validate data after idle

S

Solje

Im developing an ASP.NET application used for maintinance purpose and
it may be idle for some ours. The application crash with the error
shown below when the user click on some contol in the appliaction.
This crash occurs on every clients at same time, event for the client
at the local server. I added some logging to the Application_Error
method that contains following:
Exception of type System.Web.HttpUnhandledException was thrown.
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication
+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)

We have deployed the application on a lot of plats without any problem
so it seems that we have some problem with the setting for the IIS.
The IIS is windows standard compinent in Windows server 2003. Note
that we using .Net framework 1.1 and the serve also have .NET
framework 2.0 installed.

Information from the Webclient:

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.MachineKey.GetDecodedData(Byte[] buf,
Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +196
System.Web.UI.LosFormatter.Deserialize(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.Deserialize(String input) +118
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: 127.0.0.1
Port: 4160
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET
CLR 1.1.4322; .NET CLR 2.0.50727)
ViewState: dDwxMDkyNjEwOTE4O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.aspx
Path: /Default.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +448
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447

/Stefan S
 
M

Mark Rae

Im developing an ASP.NET application used for maintinance purpose and
it may be idle for some ours.

<snip>

Is it not simply that the clients' Session has timed out...?

Easy enough to code round this by interrogating the IsNewSession property of
the HttpSessionState object:
http://www.google.co.uk/search?hl=en&rls=GGLG,GGLG:2006-28,GGLG:en&q=ASP.NET+export+Excel&meta=

I almost always construct a base page which has this check built into it and
then inherit all subsequent pages from that instead of the default Page
object...
 
S

Solje

Thank you for answer.

But why should this happen at same time for every clients?

I think it seems that the server loosed some inormation about the
viewstate or something.

/Stefan
 
M

Mark Rae

But why should this happen at same time for every clients?

Maybe your web app recycled...? Are there any entries in the web server's
Event Log which would confirm this...?
 
S

Solje

<snip>

Is it not simply that the clients' Session has timed out...?

Easy enough to code round this by interrogating the IsNewSession property of
the HttpSessionState object:http://www.google.co.uk/search?hl=en&rls=GGLG,GGLG:2006-28,GGLG...

I almost always construct a base page which has this check built into it and
then inherit all subsequent pages from that instead of the default Page
object...

Hello again!

The link seems to point to some excel stuff. Is that correct?

/Stefan
 
B

bruce barker

by default the viewstate is encrypted. the key is autogenerated when the
appdomain starts up. it appers in your case when the app domain is
recycled (after idle time) a new key is generated (maybe you have more
than 1 nic on the server and a different mac address is picked). you can
set the machineKey in the web config to prevent this.

-- bruce (sqlwork.com)
Im developing an ASP.NET application used for maintinance purpose and
it may be idle for some ours. The application crash with the error
shown below when the user click on some contol in the appliaction.
This crash occurs on every clients at same time, event for the client
at the local server. I added some logging to the Application_Error
method that contains following:
Exception of type System.Web.HttpUnhandledException was thrown.
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication
+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)

We have deployed the application on a lot of plats without any problem
so it seems that we have some problem with the setting for the IIS.
The IIS is windows standard compinent in Windows server 2003. Note
that we using .Net framework 1.1 and the serve also have .NET
framework 2.0 installed.

Information from the Webclient:

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.MachineKey.GetDecodedData(Byte[] buf,
Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +196
System.Web.UI.LosFormatter.Deserialize(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.Deserialize(String input) +118
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: 127.0.0.1
Port: 4160
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET
CLR 1.1.4322; .NET CLR 2.0.50727)
ViewState: dDwxMDkyNjEwOTE4O3Q8cDxsPEN0cmxJZDs
+O2w8UG9zaXRpb25EYXRhOz4+O2w8aTwxPjs+O2w8dDw7bDxpPDM
+Oz47bDx0PHA8cDxsPENzc0NsYXNzO18hU0I7PjtsPG1haW5UYWJsZTtpPDI
+Oz4+Oz47bDxpPDA+O2k8MT47PjtsPHQ8O2w8aTwwPjs+O2w8dDw7bDxpPDA
+Oz47bDx0PDtsPGk8MD47aTwyPjs
+O2w8dDxwPHA8bDxDc3NDbGFzcztfIVNCOz47bDx0YWJUYWJsZTtpPDI
+Oz4+Oz47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DI+O2k8Mz47aTw0Pjs
+O2w8cDxMZWRpZzswPjtwPEJva2FkOzE
+O3A8UmVzZXJ2ZXJhZDsyPjtwPEJlbGFnZDszPjtwPEZyaXNsw6RwcHQ7ND47Pj47Pjs7Pjt0PHA8cDxsPFRleHQ7PjtsPFVwcGRhdGVyYSBwYWxsZGF0YS9VcHBkcmFnOz4+Oz47Oz47dDxwPHA8bDxUZXh0Oz47bDxUw7ZtOz4+Oz47Oz47dDxwPHA8bDxUZXh0Oz47bDxTcGFyYTs
+Pjs+Ozs+O3Q8cDxwPGw8VGV4dDs
+O2w8SW5jb21pbmcgVW5pdHM7Pj47Pjs7Pjt0PEAwPDs7Ozs7Ozs7Ozs+Ozs
+Oz4+Oz4+O3Q8cDxwPGw8SW1hZ2VVcmw7VmlzaWJsZTs
+O2w8Li4vSW1hZ2UvTWFza2UxXzEuZ2lmO288dD47Pj47Pjs7Pjs+Pjs+Pjs+Pjs+Pjs
+Pjs
+PjtsPEN0cmxJZF9Qb3NpdGlvbkRhdGE6YnV0UHJldjtDdHJsSWRfUG9zaXRpb25EYXRhOmJ1dE5leHQ7Q3RybElkX1Bvc2l0aW9uRGF0YTpjaGtNTUM7Q3RybElkX1Bvc2l0aW9uRGF0YTpjaGtQbGM7Q3RybElkX1Bvc2l0aW9uRGF0YTpjaGtVcGRhdGVUcnVuOz4+/
U9vGHqMxtg5HH83KjI8tR+iw9c=
Http-Referer: http://localhost/Default.aspx
Path: /Default.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +448
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447

/Stefan S
 

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

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top