Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Very frequent error - Validation of viewstate MAC failedVery frequent error - Validation of viewstate MAC failed
Previous
 
Next
New Post
6/4/2010 7:43 AM
 
I get hundreds of these errors in my eventlog every day. I did some searching and it seems to be very common with no resolution.

Here is a very good post about it, although it says upgrading to .NET 3.5 SP 1 should resolve it, which it does not. It says:
1. You aren't using a web farm. (true)
2. It appears when using built-in databound controls such as GridView, DetailsView or FormView which utilize “DataKeyNames”.   (false - on the login page in this error below)
3. It appears if you have a large page which loads slowly for any reason.  (true on some pages)

If you look at the solutions offered in that post, Option 1 is not an option for a public site - Option 2 and 3 sound interesting but would require a core change - has anyone experienced this problem or tried something like this?

I also found this article on Microsoft about it - it says "Note If you set the value of the aspnet:IgnoreFormActionAttribute key to "false" in the web.config file, ASP.NET will honor the "action" attribute of the form." - what are the implications of this?

AssemblyVersion
: 5.2.2
PortalID: 6
PortalName: PokerDIY
UserID: -1
UserName
ActiveTabID: 636
ActiveTabName: Login
RawURL: /login.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://www.pokerdiy.com/login.aspx
UserAgent: Mozilla/1.22 (compatible; MSIE 2.0d; Windows NT)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: ea7c4753-5922-44ce-82b5-0f2fd4c70912
InnerException: 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.
FileName
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.Configuration.MachineKeySection.GetDecodedData
StackTrace
Message: DotNetNuke.Services.Exceptions.PageLoadException: 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.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. ---> System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 188.92.72.168 Port: 1738 User-Agent: Mozilla/1.22 (compatible; MSIE 2.0d; Windows NT) ViewState: /wEPDwUKMTYwNjM1MDk3Mg9kFgZmDxYCHgRUZXh0BYABDQoJCTwhRE9DVFlQRSBodG1sIFBVQkxJQyAiLS8vVzNDLy9EVEQgWEhUTUwgMS4wIFRyYW5zaXRpb25hbC8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9UUi94aHRtbDEvRFREL3hodG1sMS10cmFuc2l0aW9uYWwuZHRkIj4NCglkAgEPZBYOAgQPFgIeB1Zpc2libGVoZAIFDxYCHgdjb250ZW50BRFMb2dpbiB0byBQb2tlckRJWWQCBg8WAh8CBQVMb2dpbmQCBw8WAh8CBR5Db3B5cmlnaHQgKGMpIDIwMTAgYnkgUG9rZXJESVlkAggPFgQfAmQfAWhkAgkPFgIfAgUIUG9rZXJESVlkAgwPFgIfAgUNSU5ERVgsIEZPTExPV2QC Referer: http://www.pokerdiy.com/login.aspx Path: /Default.aspx ---> System.Web.HttpException: Unable to validate data. at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPersistenceMedium() at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source
Server Name: AS45R95

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
7/13/2010 2:09 PM
 
We're having the same problem using DataSprings Dynamic Login:

AssemblyVersion: 5.4.4
PortalID: 0
PortalName: My Portal Name
UserID: 21
UserName: UserNameTest
ActiveTabID: 456
ActiveTabName: Login
RawURL: /GeneralInfo/Login.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://www.mydomain.org/GeneralInfo/Login.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Creative AutoUpdate v1.40.01)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: eec8a4d8-ee56-4eb8-8eec-76a46fd8bab1
InnerException: 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.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.Configuration.MachineKeySection.GetDecodedData
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: 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.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. ---> System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 67.176.28.77 Port: 61359 User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Creative AutoUpdate v1.40.01) ViewState: /wEPDwULLTE2NDIyOTEzMjkPZBYGZg8WAh4EVGV4dAV5PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFsLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25hbC5kdGQiPmQCAQ9kFg4CBA8WAh4HVmlzaWJsZWhkAgUPFgIeB2NvbnRlbnQFBUxvZ2luZAIGDxYCHwIFN0hpZ2hsYW5kcyBSYW5jaCwgQ29tbXVuaXR5LCBBc3NvY2lhdGlvbiwsRG90TmV0TnVrZSxETk5kAgcPFgIfAgU6Q29weXJpZ2h0IDIwMTAgSGlnaGxhbmRzIFJhbmNoIENvbW11bml0eSBBc3NvY2lhdGlvbiwgSW5jLmQCCA8WAh8CBQtEb3ROZXROdWtlIGQCCQ8WAh8CBQtIUkNBIE9ubGluZWQCDA8WAh8CBQ1JTkRFWCwgRk9MTE9XZAICD2QWAgIBD2QWBAIED2QWAmYPZBYqZg9kFgJmD2QWAmYPFgIfAWgWAmYPZBYCZg9kFgYCAw8QZGQWAGQCDw9kFgJmDw8WBh4ISW1hZ2VVcmwFFC9pbWFnZXMvY29sbGFwc2UuZ2lmHg1BbHRlcm5hdGVUZXh0BQhNaW5pbWl6ZR4HVG9vbFRpcAUITWluaW1pemUWCh4HdXNl... ---> System.Web.HttpException: Unable to validate data. at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPersistenceMedium() at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: VMS

After clicking the "Continue" link in Dynamic Login, a generic DNN page error occurs, however the user is logged in - you just can't cick the Continue link. Clicking any other page/menu item works just fine. This worked fine until the site was upgraded to DNN 5.4.4. I've uninstalled and reinstalled Dynamic Login, but the problem still exists. The error occurs for any login setup with Dynamic Login setup with the security rule option.

-Tim
 
New Post
7/13/2010 9:24 PM
 
Yep, same here.  None of the KB articles of suggested fixes have fixed this for me.
 
New Post
7/26/2010 9:38 PM
 
Hi guys... For those having this error with Dynamic Login. I have spent some time over the last hour on a 5.5 Alpha release and the both good and bad news is that I can duplicate this on the latest 5.5 version (probably would be the same for 5.4 as well). This appears to happen only when there is a ‘Display After Message’ for a role or role group and only then where the redirect event happens for continue link. So, I have some updates coming up for Dynamic Login and ill make sure this is changed or supported (at least tested to see why) for this updated version. I have told the client I should have their enhancements added within a week so this will be a good time for me to test and work on this as well. I also thought of an easy work around. Can you… 1. Change the language/location resource files for ‘Continue’ to be blank’ and then 2. Put the continue link directly in the message displayed to the user? From what I can tell there is no bug if you don’t display a message with the continue link and just redirect the user, so maybe if you need the message you can just put the link in the message itself? Thanks,. Chad www.datasprings.com
 
New Post
10/20/2010 7:03 AM
 
I have been banging my head with this for few weeks now and have found finally what is causing it.
DNN has introduced a security measure to defend from Cross Site Request forgery by adding following lines in Page_Init event

If User.Identity.IsAuthenticated Then
 ViewStateUserKey = User.Identity.Name
End If

This security feature although valid has one weakness.
Depending on your forms authentication timeout, authenticated user that is idling for a long time (Longer than your cookie authentication timeout) will receive this message once they resume with work.
To resolve this issue I had to do the following :

1.Set form authentication timeout less than your session timeout in web config
e.g <forms name=".DOTNETNUKE" protection="All" timeout="18" cookieless="UseCookies" /> (18 minutes)
DNN does not use sessions, but default session timeout is 20 minutes if they are used

2.Replace
If User.Identity.IsAuthenticated Then
 ViewStateUserKey = User.Identity.Name
End If

With

If Session("ViewStateUserKey") Is Nothing Then
    Session("ViewStateUserKey") = New Guid().ToString()
End If
ViewStateUserKey = Session("ViewStateUserKey").ToString()

This solution is not ideal if you dont want to use a session or you are hosting in Web Farm and do not optimize sticky sessions, State Server or Distributed Caching like App Fabric aka Velocity.
In that case, you could implement different approach by generating unique user key found here : http://www.webpronews.com/expertartic...

To understand the problem in more details, check this article :
http://www.hanselman.com/blog/ViewSta...
or google for ViewStateUserKey

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Very frequent error - Validation of viewstate MAC failedVery frequent error - Validation of viewstate MAC failed


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out