tags:

views:

3386

answers:

7

Background: I developed a web app in ASP.Net 3.5 in C#. It runs great but now a few users have reported that they recieve an error sometimes. I have tried to duplicate the error but it has been hard. One time though when I let the app sit I came back later and tried to move it along and it errored out. I would think that has something to do with the timeout but I am using the view state.

Any ideas? When I look at the eventLog I do see the following error entry.

Thank You for your help and ideas!

John


My event log has the following errors:

Event code: 4005

Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.

Event time: 14/03/2008 13:19:26

Event time (UTC): 14/03/2008 13:19:26

Event ID: d9f0333c2eed46e0b0207da69d2ea70e

Event sequence: 154

Event occurrence: 5

Event detail code: 50202

A: 

This looks like an authentication issue. You probally have a timeout set on the authentication ticket which is expiring. If you use a sliding timeout then every time you hit the server the ticket will be renewed. If you don't your tickets will expire and you'll need to handle this case.


Edit:

You can check out this support article to see if it applies to you.

Also you can check out this view state viewer might help you determine if the view state is invalid.

Here's another good post from a Microsoft Escalation Engineer

JoshBerke
There is no authentication for the application either. Should I still set the form authentication tag?
JPJedi
hmmm if you have no authentication then I don't man...that error is very specific. Your positive your not using Forms Authentication
JoshBerke
A: 

There is another question on SO regarding this subject. Though not a real solution was given, it may give you a few pointers:

http://stackoverflow.com/questions/284709/error-4005-forms-authentication-failed-ticket-supplied-has-expired

In this topic, the application pool has also been mentioned (along with timeout issues like Josh mentioned), what apparantly has been the solution in this topic:

http://dev.communityserver.com/forums/p/483565/600599.aspx

Razzie
A: 

Here is the latest error:

Event code: 4009 Event message: Viewstate verification failed. Reason: The viewstate supplied failed integrity check. Event time: 3/15/2009 10:26:27 PM Event time (UTC): 3/16/2009 2:26:27 AM Event ID: 3b5be134005e49c3b40400bcaa5cb48d Event sequence: 56 Event occurrence: 1 Event detail code: 50203

Application information: Application domain: /LM/W3SVC/32/ROOT-1-128816433841748972 Trust level: Full Application Virtual Path: / Application Path: C:\Home\LocalUser\ucpga\Web\ Machine name: 169349-WEB2

Process information: Process ID: 8892 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE

Request information: Request URL: https://hr.ucpga.org:443/application.aspx Request path: /application.aspx User host address: 74.160.64.222 User:
Is authenticated: False Authentication Type:
Thread account name: 169349-WEB2\ucpga

ViewStateException information: Exception message: Invalid viewstate. Client IP: 74.160.64.222 Port: 1251 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; .NET CLR 1.1.4322; InfoPath.1)

JPJedi
You really need to stop posting answers. Use the comments or edit your question.
Geoffrey Chetwood
+1  A: 

I strongly doubt if this problem has anything to do with Viewstate. It has more to do with Session state and Authentication cookies.

Is your application running on a Web farm/garden ? If so, you should take a look at this article.

If not, this error can commonly occur if your FormsAuthenticationTicket timeout is less than the Session Timeout. What happens is that the Auth ticket expires sooner than the user's session and the next request is unable to be authenticated.

Cerebrus
A: 

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 3/12/2009 7:49:59 AM

Event time (UTC): 3/12/2009 11:49:59 AM

Event ID: 590ac0f6ad734d988e9e02f0fb7800eb

Event sequence: 52

Event occurrence: 1

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/32/ROOT-1-128813294498061103 

Trust level: Full 

Application Virtual Path: / 

Application Path: C:\Home\LocalUser\ucpga\Web\ 

Machine name: 169349-WEB2

Process information:

Process ID: 6912 

Process name: w3wp.exe 

Account name: NT AUTHORITY\NETWORK SERVICE
JPJedi
You really need to stop posting answers. Use the comments or edit your question.
Geoffrey Chetwood
+9  A: 

This issue can often be caused by having auto-generated <machineKey /> keys in your server's machine.config file. Each time your application starts afresh it will generate new keys. This invalidates any existing encrypted viewstate or forms authentication tickets.

Try setting the <machineKey /> validationKey and decryptionKey to fixed values. See the following link for more information:

How To: Configure MachineKey in ASP.NET 2.0 (MSDN)

HTH
Kev

Kev
A: 

This is a single server, not a web farm. There is no authentication but there is the view state. Currently there is no forms tag in my web.config. Do you think I need to add it since there is no authentication?

This error seems to be very random and hard to duplicate.

I am trying to test the site curently and even use the back button but I am having no luck with it.

Any ideas?

JPJedi
It doesn't matter whether you're running a web farm or not. As soon as the machineKey's are regenerated (because your app pool restarted, for example), you will encounter this problem. I recommend setting the machine keys to fixed values, then see what happens.
Kev
You really need to stop posting answers. Use the comments or edit your question.
Geoffrey Chetwood