I’ve post this on SO, but not been able to solve the issue, so trying my luck here too!
I’m playing around with Nanobox for the first time, trying to launch an Elixir app. I have been able to run the app locally ok, but I’m failing with launching a ‘dry-run’ with nanobox deploy dry-run
and I get the following error:
! FAILED TO BEFORE_LIVE1: MIX ECTO.CREATE --QUIET !
Exit
1
Command
su - gonano -c "cd /app; siphon --prefix '' -- bash -i -l -c \"mix ecto.create --quiet\""
Output
07:43:15.795 [error] GenServer #PID<0.189.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
** (Mix) The database for Codsonline.Repo couldn't be created: an exception was raised:
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Error : failed to execute hook (before_live) on e528aa7c36b4da40466b9d1d81154f3cbbcb785a278e8435dd20e71eb7f1974c: util:Exec:/opt/nanobox/hooks/before_live: bad exit code(1):
Context : failed to finalize deploy -> failed to run before deploy hooks
I had no issues when originally running mix ecto.create
.
config/dev.exs
looks like:
config :codsonline, Codsonline.Repo,
adapter: Ecto.Adapters.Postgres,
username: System.get_env("DATA_DB_USER"),
password: System.get_env("DATA_DB_PASS"),
hostname: System.get_env("DATA_DB_HOST"),
database: "app_dev",
pool_size: 10
Psql is running locally.
I’ve also set the port nanobox evar add dry-run PORT=8080
I’ve seen some other questions on this issue, and some comments indicate I might need to change the port Postrges is running or, or at least change the config to port: 5432, although I’m unsure where I would do that.