generated from DbUp/dbup-provider-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Library Version
6.0.1-beta.41
What happened?
The problem can be seen here, is LogInformation intended instead of using LogError(exception, ..) ? I guess it was not updated because dbup-mysql moved to Microsoft logging style, in my case it's problematic because: I can't handle this exception, I have to create own implementation of logger and check if format argument is a Database not found on server with connection string in settings, instead I want to fail my app by handling this exception (for example re-throwing the exception) and outputting more information about what happened.
Relevant log output
2024-07-28 21:15:02 Database not found on server with connection string in settings: Unable to connect to any of the specified MySQL hosts.
2024-07-28 21:15:02 Unhandled exception. MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
2024-07-28 21:15:02 ---> System.Net.Sockets.SocketException (111): Connection refused
2024-07-28 21:15:02 at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
2024-07-28 21:15:02 at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
2024-07-28 21:15:02 at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
2024-07-28 21:15:02 --- End of stack trace from previous location ---
2024-07-28 21:15:02 at System.Net.Sockets.TcpClient.CompleteConnectAsync(Task task)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.NativeDriver.<>c.<OpenAsync>b__38_0(Exception ex)
2024-07-28 21:15:02 at System.AggregateException.Handle(Func`2 predicate)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.NativeDriver.OpenAsync(Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.Driver.OpenAsync(Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.Driver.CreateAsync(MySqlConnectionStringBuilder settings, Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.Driver.CreateAsync(MySqlConnectionStringBuilder settings, Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnectionAsync(Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.MySqlPool.GetPooledConnectionAsync(Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.MySqlPool.TryToGetDriverAsync(Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.MySqlPool.GetConnectionAsync(Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.MySqlConnection.OpenAsync(Boolean execAsync, CancellationToken cancellationToken)
2024-07-28 21:15:02 at MySql.Data.MySqlClient.MySqlConnection.Open()
2024-07-28 21:15:02 at MySqlExtensions.MySqlDatabase(SupportedDatabasesForEnsureDatabase supported, String connectionString, IUpgradeLog logger, Int32 timeout, String collation) in /_/src/dbup-mysql/MySqlExtensions.cs:line 172
2024-07-28 21:15:02 at MySqlExtensions.MySqlDatabase(SupportedDatabasesForEnsureDatabase supported, String connectionString) in /_/src/dbup-mysql/MySqlExtensions.cs:line 98
2024-07-28 21:15:02 at UnturnedGuardAPI.App.Configurations.DependencyInjection.PrepareDatabases(IConfiguration configuration) in /src/src/UnturnedGuardAPI.App/Configurations/DependencyInjection.cs:line 28
2024-07-28 21:15:02 at Program.<Main>$(String[] args) in /src/src/UnturnedGuardAPI.App/Program.cs:line 5
2024-07-28 21:15:02 at Program.<Main>(String[] args)Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working