I’m trying to run through this tutorial to deploy to Digital Ocean. At this point in the tutorial, I run all the commands successfuly. I get to the _build/prod/rel/docker_phx/bin/docker_phx eval "DockerPhx.Release.migrate"
(with appropriate substitutions made for my actual app), I am rewarded with this:
ERROR! Config provider Config.Reader failed with:
** (ArgumentError) argument error
:erlang.binary_to_integer(nil)
(stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
(stdlib) erl_eval.erl:888: :erl_eval.expr_list/6
(stdlib) erl_eval.erl:240: :erl_eval.expr/5
(stdlib) erl_eval.erl:232: :erl_eval.expr/5
(stdlib) erl_eval.erl:888: :erl_eval.expr_list/6
(stdlib) erl_eval.erl:240: :erl_eval.expr/5
(stdlib) erl_eval.erl:232: :erl_eval.expr/5
{"init terminating in do_boot",{badarg,[{erlang,binary_to_integer,[nil],[]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,expr_list,6,[{file,"erl_eval.erl"},{line,888}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,240}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,232}]},{erl_eval,expr_list,6,[{file,"erl_eval.erl"},{line,888}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,240}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,232}]}]}}
init terminating in do_boot ({badarg,[{erlang,binary_to_integer,[nil],[]},{erl_eval,do_apply,6,[{_},{_}]},{erl_eval,expr_list,6,[{_},{_}]},{erl_eval,expr,5,[{_},{_}]},{erl_eval,expr,5,[{_},{_}]},{erl_
Crash dump is being written to: erl_crash.dump...done
My config.exs
:
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
# General application configuration
use Mix.Config
config :my_actual_app,
ecto_repos: [MyActualApp.Repo]
# Configures the endpoint
config :my_actual_app, MyActualAppWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "nCGzazsIf+XMNgGg4kH7vegQWaJevlu3N+x4ZQg+Q51Ipm8ItXKwXpUIKZfETHxn",
render_errors: [view: MyActualAppWeb.ErrorView, accepts: ~w(html json)],
pubsub_server: MyActualApp.PubSub,
live_view: [signing_salt: "RX4GG8P/"]
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason
config :phoenix, :format_encoders, json: Jason
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
Myprod.exs
:
use Mix.Config
# For production, don't forget to configure the url host
# to something meaningful, Phoenix uses this information
# when generating URLs.
#
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix phx.digest` task,
# which you should run after static files are built and
# before starting your production server.
config :my_actual_app, MyActualAppWeb.Endpoint,
http: [port: {:system, "PORT"}],
url: [host: "localhost", port: {:system, "PORT"}],
cache_static_manifest: "priv/static/cache_manifest.json",
secret_key_base: System.get_env("SECRET_KEY_BASE"),
server: true,
root: ".",
version: Application.spec(:my_actual_app, :vsn)
config :my_actual_app, MyActualApp.Repo,
url: System.get_env("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
ssl: true,
types: MyActualApp.PostgresTypes
# Do not print debug messages in production
config :logger, level: :info
My releases.exs
:
# In this file, we load production configuration and secrets
# from environment variables. You can also hardcode secrets,
# although such is generally not recommended and you have to
# remember to add this file to your .gitignore.
import Config
config :my_actual_app, MyActualApp.Repo,
url: System.get_env("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
config :my_actual_app, MyActualAppWeb.Endpoint,
http: [
port: String.to_integer(System.get_env("PORT")),
transport_options: [socket_opts: [:inet6]]
],
url: [scheme: "https", host: System.get_env("APP_DOMAIN"), port: 443],
secret_key_base: System.get_env("SECRET_KEY_BASE")
My repo.ex
:
defmodule MyActualApp.Repo do
use Ecto.Repo,
otp_app: :my_actual_app,
adapter: Ecto.Adapters.Postgres
def init(_, opts) do
{:ok, Keyword.put(opts, :url, System.get_env("DATABASE_URL"))}
end
end
Like, my spidey senses are telling me it’s one of the configurations in the .env
(which, of course, I’m not posting here). I just can’t tell which one.