JSON application connection to RDS MySQL

0

We are experiencing a connectivity problem within our web application and our RDS MySQL RDS database. The connection stopped to work 2 days ago without any real modification by us on the APP or DB. The only thing we had was an email by AWS saying " Update Your Amazon RDS and Amazon Aurora SSL/TLS Certificates by August 22, 2024". Entering in the RDS console effectivelly there was the request to update the certificate but the MySQL was up and running. Now we did the upgrade, MySQL is up and running but still no connection. Since the problem came out also before the CA update on RDS cannot be related to that..any idea? Thanks

FLAVIO
asked 8 months ago248 views
3 Answers
0
Accepted Answer

Hello.

What error do you get when connecting to RDS MySQL from your application?
Is it correct to assume that SSL communication is not used to connect from the application to RDS MySQL?

profile picture
EXPERT
answered 8 months ago
  • First, check the application error log. If you are using Apache on your web server, you will find error logs in the "/var/log/httpd/" directory, etc. Check the logs here to see what errors are being output during DB access.

  • Thanks for sharing the error. I see that you are using .NET in your application. Also, looking at the error, it seems that the error occurs because MySQL uses "utf8mb3", which is not supported by .NET. So, I think the solution is to connect to RDS MySQL using MySQL Client or something and change the character set of tables and databases to "utf8mb4". By the way, it is always recommended to create a snapshot of RDS before working in the database.

    Please check the following URL for commands that will help you change the character set. https://dba.stackexchange.com/questions/8239/how-to-easily-convert-utf8-tables-to-utf8mb4-in-mysql-5-5

  • Thanks. I will follow your advise and let you know

0

Thank you Riku for answer. The point is that it is not even clear. The application is a web page where you connect to a web page, chose a menu, it opens a new windwos where you login, you insert username and password and it give "Internal server error". The login step is when we connect to DB to check the user and in any case we did not touch anything on the EC2 and APP so...something changed on the EC2-RDS MySQL connection. To add more we also connect to our web via a mobile APP. On the mobile APP I embedded my username and infact the APP as soon as I launch it gives "Generic server Error" and crashes. Many thanks for any advise where we can look..

FLAVIO
answered 8 months ago
0

I'm looking and frankly it is very big. Viewing the timing I guess the connection moment is: Sep 7 08:15:11 ip-172-31-13-65 web: #033[41m#033[30mfail#033[39m#033[22m#033[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] Sep 7 08:15:11 ip-172-31-13-65 web: An unhandled exception has occurred while executing the request. Sep 7 08:15:11 ip-172-31-13-65 web: System.NotSupportedException: Character set 'utf8mb3' is not supported by .Net Framework. Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.CharSetMap.GetCharacterSet(DBVersion version, String charSetName) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding() Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.MySqlField.set_CharacterSetIndex(Int32 value) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.MySqlDataReader.NextResult() Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.MySqlDataReader.Close() Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.MySqlCommand.ResetReader() Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) Sep 7 08:15:11 ip-172-31-13-65 web: at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) Sep 7 08:15:11 ip-172-31-13-65 web: at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) Sep 7 08:15:11 ip-172-31-13-65 web: at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) Sep 7 08:15:11 ip-172-31-13-65 web: at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) Sep 7 08:15:11 ip-172-31-13-65 web: at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable) Sep 7 08:15:11 ip-172-31-13-65 web: at com.bomanstudio.core.dataaccess.MySQL.SQLExecute(String Sql, String ResultName, Int32 StartRecord, Int32 NumRecords) in C:\Projects\Libraries\com.bomanstudio.core.dataaccess\MySQL.cs:line 113 Sep 7 08:15:11 ip-172-31-13-65 web: at com.bomanstudio.core.dataaccess.MySQL.ExecuteSingleRow(String Sql) in C:\Projects\Libraries\com.bomanstudio.core.dataaccess\MySQL.cs:line 54 Sep 7 08:15:11 ip-172-31-13-65 web: at com.neodelis.central.webcore.Pages.api.APIDoLoginModel.OnPost() in C:\Progetti\WEB\com.neodelis.central.api\com.neodelis.central.webcore\Pages\api\APIDoLogin.cshtml.cs:line 48 Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted ) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Sep 7 08:15:11 ip-172-31-13-65 web: --- End of stack trace from previous location where exception was thrown --- Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Sep 7 08:15:11 ip-172-31-13-65 web: at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) Sep 7 08:16:02 ip-172-31-13-65 dhclient[2777]: XMT: Solicit on eth0, int

..then understanding the issue and were is come from is another task...

Many thanks

FLAVIO
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions