wmnnd
Mariaex Handshake Error with Azure Database for MySQL
Hey there,
I’ve just been toying around with MS Azure a bit and I’ve been unable to connect to an Azure Database for MySQL server with Ecto/Mariaex.
When I try launch my application or run migrations, it crashes with the following error message:
09:44:48.179 [error] GenServer #PID<0.175.0> terminating
** (FunctionClauseError) no function clause matching in Mariaex.Messages.decode_msg/2
(mariaex) lib/mariaex/messages.ex:261: Mariaex.Messages.decode_msg(<<254, 109, 121, 115, 113, 108, 95, 110, 97, 116, 105, 118, 101, 95, 112, 97, 115, 115, 119, 111, 114, 100, 0, 51, 30, 66, 85, 81, 127, 123, 34, 125, 97, 115, 105, 99, 4, 34, 102, 93, 10, 30, 84, 0>>, :handshake_send)
(mariaex) lib/mariaex/messages.ex:225: Mariaex.Messages.decode/2
(mariaex) lib/mariaex/protocol.ex:1102: Mariaex.Protocol.msg_decode/2
(mariaex) lib/mariaex/protocol.ex:1070: Mariaex.Protocol.msg_recv/3
(mariaex) lib/mariaex/protocol.ex:155: Mariaex.Protocol.handshake_recv/2
(db_connection) lib/db_connection/connection.ex:134: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
State: Mariaex.Protocol
** (exit) exited in: :gen_server.call(#PID<0.175.0>, {:checkout, #Reference<0.2452934895.1515978754.176436>, true, :infinity}, 5000)
** (EXIT) an exception was raised:
** (FunctionClauseError) no function clause matching in Mariaex.Messages.decode_msg/2
(mariaex) lib/mariaex/messages.ex:261: Mariaex.Messages.decode_msg(<<254, 109, 121, 115, 113, 108, 95, 110, 97, 116, 105, 118, 101, 95, 112, 97, 115, 115, 119, 111, 114, 100, 0, 51, 30, 66, 85, 81, 127, 123, 34, 125, 97, 115, 105, 99, 4, 34, 102, 93, 10, 30, 84, 0>>, :handshake_send)
(mariaex) lib/mariaex/messages.ex:225: Mariaex.Messages.decode/2
(mariaex) lib/mariaex/protocol.ex:1102: Mariaex.Protocol.msg_decode/2
(mariaex) lib/mariaex/protocol.ex:1070: Mariaex.Protocol.msg_recv/3
(mariaex) lib/mariaex/protocol.ex:155: Mariaex.Protocol.handshake_recv/2
(db_connection) lib/db_connection/connection.ex:134: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
(db_connection) lib/db_connection/poolboy.ex:112: DBConnection.Poolboy.checkout/3
(db_connection) lib/db_connection.ex:920: DBConnection.checkout/2
(db_connection) lib/db_connection.ex:742: DBConnection.run/3
(db_connection) lib/db_connection.ex:1133: DBConnection.run_meter/3
(db_connection) lib/db_connection.ex:584: DBConnection.prepare_execute/4
(ecto) lib/ecto/adapters/mysql/connection.ex:22: Ecto.Adapters.MySQL.Connection.execute/4
(ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
(ecto) lib/ecto/adapters/sql.ex:193: Ecto.Adapters.SQL.query!/5
I haven’t been able to look too much into it but it seems that the binary string is a response from the MySQL server; the binary in the error message begins with << 254 >> (as seems to be expected by Mariaex) and then continues with the string mysql_native_password.
If anyone has come across this issue before I’d be interested in how they resolved it before I spend hours trying to troubleshoot it further 
Popular in Questions
In Ruby, I can go:
User.find_by(email: "foobar@email.com").update(email: "hello@email.com")
How can I do something similar in Elixir? ...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
Hi,
is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
What is most correct way to open, read and parse JSON file with poison?
For example if we have example.json file in root of some projec...
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Sometimes I want to check if the input into a function is not a blank string.
My first approach:
defmodule Example do
def do_stuff(s...
New
Other popular topics
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this
"1000"
What is the ...
New
The Elixir Typespec docs show the following syntax for keyword lists in typespecs:
# ...
| [key: type] # keyword lis...
New
I have a User schema with a :from_id field set to type :string:
defmodule TweetBot.Repo.Migrations.CreateUsers do
use Ecto.Migration
...
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
Hello guys,
I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New







