I’m still trying to get my first Fly app up and running. When I created the app with fly launch
, I created a PostgreSQL db as well. Now, when I try to deploy my app, I get an error during the database migration:
$ fly deploy
[...]
Starting virtual machine
Starting init (commit: 249766e)...
Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
no label, UUID=27602f5f-3d63-413e-9103-6c38ccb98510
Preparing to run: `/app/bin/migrate` as nobody
2022/10/27 16:48:39 listening on [fdaa:0:c77d:a7b:276d:a79:3d5c:2]:22 (DNS: [fdaa::3]:53)
16:48:41.311 [error] Postgrex.Protocol (#PID<0.136.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (top2.nearest.of.shivelight-db.internal:5432): non-existing domain - :nxdomain
16:48:41.311 [error] Postgrex.Protocol (#PID<0.137.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (top2.nearest.of.shivelight-db.internal:5432): non-existing domain - :nxdomain
16:48:41.311 [error] Postgrex.Protocol (#PID<0.136.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (top2.nearest.of.shivelight-db.internal:5432): non-existing domain - :nxdomain
16:48:41.311 [error] Postgrex.Protocol (#PID<0.137.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (top2.nearest.of.shivelight-db.internal:5432): non-existing domain - :nxdomain
indexes with a migration_lock)
"mix ecto.create". Alternatively you may configure Ecto to use
migration_source: "some_other_table_for_schema_migrations",
See DBConnection.start_link/2 for more information
indexes with a migration_lock)
"mix ecto.create". Alternatively you may configure Ecto to use
migration_source: "some_other_table_for_schema_migrations",
See DBConnection.start_link/2 for more information
(ecto_sql 3.9.0) lib/ecto/adapters/sql.ex:905: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql 3.9.0) lib/ecto/adapters/sql.ex:997: Ecto.Adapters.SQL.execute_ddl/4
(ecto_sql 3.9.0) lib/ecto/migrator.ex:146: Ecto.Migrator.with_repo/3
nofile:1: (file)
(ecto_sql 3.9.0) lib/ecto/adapters/sql.ex:905: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql 3.9.0) lib/ecto/adapters/sql.ex:997: Ecto.Adapters.SQL.execute_ddl/4
(ecto_sql 3.9.0) lib/ecto/migrator.ex:146: Ecto.Migrator.with_repo/3
I don’t know if this is permissions-related, but the DATABASE_URL
is set, and I assume that it is correct since it was set by the launch
command.
In what may be a related issue, I also can’t connect to the Postgres DB:
ian@alder $ fly postgres connect
Error app myapp is not a postgres app
I don’t know what “is not a postgres app” signifies here. Certainly, there is a Postgres DB running, and when I tried fly attach
, it says I’m already done:
ian@alder $ flyctl postgres attach myapp-db --verbose
Error consumer app "myapp" already contains a secret named DATABASE_URL