I’ve got a new app deployed to Heroku and am unable to get the Repo application to start.
In prod.exs:
use Mix.Config
config :testapp, TestappWeb.Endpoint,
url: [scheme: "https", host: System.get_env("BASE_URL"), port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
http: [:inet6, port: System.get_env("PORT") || 4000],
cache_static_manifest: "priv/static/cache_manifest.json",
secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE")
# Do not print debug messages in production
config :logger, level: :info
config :testapp, Testapp.Repo,
url: System.get_env("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
ssl: true
[...snip...]
But trying to connect to the app or run ecto.migrate gives the following error:
** (EXIT from #PID<0.74.0>) an exception was raised:
** (ArgumentError) supervisors expect the child to be a module, a {module, arg} tuple or a map with the child specification, got:
{DBConnection.ConnectionPool, {Ecto.Repo.Supervisor, :start_child, [{DBConnection.ConnectionPool, :start_link, [{Postgrex.Protocol, [types:
Postgrex.DefaultTypes, repo: Testapp.Repo, telemetry_prefix: [:Testapp, :repo], otp_app: :Testapp, timeout: 15000, pool_timeout: 5000, adapter:
Ecto.Adapters.Postgres, ssl: true, pool_size: 2, username: "...", password: "...", database: "...", hostname: "...", port: 5432, pool:
DBConnection.ConnectionPool]}]}, Ecto.Adapters.Postgres, #Reference<0.280083182.1810497537.168308>, %{opts: [timeout: 15000, pool_timeout: 5000,
pool_size: 2, pool: DBConnection.ConnectionPool], sql: Ecto.Adapters.Postgres.Connection, telemetry: {:debug, [], [:Testapp, :repo, :query]}}]},
:permanent, 5000, :worker, [DBConnection.ConnectionPool]}
(elixir) lib/supervisor.ex:609: Supervisor.init_child/1
(elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
(elixir) lib/supervisor.ex:581: Supervisor.init/2
(stdlib) supervisor.erl:294: :supervisor.init/1
(stdlib) gen_server.erl:365: :gen_server.init_it/2
(stdlib) gen_server.erl:333: :gen_server.init_it/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3a
Any suggestions as to what I might be doing wrong or overlooking? As far as I can tell I’ve followed the Phoenix Heroku setup instructions correctly.
Edit: added error instead of another copy of the config file