Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix System.Net.Sockets.SocketException

I'm working on an ASP.NET MVC website, it has been installed on three different servers (the same code version), it works on two of the servers i.e the user can login, but on one server after the user has submitted their username and password, the following server error is displayed in the browser:

Security Exception

System.Security.SecurityException: Token not found

The event viewer for the environment the error is occuring on shows the following two error messages at the point where th euser attempts to login:

Could not init pool.
System.Net.Sockets.SocketException (0x80004005): 
A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because 
connected host has failed to respond (server ip address)

And this error:

Error: System.Security.SecurityException: Token not found

Which is the server error displayed in the browser. This has in the past been resolved by deleting an authentication cookie, but that doesn't work for this error.

I have tried setting the trust level in the web.config to full which didn't work. I have tried restarting IIS.

Has anyone else come accross a similar problem? Could this problem be caused because a service of some kind isn't running? Any suggestions will be appreciated.

like image 303
Theomax Avatar asked Dec 24 '12 12:12

Theomax


1 Answers

Most of the time these are connectivity timeouts due to different IP protocols (IPV4/IPV6) between the two server/computers trying to communicate or extra authentication rules setup on one of the computers for outgoing or incoming connectivity. Ways to troubleshoot the issue:

  1. Review IIS logs
  2. Review EventLogs
  3. Try adjusting TCP/IP parameters in the registry to increase the time allowed to connect

http://msdn.microsoft.com/en-us/library/aa560610(d=printer,v=bts.20).aspx

Even though the above article references Windows 2003, I've discovered it applies to some 2008 environments.

like image 155
Sharon Harvey Avatar answered Sep 21 '22 05:09

Sharon Harvey