By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,948 Members | 1,958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,948 IT Pros & Developers. It's quick & easy.

'Unable to validate data' - Why is Viewstate corrupt?

P: n/a
sjl
I've got an .aspx webform for searching my database. It basically takes user
input and passes it as a parm into a stored proc to search a table. The
results are returned in a SQLDataReader and bound to a datagrid on the same
page. It works 90% of the time as expected. However, for some unknown
reason, I randomly get the error below. The HttpException says there is an
'Invalid_Viewstate'. Ok, but why? I'm posting back to the same page. If the
Viewstate is corrupt, then why?

I'm hosting at Orcs Web using shared hosting, ASP.NET 1.1, SQL 2000, VS2003.

***********ERROR MESSAGE DETAILS******************
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.

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.LoadPageStateFromPersistenceMed ium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: xxxxxx
Port: 3639
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50215)
ViewState: dDwtMTUxMTMzMDAzMjt0 [clipped]
Http-Referer: http://xxxxxxxxxx/search.aspx
Path: /search.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +443
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447
***********ERROR MESSAGE DETAILS******************

Thanks for any help you can provide.
SJL
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
sjl,

You should inquire of your webhost as to whether they are hosting via a
clustered environment. As the error states if they are you will need the
<machineKey> edited for the clusted environment.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
I've got an .aspx webform for searching my database. It basically takes
user input and passes it as a parm into a stored proc to search a table.
The results are returned in a SQLDataReader and bound to a datagrid on the
same page. It works 90% of the time as expected. However, for some unknown
reason, I randomly get the error below. The HttpException says there is an
'Invalid_Viewstate'. Ok, but why? I'm posting back to the same page. If
the Viewstate is corrupt, then why?

I'm hosting at Orcs Web using shared hosting, ASP.NET 1.1, SQL 2000,
VS2003.

***********ERROR MESSAGE DETAILS******************
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.

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.LoadPageStateFromPersistenceMed ium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: xxxxxx
Port: 3639
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50215)
ViewState: dDwtMTUxMTMzMDAzMjt0 [clipped]
Http-Referer: http://xxxxxxxxxx/search.aspx
Path: /search.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +443
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447
***********ERROR MESSAGE DETAILS******************

Thanks for any help you can provide.
SJL

Nov 19 '05 #2

P: n/a
sjl
Justin. Thanks for the reply, unfortunately, I'm told by my host:

"Your site is being hosted on one of our shared servers which is not a
clustered environment. Only our webfarm servers are in a clustered
environment, which your site is not on."

Any other ideas?

SJL
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:u0*************@TK2MSFTNGP15.phx.gbl...
sjl,

You should inquire of your webhost as to whether they are hosting via a
clustered environment. As the error states if they are you will need the
<machineKey> edited for the clusted environment.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
I've got an .aspx webform for searching my database. It basically takes
user input and passes it as a parm into a stored proc to search a table.
The results are returned in a SQLDataReader and bound to a datagrid on
the same page. It works 90% of the time as expected. However, for some
unknown reason, I randomly get the error below. The HttpException says
there is an 'Invalid_Viewstate'. Ok, but why? I'm posting back to the
same page. If the Viewstate is corrupt, then why?

I'm hosting at Orcs Web using shared hosting, ASP.NET 1.1, SQL 2000,
VS2003.

***********ERROR MESSAGE DETAILS******************
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.

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.LoadPageStateFromPersistenceMed ium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: xxxxxx
Port: 3639
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50215)
ViewState: dDwtMTUxMTMzMDAzMjt0 [clipped]
Http-Referer: http://xxxxxxxxxx/search.aspx
Path: /search.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +443
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447
***********ERROR MESSAGE DETAILS******************

Thanks for any help you can provide.
SJL


Nov 19 '05 #3

P: n/a
Hmmmm,

That's a tough one then. You could be losing packets... Someone could be
trying to infiltrate your system by messing with form data posted to it...
There are so many things this could be I don't even know where to begin.

You say 90% of the time the application is fine. Is that an exact figure? If
this is happening on 10% of all post backs I would certainly investigate it
further that's a very high number. But if it's really a lot less than that
then you may not need to worry about it at all...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:ul*************@TK2MSFTNGP15.phx.gbl...
Justin. Thanks for the reply, unfortunately, I'm told by my host:

"Your site is being hosted on one of our shared servers which is not a
clustered environment. Only our webfarm servers are in a clustered
environment, which your site is not on."

Any other ideas?

SJL
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:u0*************@TK2MSFTNGP15.phx.gbl...
sjl,

You should inquire of your webhost as to whether they are hosting via a
clustered environment. As the error states if they are you will need the
<machineKey> edited for the clusted environment.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
I've got an .aspx webform for searching my database. It basically takes
user input and passes it as a parm into a stored proc to search a table.
The results are returned in a SQLDataReader and bound to a datagrid on
the same page. It works 90% of the time as expected. However, for some
unknown reason, I randomly get the error below. The HttpException says
there is an 'Invalid_Viewstate'. Ok, but why? I'm posting back to the
same page. If the Viewstate is corrupt, then why?

I'm hosting at Orcs Web using shared hosting, ASP.NET 1.1, SQL 2000,
VS2003.

***********ERROR MESSAGE DETAILS******************
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.

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.LoadPageStateFromPersistenceMed ium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: xxxxxx
Port: 3639
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50215)
ViewState: dDwtMTUxMTMzMDAzMjt0 [clipped]
Http-Referer: http://xxxxxxxxxx/search.aspx
Path: /search.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +443
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447
***********ERROR MESSAGE DETAILS******************

Thanks for any help you can provide.
SJL



Nov 19 '05 #4

P: n/a
sjl
Thanks, Justin. After working through this with my host, they suggested two
things:

(a) move my site to a new appPool (same server, just a different appPool),
and
(b) add a machineKey value to my web.config.

Doing these two things appears to have corrected the problem. I believe the
problem is now resolved. Thanks for your suggestions.

SJL

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:ex**************@TK2MSFTNGP12.phx.gbl...
Hmmmm,

That's a tough one then. You could be losing packets... Someone could be
trying to infiltrate your system by messing with form data posted to it...
There are so many things this could be I don't even know where to begin.

You say 90% of the time the application is fine. Is that an exact figure?
If this is happening on 10% of all post backs I would certainly
investigate it further that's a very high number. But if it's really a lot
less than that then you may not need to worry about it at all...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:ul*************@TK2MSFTNGP15.phx.gbl...
Justin. Thanks for the reply, unfortunately, I'm told by my host:

"Your site is being hosted on one of our shared servers which is not a
clustered environment. Only our webfarm servers are in a clustered
environment, which your site is not on."

Any other ideas?

SJL
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:u0*************@TK2MSFTNGP15.phx.gbl...
sjl,

You should inquire of your webhost as to whether they are hosting via a
clustered environment. As the error states if they are you will need the
<machineKey> edited for the clusted environment.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
I've got an .aspx webform for searching my database. It basically takes
user input and passes it as a parm into a stored proc to search a
table. The results are returned in a SQLDataReader and bound to a
datagrid on the same page. It works 90% of the time as expected.
However, for some unknown reason, I randomly get the error below. The
HttpException says there is an 'Invalid_Viewstate'. Ok, but why? I'm
posting back to the same page. If the Viewstate is corrupt, then why?

I'm hosting at Orcs Web using shared hosting, ASP.NET 1.1, SQL 2000,
VS2003.

***********ERROR MESSAGE DETAILS******************
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.

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.LoadPageStateFromPersistenceMed ium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: xxxxxx
Port: 3639
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 1.1.4322; .NET CLR 2.0.50215)
ViewState: dDwtMTUxMTMzMDAzMjt0 [clipped]
Http-Referer: http://xxxxxxxxxx/search.aspx
Path: /search.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +443
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447
***********ERROR MESSAGE DETAILS******************

Thanks for any help you can provide.
SJL



Nov 19 '05 #5

P: n/a
sjl,

I'm glad you've figured it out!

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:OG***************@TK2MSFTNGP09.phx.gbl...
Thanks, Justin. After working through this with my host, they suggested
two things:

(a) move my site to a new appPool (same server, just a different appPool),
and
(b) add a machineKey value to my web.config.

Doing these two things appears to have corrected the problem. I believe
the problem is now resolved. Thanks for your suggestions.

SJL

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:ex**************@TK2MSFTNGP12.phx.gbl...
Hmmmm,

That's a tough one then. You could be losing packets... Someone could be
trying to infiltrate your system by messing with form data posted to
it... There are so many things this could be I don't even know where to
begin.

You say 90% of the time the application is fine. Is that an exact figure?
If this is happening on 10% of all post backs I would certainly
investigate it further that's a very high number. But if it's really a
lot less than that then you may not need to worry about it at all...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:ul*************@TK2MSFTNGP15.phx.gbl...
Justin. Thanks for the reply, unfortunately, I'm told by my host:

"Your site is being hosted on one of our shared servers which is not a
clustered environment. Only our webfarm servers are in a clustered
environment, which your site is not on."

Any other ideas?

SJL
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:u0*************@TK2MSFTNGP15.phx.gbl...
sjl,

You should inquire of your webhost as to whether they are hosting via a
clustered environment. As the error states if they are you will need
the <machineKey> edited for the clusted environment.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sjl" <no*****@email.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
> I've got an .aspx webform for searching my database. It basically
> takes user input and passes it as a parm into a stored proc to search
> a table. The results are returned in a SQLDataReader and bound to a
> datagrid on the same page. It works 90% of the time as expected.
> However, for some unknown reason, I randomly get the error below. The
> HttpException says there is an 'Invalid_Viewstate'. Ok, but why? I'm
> posting back to the same page. If the Viewstate is corrupt, then why?
>
> I'm hosting at Orcs Web using shared hosting, ASP.NET 1.1, SQL 2000,
> VS2003.
>
> ***********ERROR MESSAGE DETAILS******************
> 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.
>
> 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.LoadPageStateFromPersistenceMed ium() +102
>
> [HttpException (0x80004005): Invalid_Viewstate
> Client IP: xxxxxx
> Port: 3639
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
> .NET CLR 1.1.4322; .NET CLR 2.0.50215)
> ViewState: dDwtMTUxMTMzMDAzMjt0 [clipped]
> Http-Referer: http://xxxxxxxxxx/search.aspx
> Path: /search.aspx.]
> System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +443
> System.Web.UI.Page.LoadPageViewState() +18
> System.Web.UI.Page.ProcessRequestMain() +447
> ***********ERROR MESSAGE DETAILS******************
>
> Thanks for any help you can provide.
> SJL
>



Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.