Mysql and Amazon RDS error "Error openning connection to the database"

Mysql and Amazon RDS error "Error openning connection to the database"

  

We are using amazon EC2 as webserver connecting to MySQL in RDS and the applications are running without errors, most of the times, but we are geeting several warnings in windows event log:


Error openning connection to the database: Authentication to host '<server-name>.rds.amazonaws.com' for user 'OSRUNTIME' using method 'mysql_native_password' failed with message: Reading from the stream has failed.
Retrying...

   at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.AuthenticationFailed(Exception ex)
   at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket()
   at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset)
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at OutSystems.HubEdition.Extensibility.Data.TransactionService.BaseTransactionService.GetConnection()
   at OutSystems.HubEdition.Extensibility.Data.TransactionService.BaseTransactionService.CreateConnection(Int32 numRetries)
   at OutSystems.HubEdition.Extensibility.Data.TransactionService.BaseTransactionService.CreateConnection(Int32 numRetries)
   at OutSystems.HubEdition.DatabaseProvider.MySQL.Platform.Session.MySQLPlatformSessionService.ResetModuleTimeout(String sessionId)
   at OutSystems.HubEdition.RuntimePlatform.SessionState.SqlSessionStateStore.ResetItemTimeout(HttpContext context, String id)
   at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
   at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)
   at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
   at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
   at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)


Any ideia what this means and how to solve it.


Thanks

Hello, Carlos.

This is actually a known MySQL issue that occurs in the currently supported MySQL version. More details here: https://bugs.mysql.com/bug.php?id=76597

If you notice the stack trace, you will observe that this failure occurs while trying to obtain a connection. The suggested workaround for this issue is to tolerate the error and try to obtain a new database connection. That is exactly what the OutSystems Platform already does.

Whenever an application obtains a database connection, the OutSystems Platform retries for a maximum of 5 times in case there is an error (1 second interval in-between). Every failure is logged for troubleshooting purposes, which explains the presence of those entries in the Windows Event Log.

This means there is no significant impact to your applications, except for small delay while the retrying mechanism does its job.

It also means there isn't anything you can do about it on your side. On the platform side, the workaround is already implemented. All that is left is to wait for a fix in MySQL.

If you have any further questions, please do not hesitate.


Best regards,

Rui Garcia

Rui Garcia wrote:

Hello, Carlos.

This is actually a known MySQL issue that occurs in the currently supported MySQL version. More details here: https://bugs.mysql.com/bug.php?id=76597

If you notice the stack trace, you will observe that this failure occurs while trying to obtain a connection. The suggested workaround for this issue is to tolerate the error and try to obtain a new database connection. That is exactly what the OutSystems Platform already does.

Whenever an application obtains a database connection, the OutSystems Platform retries for a maximum of 5 times in case there is an error (1 second interval in-between). Every failure is logged for troubleshooting purposes, which explains the presence of those entries in the Windows Event Log.

This means there is no significant impact to your applications, except for small delay while the retrying mechanism does its job.

It also means there isn't anything you can do about it on your side. On the platform side, the workaround is already implemented. All that is left is to wait for a fix in MySQL.

If you have any further questions, please do not hesitate.


Best regards,

Rui Garcia

Thanks Rui for the details and confirmation , Hope MySQL team will fix in coming release.