Saturday, March 24, 2012

System.Net.Sockets.SocketException: An established connection was aborted by the software

Hello, I got this error today in an Application. This app is coded in asp.net 2, using VB. I have the Andri Code (http://makoto.madmedia.ca/2007/03/mysql-membership-and-role-provider-for.html) to connect asp.net with mysql. It has never caused errors in the past, I have the same configuration on another app that has been running for several months with no problem.

This app is new (1 week) and today is the first day I see this error.

Any ideas?

Server Error in '/' Application.
------------------------

An established connection was aborted by the software in your host machine
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.

Exception Details: System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine

Source Error:


Line 859:
Line 860:
Line 861: conn.Open();
Line 862: using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
Line 863: {

Source File: d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs Line: 861

Stack Trace:


[SocketException (0x2745): An established connection was aborted by the software in your host machine]
System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +1019099
MySql.Data.Common.SocketStream.Write(Byte[] buffer, Int32 offset, Int32 count) +22
System.IO.BufferedStream.FlushWrite() +21
System.IO.BufferedStream.Flush() +26
MySql.Data.MySqlClient.MySqlStream.Flush() +119
MySql.Data.MySqlClient.NativeDriver.ExecuteCommand(DBCmd cmd, Byte[] bytes, Int32 length) +114
MySql.Data.MySqlClient.NativeDriver.SetDatabase(String dbName) +29
MySql.Data.MySqlClient.MySqlConnection.ChangeDatabase(String database) +68
MySql.Data.MySqlClient.MySqlConnection.Open() +323
Andri.Web.MySqlMembershipProvider.ValidateUser(String username, String password) in d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs:861
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +171
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213

Do you have a firewall on your machine? This may be preventing your app from accessing MySQL via TCP/IP.

One other problem where I received this error was when I built a client/server app, and one machine had IPv6 protocol installed but the other machine had IPv4 (same domain/network). When I changed both to IPv4, it worked.


Hello, I have other apps with the same configuration running in the same machine so I think the firewall is not an option.

This is not a standalone app, it is a web app.


Hi vialetti,

I am afraid to say that it seems a bug said from MySql community. Here is link:http://bugs.mysql.com/bug.php?id=6634

Hope this helps. Thanks.

0 comments:

Post a Comment