We are stuck with an issue while hosting our application on the Azure app service. Can someone help us to find the root cause of the issue? Also please post if more information is required.
We are getting this issue while trying to establish a database connection. Our database also exists on Azure as SQL Managed Instance and we are using Active Directory Managed Identity to create the connection.
Your app crashed because of Stack Buffer Overrun Exception and aborted the requests it was processing when the overflow occurred. As a result, your app’s users may have experienced HTTP 502 errors
This call stack caused the exception:
InlinedCallFrame
InlinedCallFrame
DomainBoundILStubClass.IL_STUB_PInvoke
Microsoft.Data.SqlClient.SNILoadHandle..ctor
Microsoft.Data.SqlClient.SNILoadHandle..ctor
Microsoft.Data.SqlClient.SNILoadHandle..cctor
GCFrame
HelperMethodFrame
Microsoft.Data.SqlClient.TdsParser..cctor
GCFrame
HelperMethodFrame
Microsoft.Data.SqlClient.TdsParser..ctor
Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover
Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist
Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor
Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection
Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection
Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject
Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest
Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection
Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection
Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection
Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal
Microsoft.Data.SqlClient.SqlConnection.TryOpenInner
Microsoft.Data.SqlClient.SqlConnection.TryOpen
Microsoft.Data.SqlClient.SqlConnection.Open
mmd.DBConnection.establishConnection
NewAuthentication.OnPageLoad
System.Web.UI.Control.OnLoad
System.Web.UI.Control.LoadRecursive
System.Web.UI.Page.ProcessRequestMain
System.Web.UI.Page.ProcessRequest
System.Web.UI.Page.ProcessRequest
System.Web.UI.Page.ProcessRequest
ASP.classic_common_newauthentication_aspx.ProcessRequest
System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute
System.Web.HttpApplication+<>c__DisplayClass285_0.b__0
System.Web.HttpApplication.ExecuteStepImpl
System.Web.HttpApplication.ExecuteStep
System.Web.HttpApplication+PipelineStepManager.ResumeSteps
System.Web.HttpApplication.BeginProcessRequestNotification
System.Web.HttpRuntime.ProcessRequestNotificationPrivate
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification
DomainNeutralILStubClass.IL_STUB_ReversePInvoke
InlinedCallFrame
InlinedCallFrame
DomainNeutralILStubClass.IL_STUB_PInvoke
System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper
System.Web.Hosting.PipelineRuntime.ProcessRequestNotification
DomainNeutralILStubClass.IL_STUB_ReversePInvoke
ContextTransitionFrame
Thanks Everyone,
The issue was with the latest version of Microsoft.Data.SqlClient. As per the article below we downgraded the package and our issue was fixed.