(RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as they may contain sensitive data such as database credentials

I am getting the following error intermittently in production

** (RuntimeError) connect raised CaseClauseError exception. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
    (mariaex) lib/mariaex/protocol.ex:1245: Mariaex.Protocol.abort_statement/3
    (mariaex) lib/mariaex/protocol.ex:232: Mariaex.Protocol.handle_handshake/3
    (mariaex) lib/mariaex/protocol.ex:171: Mariaex.Protocol.handshake_recv/2
    (db_connection) lib/db_connection/connection.ex:66: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

MySQL Version: 5.7.26
Mariaex Version: 0.9.1

config :afterglow, AfterGlow.Repo,
  adapter: Ecto.Adapters.Postgres,
  url: System.get_env("AG_DATABASE_URL"),
  timeout: :infinity,
  pool_size: 20

I frequently get this error but when I redeploy it seems to go away only to come back again later.
I am not able to figure out what is the issue.

This is not the right config… :thinking:

Oh sorry that I didn’t explain it through.

We have a service that acts as a platform where we can add multiple DB and execute query, where we use psql as the main db for logs and records.

In the system a user had added MySQL DB for which we are using Mariaex for execute queries.

Well if you want further help you should probably copy-paste the mariaex Elixir configuration and also enable the :show_sensitive_data_on_connection_error temporarily so you are able to get better error messages.

2 Likes