New app with new DB just disconnects on CREATE postgis command

Hi all.

I have created a new elixir app with a postgres DB. I attached the DB and it seems to connect but if I read the logs correctly, it just disconnects when trying to create postgis extension.

Here is an excerpt from the logs:

…
 2024-02-29T09:09:27.305 app[683d399c160ee8] ams [info] 09:09:27.305 [info] == Migrated 20210101000001 in 0.0s

2024-02-29T09:09:27.319 app[683d399c160ee8] ams [info] 09:09:27.319 [info] create table email_confirmation_tokens

2024-02-29T09:09:27.327 app[683d399c160ee8] ams [info] 09:09:27.327 [info] == Migrated 20210101000002 in 0.0s

2024-02-29T09:09:27.340 app[683d399c160ee8] ams [info] 09:09:27.339 [info] == Running 20210101000003 Dance.Repo.Migrations.EnablePostgis.up/0 forward

2024-02-29T09:09:27.341 app[683d399c160ee8] ams [info] 09:09:27.341 [info] execute "CREATE EXTENSION IF NOT EXISTS postgis"

2024-02-29T09:09:31.718 app[683d399c160ee8] ams [info] 09:09:31.717 [error] Postgrex.Protocol (#PID<0.160.0>) disconnected: ** (DBConnection.ConnectionError) tcp recv: closed

2024-02-29T09:09:31.718 app[683d399c160ee8] ams [info] 09:09:31.718 [error] Postgrex.Protocol (#PID<0.161.0>) disconnected: ** (DBConnection.ConnectionError) tcp recv: closed

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] ** (DBConnection.ConnectionError) tcp recv: closed

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] (db_connection 2.6.0) lib/db_connection.ex:1745: DBConnection.run_transaction/4

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] (ecto_sql 3.11.1) lib/ecto/adapters/postgres.ex:291: Ecto.Adapters.Postgres.do_lock_for_migrations/5

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] (ecto_sql 3.11.1) lib/ecto/migrator.ex:585: Ecto.Migrator.lock_for_migrations/4

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] (ecto_sql 3.11.1) lib/ecto/migrator.ex:733: anonymous fn/5 in Ecto.Migrator.migrate/4

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] (elixir 1.16.1) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] (ecto_sql 3.11.1) lib/ecto/migrator.ex:732: Ecto.Migrator.migrate/4

2024-02-29T09:09:31.723 app[683d399c160ee8] ams [info] (ecto_sql 3.11.1) lib/ecto/migrator.ex:170: Ecto.Migrator.with_repo/3 

Before there were some more migrations that seemed to have been applied. But it strikes my odd that the Postgres server just disconnects without an error message whenever it comes to the CREATE EXTENSION IF NOT EXISTS postgis command.

Any ideas? I read somewhere that the postgres should be ready for postgis, or did I read that wrong?

Hi… People have mentioned OOM in this situation:

Thanks very much. Did not know that I can access a shut down machine via machine status. That’s a neat trick.

Also am wondering why I didn’t see the posts you referred too. I was searching before posting. :thinking:
But indeed adding some more memory seems to allow for migrating through. Thanks @mayailurus. :pray:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.