Solved

Validation of viewstate MAC failed

Posted on 2014-11-05
8
460 Views
Last Modified: 2014-11-12
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.   at System.Web.UI.ViewStateException.ThrowMacValidationError(Except

hello everyone

i have seen some error in my sql server logs. hear is

####

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.   at System.Web.UI.ViewStateException.ThrowMacValidationError(Except

####

i have two web servers and one sql server. for load balancing i have used dns round-robin.

in iis server i have manually created machinKey and submit sam in two servers but the log still exist

please suggest what to do.
0
Comment
Question by:ameriaadmin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 28

Expert Comment

by:Dan McFadden
ID: 40425724
I would review this Microsoft support article:

Link:  https://support.microsoft.com/kb/2915218?wa=wsignin1.0

One of the take aways from the article is to use some sort of sticky session, meaning that a user session stays with the first server to respond to the initial http/https request.  DNS Round Robin could be causing your viewstate issues.

Dan
0
 

Author Comment

by:ameriaadmin
ID: 40425840
good url, i have done it , but still have error
0
 
LVL 28

Expert Comment

by:Dan McFadden
ID: 40425875
Have you tried the application without the DNS round robin?  I would remove 1 of the servers from the round robin config and test the application.  Viewstate can not be shared across servers.

Dan
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ameriaadmin
ID: 40425898
yes, from one server it works without errors.
0
 
LVL 28

Expert Comment

by:Dan McFadden
ID: 40425916
Then I'll go back to saying that issue probably lies with the load balancing method (DNS Round Robin) you are using.

You cannot share viewstate across servers without building (programming or thirds party software) some sort functionality to do so.  Since a typical HTTP request is stateless, you would need to have some mechanism in place to share session data or to persist data across servers.  You could accomplish this with a third server running a session manager, known as out-of-proc session, but this adds a little to the application's latency.  There is also third party software which you could install on all servers in the web farm, which stores and replicates the session info so you could use a load balancing method like least-response-time or DNS Round Robin.

The other option would be to store this data in a database but you would still need to build functionality to persist that data with the next inbound request.  Essentially you would be building a SQL backed persistent cache.

Again, I recommend using a load balancing method where the initial request and all subsequent requests for a session are sent to the server that responds to the first request.  This is typically referred to as "Sticky Sessions."  DNS Round Robin is not effective in your defined situation.

Dan
0
 
LVL 28

Accepted Solution

by:
Dan McFadden earned 500 total points
ID: 40425925
Here is a decent article that describes the challenges you are having:

http://www.dzone.com/articles/optimize-aspnet-performance
0
 

Author Comment

by:ameriaadmin
ID: 40439303
thank you the article was very helpful.
0
 

Author Closing Comment

by:ameriaadmin
ID: 40439305
we disable View State Caching
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sorting a SQL script 5 42
Modifying Powershell to list all server with SQL Server running ? 4 27
sql server query 9 28
T-SQL syntax error 3 11
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question