Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to Azure MySQL fails #259

Closed
bgrainger opened this issue May 11, 2017 · 4 comments
Closed

Connecting to Azure MySQL fails #259

bgrainger opened this issue May 11, 2017 · 4 comments
Assignees
Labels

Comments

@bgrainger
Copy link
Member

@bgrainger bgrainger commented May 11, 2017

Create an Azure MySQL 5.7 instance and attempt to connect to it.

A NullReferenceException is thrown:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at MySql.Data.MySqlClient.MySqlConnection.CloseDatabase()
   at MySql.Data.MySqlClient.MySqlConnection.DoClose()
   at MySql.Data.MySqlClient.MySqlConnection.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at Program.<DoStuffAsync>d__1.MoveNext() in C:\Program.cs:line 10

After fixing this bug in CloseDatabase, we get the underlying exception:

Unhandled Exception: System.FormatException: Expected to read 0x00 but got 0xFE
   at MySql.Data.ByteArrayReader.ReadByte(Byte value)
   at MySql.Data.Serialization.OkPayload.Create(PayloadData payload)
   at MySql.Data.Serialization.MySqlSession.<ConnectAsync>d__48.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at MySql.Data.MySqlClient.ConnectionPool.<GetSessionAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at MySql.Data.MySqlClient.MySqlConnection.<CreateSessionAsync>d__66.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at MySql.Data.MySqlClient.MySqlConnection.<OpenAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MySql.Data.MySqlClient.MySqlConnection.Open()

When connecting, we are expecting to get an OK packet, but the server is sending a change authentication packet instead.

@bgrainger bgrainger added the bug label May 11, 2017
@bgrainger bgrainger self-assigned this May 11, 2017
@bgrainger
Copy link
Member Author

@bgrainger bgrainger commented May 11, 2017

Fixed in 0.19.3.

@yukozh
Copy link

@yukozh yukozh commented May 11, 2017

For networking issues, please feel free to contact to Xiangyu. He will help you to solve these.

@bgrainger
Copy link
Member Author

@bgrainger bgrainger commented May 11, 2017

This bug was due to Azure Database for MySQL not supporting "fast path" authentication; I've made a suggestion on the MSDN forums.

@yukozh
Copy link

@yukozh yukozh commented May 23, 2017

COM_CHANGE_USER issue tracking in TFS #51448, If there are any news, I will post here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants