Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mono 6.0.0.319 not working with MySqlData.dll 8.0.15 #16513

@ghost

Description

TestCase.zip

Issue: I am using MySql with Mono. When using Mono 5.16.0.220, the included test case is able to open and close a connection with no error. After upgrading to mono 6.0.0.319 the test case no longer works, and throws and unhandled exception.

Steps to Reproduce

  1. Build the test case using "csc TestExample.cs -r:System.Data.dll -r:MySql.Data.dll"
  2. Run the test case with "mono TestExample.exe"

Current Behavior

I get an error message "MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. ---> System.AggregateException: One or more errors occurred. (None of the discovered or specified addresses match the socket address family.) ---> System.ArgumentException: None of the discovered or specified addresses match the socket address family."

With version 5.16.0.220 of Mono, this code ran without throwing any exceptions.

Expected Behavior

No output, and no exception thrown. A connection is opened and closed without issues.

On which platforms did you notice this

[ ] macOS
[x ] Linux
[x ] Windows

Version Used:

Mono 6.0.0.319
MySql.Data.dll 8.0.15
Ubuntu 18.04.3 LTS (Bionic Beaver)
Debian GNU/Linux 9 (stretch)
Windows 10 Pro

Stacktrace

Unhandled Exception:
MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. ---> System.AggregateException: One or more errors occurred. (None of the discovered or specified addresses match the socket address family.) ---> System.ArgumentException: None of the discovered or specified addresses match the socket address family.
at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x00014] in :0
at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in :0
at System.Net.Sockets.TcpClient.EndConnect (System.IAsyncResult asyncResult) [0x0000c] in :0
at System.Threading.Tasks.TaskFactory1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func2[T,TResult] endFunction, System.Action1[T] endAction, System.Threading.Tasks.Task1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in <1de765ba3181400cbd01ab9960c2a928>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <1de765ba3181400cbd01ab9960c2a928>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <1de765ba3181400cbd01ab9960c2a928>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout) [0x00000] in <1de765ba3181400cbd01ab9960c2a928>:0
at MySql.Data.Common.StreamCreator.GetTcpStream (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x0001f] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.Common.StreamCreator.GetStream (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00021] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.NativeDriver.Open () [0x00007] in <091acd56583e48c19623fa46d3a21a2a>:0
---> (Inner Exception #0) System.ArgumentException: None of the discovered or specified addresses match the socket address family.
at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x00014] in :0
at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in :0
at System.Net.Sockets.TcpClient.EndConnect (System.IAsyncResult asyncResult) [0x0000c] in :0
at System.Threading.Tasks.TaskFactory1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func2[T,TResult] endFunction, System.Action1[T] endAction, System.Threading.Tasks.Task1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in <1de765ba3181400cbd01ab9960c2a928>:0 <---

at MySql.Data.MySqlClient.NativeDriver.Open () [0x00041] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.Driver.Open () [0x0000e] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x0004e] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.MySqlConnection.Open () [0x0016d] in <091acd56583e48c19623fa46d3a21a2a>:0
at Test.Main (System.String[] args) [0x0000e] in <32fef4333af94fdb978d14acf784480c>:0
[ERROR] FATAL UNHANDLED EXCEPTION: MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. ---> System.AggregateException: One or more errors occurred. (None of the discovered or specified addresses match the socket address family.) ---> System.ArgumentException: None of the discovered or specified addresses match the socket address family.
at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x00014] in :0
at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in :0
at System.Net.Sockets.TcpClient.EndConnect (System.IAsyncResult asyncResult) [0x0000c] in :0
at System.Threading.Tasks.TaskFactory1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func2[T,TResult] endFunction, System.Action1[T] endAction, System.Threading.Tasks.Task1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in <1de765ba3181400cbd01ab9960c2a928>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <1de765ba3181400cbd01ab9960c2a928>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <1de765ba3181400cbd01ab9960c2a928>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout) [0x00000] in <1de765ba3181400cbd01ab9960c2a928>:0
at MySql.Data.Common.StreamCreator.GetTcpStream (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x0001f] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.Common.StreamCreator.GetStream (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00021] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.NativeDriver.Open () [0x00007] in <091acd56583e48c19623fa46d3a21a2a>:0
---> (Inner Exception #0) System.ArgumentException: None of the discovered or specified addresses match the socket address family.
at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x00014] in :0
at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in :0
at System.Net.Sockets.TcpClient.EndConnect (System.IAsyncResult asyncResult) [0x0000c] in :0
at System.Threading.Tasks.TaskFactory1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func2[T,TResult] endFunction, System.Action1[T] endAction, System.Threading.Tasks.Task1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in <1de765ba3181400cbd01ab9960c2a928>:0 <---

at MySql.Data.MySqlClient.NativeDriver.Open () [0x00041] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.Driver.Open () [0x0000e] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x0004e] in <091acd56583e48c19623fa46d3a21a2a>:0
at MySql.Data.MySqlClient.MySqlConnection.Open () [0x0016d] in <091acd56583e48c19623fa46d3a21a2a>:0
at Test.Main (System.String[] args) [0x0000e] in <32fef4333af94fdb978d14acf784480c>:0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions