Error DBConnection when running mix phx.server

** (Mix) Could not start application myapp: Myapp.Application.start(:normal, ) returned an error: shutdown: failed to start child: Myapp.Repo
** (EXIT) shutdown: failed to start child: DBConnection.ConnectionPool
** (EXIT) exited in: GenServer.call(DBConnection.Watcher, {:watch, DBConnection.ConnectionPool.PoolSupervisor, [#PID<0.254.0>, #Reference<0.4014485880.2495217665.118304>, Mariaex.Protocol, [datetime: :structs, repo: Myapp.Repo, telemetry_prefix: [:myapp, :repo], otp_app: :myapp, timeout: 15000, username: “root”, password: “letmein”, database: “myapp_dev”, hostname: “localhost”, show_sensitive_data_on_connection_error: true, pool_size: 10, pool: DBConnection.ConnectionPool]]}, :infinity)
** (EXIT) no process: the process is not alive or there’s no process currently associated with the given name, possibly because its application isn’t started

When I type “mysql -h localhost -u root -p” and use the password “letmein”, I connect to mysql successfully.

In my config/dev.exs I have:

config :myapp, Myapp.Repo,
username: “root”,
password: “letmein”,
database: “myapp_dev”,
hostname: “localhost”,
show_sensitive_data_on_connection_error: true,
pool_size: 10

I can even do migrations:

mix ecto.migrate
00:22:42.970 [info] == Running 20190524065555 Myapp.Repo.Migrations.CreateUsers.change/0 forward
00:22:42.998 [info] create table users
00:22:43.029 [info] == Migrated 20190524065555 in 0.0s

1 Like

Fixed it. The reason was Ueberauth_google’s documentation said to add the following:

def application do
  [applications: [:ueberauth_google]]
end

So I changed my def application to:

  def application do
    [
      mod: {Myapp.Application, []},
      applications: [:ueberauth_google],
      extra_applications: [:logger, :runtime_tools]
    ]
  end

Putting :ueberauth_google inside extra_applications and removing applications fixed it:

  def application do
    [
      mod: {Myapp.Application, []},
      extra_applications: [:logger, :runtime_tools, :ueberauth_google]
    ]
  end
11 Likes

Thanks for the pointer! This error was driving me crazy. For posterity, you don’t have to include ueberauth* anywhere in the application block at all because Elixir will automatically infer that:

2 Likes