Showing posts with label coded. Show all posts
Showing posts with label coded. Show all posts

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.

Tuesday, March 13, 2012

System.Security.SecurityException: Request failed.

i have uploaded a web site on a server and it is runnig but

when i try to access those pages on which i have coded to get data form ms access databae i received the following error

how can i correct this problem

the error is as following

Server Error in '/' Application.

Security Exception

Description:The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details:System.Security.SecurityException: Request failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SecurityException: Request failed.] Data.createsession.startsession(String name, String password) +0 RUGUI.admin1.Button1_Click(Object sender, EventArgs e) in admin.aspx.vb:35 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +2112 System.Web.UI.Page.ProcessRequest() +218 System.Web.UI.Page.ProcessRequest(HttpContext context) +18 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179 System.Web.HttpApplication.ExecuteStep


Does the ASPNET user, which ASP.NET runs under, have permissions to the Access database?

NC...


Your site is working in a medium trust or even low.

If you are hosting the site with a company then you have to ask them to increase the trust level. If you are running this in your server, then you should know that when you use OLD DB, this is out of the medium trust privileges. You can get that working with some modifications in the maching.config and web.config if you are using ASP.NET 2.0

Check the following articles at servertastic

http://www.servertastic.com/articles/category/aspnet/

Let me know if you need further info

Regards