I’ve just upgraded Elixir from 1.7.4 to 1.10.4 and I’m having some problems after creating a release. The development environment works just fine using
iex -S phx.server
However, when I build it using
MIX_ENV=prod mix release
and run it _build/.../bilula start
I get this error
** (Mix) Could not start application bilula: Bilula.start(:normal, []) returned an error: shutdown: failed to start child: BilulaWeb.Endpoint
** (EXIT) an exception was raised:
** (FunctionClauseError) no function clause matching in Kernel.=~/2
(elixir 1.10.4) lib/kernel.ex:2011: Kernel.=~(nil, ~r/[^:]:\d/)
(phoenix 1.5.13) lib/phoenix/endpoint/supervisor.ex:345: Phoenix.Endpoint.Supervisor.build_url/2
(phoenix 1.5.13) lib/phoenix/endpoint/supervisor.ex:281: Phoenix.Endpoint.Supervisor.url/1
(phoenix 1.5.13) lib/phoenix/config.ex:54: Phoenix.Config.cache/3
(phoenix 1.5.13) lib/phoenix/endpoint/supervisor.ex:476: Phoenix.Endpoint.Supervisor.log_access_url/3
(phoenix 1.5.13) lib/phoenix/endpoint/supervisor.ex:17: Phoenix.Endpoint.Supervisor.start_link/3
(stdlib 3.12.1.2) supervisor.erl:379: :supervisor.do_start_child_i/3
(stdlib 3.12.1.2) supervisor.erl:365: :supervisor.do_start_child/2
Here are my deps:
defp deps do
[
{:amqp, "~> 3.1"},
{:arc, "~> 0.11.0"},
{:bamboo, "~> 1.2"},
{:bamboo_smtp, "~> 1.3"},
{:bcrypt_elixir, "~> 1.0"},
{:briefly, "~> 0.3"},
{:bypass, "~> 1.0", only: :test},
{:comeonin, "~> 4.0"},
{:cors_plug, "~> 1.5"},
{:credo, "~> 0.5", only: [:dev, :test], runtime: false},
{:css_colors, "~> 0.2.1"},
{:csv, "~> 2.0"},
{:distillery, "~> 1.2", runtime: false},
{:ecto_sql, "~> 3.1.4"},
{:ex_aws, "~> 2.0"},
{:ex_aws_s3, "~> 2.0"},
{:ex_doc, "~> 0.21", only: :dev, runtime: false},
{:ex_machina, "~> 2.1", only: :test},
{:excoveralls, "~> 0.12.2", only: :test, runtime: false},
{:exq, "~> 0.13.0"},
{:recaptcha, "~> 3.0"},
{:flow, "~> 0.14"},
{:gettext, "~> 0.13"},
{:guardian, "~> 1.2.1"},
{:hackney, "~> 1.15.2", override: true},
{:hammer, "~> 6.0"},
{:html_sanitize_ex, "~> 1.3.0"},
{:httpoison, "~> 1.0"},
{:inflex, "~> 1.10"},
{:jason, "~> 1.1"},
{:libcluster, "~> 3.0"},
{:logger_file_backend, "~> 0.0.10"},
{:logster, "~> 0.4"},
{:mox, "~> 0.3", only: :test},
{:navigation_history, "~> 0.2.2"},
{:neuron, "~> 5.0.0"},
{:nimble_csv, "~> 0.3"},
{:telemetry_poller, "~> 0.4"},
{:telemetry_metrics, "~> 0.6"},
{:open_api_spex, "~> 3.10"},
{:phoenix, "~> 1.5.13"},
{:phoenix_live_view, "~> 0.15.0"},
{:floki, ">= 0.0.0", only: :test},
{:phoenix_ecto, "~> 4.0"},
{:phoenix_html, "~> 2.14.1"},
{:phoenix_live_reload, "~> 1.0", only: :dev, runtime: false},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_live_dashboard, "~> 0.4"},
{:plug, "~> 1.12"},
{:plug_cowboy, "~> 2.0"},
{:poison, "~> 3.1"},
{:postgrex, "~> 0.14.3"},
{:prometheus, "~> 4.0", override: true},
{:prometheus_ecto, "~> 1.4.0"},
{:prometheus_ex, "~> 3.0", override: true},
{:prometheus_phoenix, "~> 1.2.0"},
{:prometheus_plugs, "~> 1.1.1"},
{:prometheus_process_collector, "~> 1.3"},
{:redix, "~> 0.9.3"},
{:scrivener_ecto, "~> 2.0"},
{:scrivener_headers, "~> 3.1"},
{:scrivener_list, "~> 2.0"},
{:sentry, "~> 7.0"},
{:swarm, "~> 3.0"},
{:sweet_xml, "~> 0.6"},
{:tap, "~> 0.1.5"},
{:timex, "~> 3.3.0"},
{:xlsxir, "~> 1.6.2"},
{:hound, "~> 1.1.0"},
{:jose, "~> 1.10.1"},
{:tesla, "~> 1.4"},
{:vaultex, "~> 1.0.1"},
{:mix_audit, "~> 1.0", only: [:dev, :test], runtime: false},
{:mock, "~> 0.3.0", only: :test}
]
end
And my elixir -v
output:
elixir -v
Erlang/OTP 22 [erts-10.7.2.18] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1]
Elixir 1.10.4 (compiled with Erlang/OTP 22)
I’ve double checked and there is no nil
value in my prod.exs
or my runtime.exs