Skip to content

Instantly share code, notes, and snippets.

@kartsims
Created December 13, 2018 19:31
Show Gist options
  • Save kartsims/3514ed2cdab4abd9b28c46ae9c41ae22 to your computer and use it in GitHub Desktop.
Save kartsims/3514ed2cdab4abd9b28c46ae9c41ae22 to your computer and use it in GitHub Desktop.
Reproduce ewallet error
version: "3"
services:
postgres:
image: postgres:9.6.9-alpine
restart: always
volumes:
- postgres-db:/var/lib/postgresql/data
networks:
- internal
environment:
POSTGRESQL_PASSWORD: passw0rd
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-U", "postgres"]
interval: 30s
retries: 3
mailhog:
image: mailhog/mailhog:v1.0.0
restart: always
networks:
- internal
ewallet:
image: omisego/ewallet:latest
restart: always
networks:
- internal
- external
depends_on:
- postgres
environment:
DATABASE_URL: "postgresql://postgres:passw0rd@postgres:5432/ewallet"
LOCAL_LEDGER_DATABASE_URL: "postgresql://postgres:passw0rd@postgres:5432/local_ledger"
EWALLET_SECRET_KEY: "/dS+yXUIiRS/D8WLflgTVwyR6Rr87vV/4cgaloSDVg8="
LOCAL_LEDGER_SECRET_KEY: "daE0oTHOdG/NL8qmE8Ejv0lkHVaqs5J6UEKtoXEwh0E="
SMTP_HOST: mailhog
SMTP_PORT: 1025
ports:
- 4000:4000
networks:
external:
internal:
volumes:
postgres-db:
@kartsims
Copy link
Author

kartsims commented Dec 13, 2018

Secret keys are dev only

Steps to reproduce :

docker-compose pull
docker-compose up

Result :

Creating network "ewallet-test_internal" with the default driver
Creating network "ewallet-test_external" with the default driver
Creating volume "ewallet-test_postgres-db" with default driver
Creating ewallet-test_postgres_1 ... done
Creating ewallet-test_mailhog_1  ... done
Creating ewallet-test_ewallet_1  ... done
Attaching to ewallet-test_postgres_1, ewallet-test_mailhog_1, ewallet-test_ewallet_1
postgres_1  | The files belonging to this database system will be owned by user "postgres".
postgres_1  | This user must also own the server process.
postgres_1  |
postgres_1  | The database cluster will be initialized with locale "en_US.utf8".
postgres_1  | The default database encoding has accordingly been set to "UTF8".
postgres_1  | The default text search configuration will be set to "english".
postgres_1  |
postgres_1  | Data page checksums are disabled.
postgres_1  |
postgres_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres_1  | creating subdirectories ... ok
mailhog_1   | 2018/12/13 19:30:20 Using in-memory storage
mailhog_1   | 2018/12/13 19:30:20 [SMTP] Binding to address: 0.0.0.0:1025
mailhog_1   | 2018/12/13 19:30:20 Serving under http://0.0.0.0:8025/
mailhog_1   | [HTTP] Binding to address: 0.0.0.0:8025
postgres_1  | selecting default max_connections ... 100
mailhog_1   | Creating API v1 with WebPath:
mailhog_1   | Creating API v2 with WebPath:
postgres_1  | selecting default shared_buffers ... 128MB
postgres_1  | selecting dynamic shared memory implementation ... posix
postgres_1  | creating configuration files ... ok
ewallet_1   | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
ewallet_1   | [s6-init] ensuring user provided files have correct perms...exited 0.
ewallet_1   | [fix-attrs.d] applying ownership & permissions fixes...
ewallet_1   | [fix-attrs.d] done.
ewallet_1   | [cont-init.d] executing container initialization scripts...
ewallet_1   | [cont-init.d] done.
ewallet_1   | [services.d] starting services
ewallet_1   | [services.d] done.
postgres_1  | running bootstrap script ... ok
postgres_1  | performing post-bootstrap initialization ... sh: locale: not found
postgres_1  | No usable system locales were found.
postgres_1  | Use the option "--debug" to see details.
postgres_1  | ok
postgres_1  | syncing data to disk ... ok
postgres_1  |
postgres_1  | WARNING: enabling "trust" authentication for local connections
postgres_1  | You can change this by editing pg_hba.conf or using the option -A, or
postgres_1  | --auth-local and --auth-host, the next time you run initdb.
postgres_1  |
postgres_1  | Success. You can now start the database server using:
postgres_1  |
postgres_1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
postgres_1  |
postgres_1  | ****************************************************
postgres_1  | WARNING: No password has been set for the database.
postgres_1  |          This will allow anyone with access to the
postgres_1  |          Postgres port to access your database. In
postgres_1  |          Docker's default configuration, this is
postgres_1  |          effectively any other container on the same
postgres_1  |          system.
postgres_1  |
postgres_1  |          Use "-e POSTGRES_PASSWORD=password" to set
postgres_1  |          it in "docker run".
postgres_1  | ****************************************************
postgres_1  | waiting for server to start....LOG:  database system was shut down at 2018-12-13 19:30:22 UTC
postgres_1  | LOG:  MultiXact member wraparound protections are now enabled
postgres_1  | LOG:  database system is ready to accept connections
postgres_1  | LOG:  autovacuum launcher started
postgres_1  |  done
postgres_1  | server started
postgres_1  | ALTER ROLE
postgres_1  |
postgres_1  |
postgres_1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgres_1  |
postgres_1  | LOG:  received fast shutdown request
postgres_1  | LOG:  aborting any active transactions
postgres_1  | LOG:  autovacuum launcher shutting down
postgres_1  | LOG:  shutting down
postgres_1  | waiting for server to shut down....LOG:  database system is shut down
postgres_1  |  done
postgres_1  | server stopped
postgres_1  |
postgres_1  | PostgreSQL init process complete; ready for start up.
postgres_1  |
postgres_1  | LOG:  database system was shut down at 2018-12-13 19:30:23 UTC
postgres_1  | LOG:  MultiXact member wraparound protections are now enabled
postgres_1  | LOG:  database system is ready to accept connections
postgres_1  | LOG:  autovacuum launcher started
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.849.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.848.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.847.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.846.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.845.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.844.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.840.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.841.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.231 [error] Postgrex.Protocol (#PID<0.842.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 19:30:26.232 [error] Postgrex.Protocol (#PID<0.843.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 19:30:26.340 [error] Postgrex.Protocol (#PID<0.877.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 19:30:26.340 [error] Postgrex.Protocol (#PID<0.876.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 19:30:26.347 [error] Postgrex.Protocol (#PID<0.880.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 19:30:26.353 [error] Postgrex.Protocol (#PID<0.878.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 19:30:26.353 [error] Postgrex.Protocol (#PID<0.879.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 19:30:26.364 [error] Postgrex.Protocol (#PID<0.882.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 19:30:26.388 [error] Postgrex.Protocol (#PID<0.881.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 19:30:26.388 [error] Postgrex.Protocol (#PID<0.885.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 19:30:26.388 [error] Postgrex.Protocol (#PID<0.884.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 19:30:26.388 [error] Postgrex.Protocol (#PID<0.883.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 19:30:26.584 [error] GenServer EWalletConfig.Config terminating
ewallet_1   | ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |     (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |     (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |     (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |     (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |     (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |     (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |     (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |     (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | Last message (from #PID<0.902.0>): {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}
ewallet_1   | 19:30:26.591 [info] Application ewallet_db exited: exited in: EWalletDB.Application.start(:normal, [])
ewallet_1   |     ** (EXIT) exited in: GenServer.call(EWalletConfig.Config, {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}, 5000)
ewallet_1   |         ** (EXIT) an exception was raised:
ewallet_1   |             ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |                 (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |                 (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |                 (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |                 (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | ** (Mix) Could not start application ewallet_db: exited in: EWalletDB.Application.start(:normal, [])
ewallet_1   |     ** (EXIT) exited in: GenServer.call(EWalletConfig.Config, {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}, 5000)
ewallet_1   |         ** (EXIT) an exception was raised:
ewallet_1   |             ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |                 (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |                 (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |                 (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |                 (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | (no error logger present) error: <0.80.0>
ewallet_1   | (no error logger present) error: <0.5.0>
ewallet_1   | [cont-finish.d] executing container finish scripts...
ewallet_1   | [cont-finish.d] done.
ewallet_1   | [s6-finish] syncing disks.
ewallet_1   | [s6-finish] sending all processes the TERM signal.
ewallet_1   | [s6-finish] sending all processes the KILL signal and exiting.

@unnawut
Copy link

unnawut commented Dec 17, 2018

@kartsims I tried the following command in the docs after docker-compose up. I could get the ewallet to run without errors now.

$ docker exec -it $(docker ps --filter ancestor="omisego/ewallet:latest" --format "{{.Names}}") \
  env MIX_ENV=prod mix do \
  local.hex --force, local.rebar --force, \
  ecto.create, ecto.migrate, seed --sample

(Note that I changed ancestor="omisego/ewallet:v1.0.0" used the original docs to ancestor="omisego/ewallet:latest" above to reflect your docker-compose configurations.)

@kartsims
Copy link
Author

@unnawut I did change the docker-compose line to reflect the updated image, however in that case the exec can't happen since my container is down (the logs show an error that turns off the container, and exec can't be executed in this context)

This is the status of my containers after the last line of the log posted above :

~/dev/omg/ewallet-test ■ docker-compose ps
         Name                        Command                 State             Ports
-------------------------------------------------------------------------------------------
ewallet-test_ewallet_1    /init                           Exit 0
ewallet-test_mailhog_1    MailHog                         Up             1025/tcp, 8025/tcp
ewallet-test_postgres_1   docker-entrypoint.sh postgres   Up (healthy)   5432/tcp

Also, a simpler/better way to put it in the docs would be :

docker-compose exec ewallet \
  env MIX_ENV=prod mix do \
  local.hex --force, local.rebar --force, \
  ecto.create, ecto.migrate, seed --sample

I can't test this command right now but it should work if executed in the same folder as the docker-compose.ymlfile

@unnawut
Copy link

unnawut commented Dec 17, 2018

Here is the log from my machine:

unnawut@Deep-Thought:~/Development/temp$ docker-compose up

####################################################
# Start (the logs right after `docker-compose up`) #
####################################################

Creating network "temp_internal" with the default driver
Creating network "temp_external" with the default driver
Creating volume "temp_postgres-db" with default driver
Creating temp_mailhog_1  ... done
Creating temp_postgres_1 ... done
Creating temp_ewallet_1  ... done
Attaching to temp_mailhog_1, temp_postgres_1, temp_ewallet_1
mailhog_1   | 2018/12/17 05:04:04 Using in-memory storage
mailhog_1   | 2018/12/17 05:04:04 [SMTP] Binding to address: 0.0.0.0:1025
mailhog_1   | 2018/12/17 05:04:04 Serving under http://0.0.0.0:8025/
postgres_1  | The files belonging to this database system will be owned by user "postgres".
postgres_1  | This user must also own the server process.
postgres_1  |
postgres_1  | The database cluster will be initialized with locale "en_US.utf8".
postgres_1  | The default database encoding has accordingly been set to "UTF8".
postgres_1  | The default text search configuration will be set to "english".
postgres_1  |
postgres_1  | Data page checksums are disabled.
postgres_1  |
postgres_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres_1  | creating subdirectories ... ok
mailhog_1   | [HTTP] Binding to address: 0.0.0.0:8025
mailhog_1   | Creating API v1 with WebPath:
mailhog_1   | Creating API v2 with WebPath:
postgres_1  | selecting default max_connections ... 100
postgres_1  | selecting default shared_buffers ... 128MB
postgres_1  | selecting dynamic shared memory implementation ... posix
postgres_1  | creating configuration files ... ok
postgres_1  | running bootstrap script ... ok
postgres_1  | performing post-bootstrap initialization ... No usable system locales were found.
postgres_1  | Use the option "--debug" to see details.
postgres_1  | sh: locale: not found
ewallet_1   | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
ewallet_1   | [s6-init] ensuring user provided files have correct perms...exited 0.
ewallet_1   | [fix-attrs.d] applying ownership & permissions fixes...
ewallet_1   | [fix-attrs.d] done.
ewallet_1   | [cont-init.d] executing container initialization scripts...
ewallet_1   | [cont-init.d] done.
ewallet_1   | [services.d] starting services
ewallet_1   | [services.d] done.
postgres_1  | ok
postgres_1  | syncing data to disk ... ok
postgres_1  |
postgres_1  | Success. You can now start the database server using:
postgres_1  |
postgres_1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
postgres_1  |
postgres_1  |
postgres_1  | WARNING: enabling "trust" authentication for local connections
postgres_1  | You can change this by editing pg_hba.conf or using the option -A, or
postgres_1  | --auth-local and --auth-host, the next time you run initdb.
postgres_1  | ****************************************************
postgres_1  | WARNING: No password has been set for the database.
postgres_1  |          This will allow anyone with access to the
postgres_1  |          Postgres port to access your database. In
postgres_1  |          Docker's default configuration, this is
postgres_1  |          effectively any other container on the same
postgres_1  |          system.
postgres_1  |
postgres_1  |          Use "-e POSTGRES_PASSWORD=password" to set
postgres_1  |          it in "docker run".
postgres_1  | ****************************************************
postgres_1  | waiting for server to start....LOG:  database system was shut down at 2018-12-17 05:04:06 UTC
postgres_1  | LOG:  MultiXact member wraparound protections are now enabled
postgres_1  | LOG:  database system is ready to accept connections
postgres_1  | LOG:  autovacuum launcher started
postgres_1  |  done
postgres_1  | server started
postgres_1  | ALTER ROLE
postgres_1  |
postgres_1  |
postgres_1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgres_1  |
postgres_1  | waiting for server to shut down....LOG:  received fast shutdown request
postgres_1  | LOG:  aborting any active transactions
postgres_1  | LOG:  autovacuum launcher shutting down
postgres_1  | LOG:  shutting down
postgres_1  | LOG:  database system is shut down
postgres_1  |  done
postgres_1  | server stopped
postgres_1  |
postgres_1  | PostgreSQL init process complete; ready for start up.
postgres_1  |
postgres_1  | LOG:  database system was shut down at 2018-12-17 05:04:07 UTC
postgres_1  | LOG:  MultiXact member wraparound protections are now enabled
postgres_1  | LOG:  database system is ready to accept connections
postgres_1  | LOG:  autovacuum launcher started
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.892.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.890.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.896.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.897.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.894.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.895.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.898.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.889.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.893.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:09.696 [error] Postgrex.Protocol (#PID<0.891.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.820 [error] Postgrex.Protocol (#PID<0.942.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.820 [error] Postgrex.Protocol (#PID<0.943.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.822 [error] Postgrex.Protocol (#PID<0.944.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.825 [error] Postgrex.Protocol (#PID<0.945.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.828 [error] Postgrex.Protocol (#PID<0.951.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.830 [error] Postgrex.Protocol (#PID<0.949.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.834 [error] Postgrex.Protocol (#PID<0.950.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.834 [error] Postgrex.Protocol (#PID<0.948.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.837 [error] Postgrex.Protocol (#PID<0.947.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.837 [error] Postgrex.Protocol (#PID<0.946.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.869 [error] Postgrex.Protocol (#PID<0.963.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.873 [error] Postgrex.Protocol (#PID<0.962.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.878 [error] Postgrex.Protocol (#PID<0.969.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.882 [error] Postgrex.Protocol (#PID<0.964.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.882 [error] Postgrex.Protocol (#PID<0.965.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.883 [error] Postgrex.Protocol (#PID<0.970.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:09.891 [error] Postgrex.Protocol (#PID<0.967.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.892 [error] Postgrex.Protocol (#PID<0.966.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.894 [error] Postgrex.Protocol (#PID<0.968.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:09.894 [error] Postgrex.Protocol (#PID<0.971.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:10.111 [error] GenServer EWalletConfig.Config terminating
ewallet_1   | ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |     (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |     (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |     (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |     (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |     (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |     (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |     (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |     (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | Last message (from #PID<0.988.0>): {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}
ewallet_1   | 05:04:10.117 [info] Application ewallet_db exited: exited in: EWalletDB.Application.start(:normal, [])
ewallet_1   |     ** (EXIT) exited in: GenServer.call(EWalletConfig.Config, {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}, 5000)
ewallet_1   |         ** (EXIT) an exception was raised:
ewallet_1   |             ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |                 (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |                 (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |                 (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |                 (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | ** (Mix) Could not start application ewallet_db: exited in: EWalletDB.Application.start(:normal, [])
ewallet_1   |     ** (EXIT) exited in: GenServer.call(EWalletConfig.Config, {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}, 5000)
ewallet_1   |         ** (EXIT) an exception was raised:
ewallet_1   |             ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |                 (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |                 (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |                 (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |                 (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | (no error logger present) error: <0.80.0>
ewallet_1   | [cont-finish.d] executing container finish scripts...
ewallet_1   | [cont-finish.d] done.
ewallet_1   | [s6-finish] syncing disks.
ewallet_1   | [s6-finish] sending all processes the TERM signal.
ewallet_1   | [s6-finish] sending all processes the KILL signal and exiting.
ewallet_1   | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
ewallet_1   | [s6-init] ensuring user provided files have correct perms...exited 0.

###############################################################
# Restart 1 (the immediate restart after `docker-compose up`) #
###############################################################

ewallet_1   | [fix-attrs.d] applying ownership & permissions fixes...
ewallet_1   | [fix-attrs.d] done.
ewallet_1   | [cont-init.d] executing container initialization scripts...
ewallet_1   | [cont-init.d] done.
ewallet_1   | [services.d] starting services
ewallet_1   | [services.d] done.
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
postgres_1  | FATAL:  database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.893.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.890.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.894.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.895.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.889.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.892.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.897.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.896.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.898.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
ewallet_1   | 05:04:21.936 [error] Postgrex.Protocol (#PID<0.891.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "local_ledger" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.085 [error] Postgrex.Protocol (#PID<0.951.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.085 [error] Postgrex.Protocol (#PID<0.950.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.085 [error] Postgrex.Protocol (#PID<0.949.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.086 [error] Postgrex.Protocol (#PID<0.948.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.088 [error] Postgrex.Protocol (#PID<0.947.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.090 [error] Postgrex.Protocol (#PID<0.946.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.093 [error] Postgrex.Protocol (#PID<0.945.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.094 [error] Postgrex.Protocol (#PID<0.944.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.095 [error] Postgrex.Protocol (#PID<0.943.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.098 [error] Postgrex.Protocol (#PID<0.942.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.132 [error] Postgrex.Protocol (#PID<0.967.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.134 [error] Postgrex.Protocol (#PID<0.966.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.136 [error] Postgrex.Protocol (#PID<0.965.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.138 [error] Postgrex.Protocol (#PID<0.964.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.138 [error] Postgrex.Protocol (#PID<0.963.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
postgres_1  | FATAL:  database "ewallet" does not exist
ewallet_1   | 05:04:22.146 [error] Postgrex.Protocol (#PID<0.962.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.150 [error] Postgrex.Protocol (#PID<0.968.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.150 [error] Postgrex.Protocol (#PID<0.969.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.150 [error] Postgrex.Protocol (#PID<0.971.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.150 [error] Postgrex.Protocol (#PID<0.970.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database "ewallet" does not exist
ewallet_1   | 05:04:22.337 [error] GenServer EWalletConfig.Config terminating
ewallet_1   | ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |     (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |     (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |     (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |     (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |     (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |     (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |     (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |     (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | Last message (from #PID<0.988.0>): {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}
ewallet_1   | 05:04:22.357 [info] Application ewallet_db exited: exited in: EWalletDB.Application.start(:normal, [])
ewallet_1   |     ** (EXIT) exited in: GenServer.call(EWalletConfig.Config, {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}, 5000)
ewallet_1   |         ** (EXIT) an exception was raised:
ewallet_1   |             ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |                 (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |                 (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |                 (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |                 (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | ** (Mix) Could not start application ewallet_db: exited in: EWalletDB.Application.start(:normal, [])
ewallet_1   |     ** (EXIT) exited in: GenServer.call(EWalletConfig.Config, {:register_and_load, :ewallet_db, [:base_url, :min_password_length, :file_storage_adapter, :aws_bucket, :aws_region, :aws_access_key_id, :aws_secret_access_key, :gcs_bucket, :gcs_credentials]}, 5000)
ewallet_1   |         ** (EXIT) an exception was raised:
ewallet_1   |             ** (DBConnection.ConnectionError) connection not available because of disconnection
ewallet_1   |                 (db_connection) lib/db_connection.ex:934: DBConnection.checkout/2
ewallet_1   |                 (db_connection) lib/db_connection.ex:750: DBConnection.run/3
ewallet_1   |                 (db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
ewallet_1   |                 (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
ewallet_1   |                 (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
ewallet_1   |                 (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
ewallet_1   | (no error logger present) error: <0.80.0>
ewallet_1   | (no error logger present) error: <0.5.0>
ewallet_1   | [cont-finish.d] executing container finish scripts...
ewallet_1   | [cont-finish.d] done.
ewallet_1   | [s6-finish] syncing disks.
ewallet_1   | [s6-finish] sending all processes the TERM signal.
ewallet_1   | [s6-finish] sending all processes the KILL signal and exiting.
temp_ewallet_1 exited with code 0
ewallet_1   | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
ewallet_1   | [s6-init] ensuring user provided files have correct perms...exited 0.

Then at this point in time, I ran this command from my host machine:

$ docker exec -it $(docker ps --filter ancestor="omisego/ewallet:latest" --format "{{.Names}}") \
  env MIX_ENV=prod mix do \
  local.hex --force, local.rebar --force, \
  ecto.create, ecto.migrate, seed --sample

And here are the logs from the container thereafter:

#######################################################
# Restart 2 (after running `docker exec ...` command) #
#######################################################

ewallet_1   | [fix-attrs.d] applying ownership & permissions fixes...
ewallet_1   | [fix-attrs.d] done.
ewallet_1   | [cont-init.d] executing container initialization scripts...
ewallet_1   | [cont-init.d] done.
ewallet_1   | [services.d] starting services
ewallet_1   | [services.d] done.
ewallet_1   | 05:07:52.406 [warn] [Configuration] Setting "base_url" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.408 [warn] [Configuration] Setting "min_password_length" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.411 [warn] [Configuration] Setting "file_storage_adapter" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.413 [warn] [Configuration] Setting "aws_bucket" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.416 [warn] [Configuration] Setting "aws_region" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.418 [warn] [Configuration] Setting "aws_access_key_id" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.420 [warn] [Configuration] Setting "aws_secret_access_key" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.421 [warn] [Configuration] Setting "gcs_bucket" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.424 [warn] [Configuration] Setting "gcs_credentials" used by "ewallet_db" not found.
ewallet_1   | 05:07:52.436 [warn] [File Storage Configuration]: Setting hasn't been generated.
ewallet_1   | 05:07:52.753 [warn] [Configuration] Setting "base_url" used by "ewallet" not found.
ewallet_1   | 05:07:52.754 [warn] [Configuration] Setting "sender_email" used by "ewallet" not found.
ewallet_1   | 05:07:52.755 [warn] [Configuration] Setting "max_per_page" used by "ewallet" not found.
ewallet_1   | 05:07:52.757 [warn] [Configuration] Setting "redirect_url_prefixes" used by "ewallet" not found.
ewallet_1   | 05:07:52.757 [warn] [Configuration] Setting "email_adapter" used by "ewallet" not found.
ewallet_1   | 05:07:52.758 [warn] [Configuration] Setting "smtp_host" used by "ewallet" not found.
ewallet_1   | 05:07:52.758 [warn] [Configuration] Setting "smtp_port" used by "ewallet" not found.
ewallet_1   | 05:07:52.759 [warn] [Configuration] Setting "smtp_username" used by "ewallet" not found.
ewallet_1   | 05:07:52.759 [warn] [Configuration] Setting "smtp_password" used by "ewallet" not found.
ewallet_1   | 05:07:52.841 [warn] [Configuration] Setting "base_url" used by "ewallet" not found.
ewallet_1   | 05:07:52.842 [warn] [Configuration] Setting "sender_email" used by "ewallet" not found.
ewallet_1   | 05:07:52.843 [warn] [Configuration] Setting "max_per_page" used by "ewallet" not found.
ewallet_1   | 05:07:52.844 [warn] [Configuration] Setting "redirect_url_prefixes" used by "ewallet" not found.
ewallet_1   | 05:07:52.845 [warn] [Configuration] Setting "email_adapter" used by "ewallet" not found.
ewallet_1   | 05:07:52.845 [warn] [Configuration] Setting "smtp_host" used by "ewallet" not found.
ewallet_1   | 05:07:52.846 [warn] [Configuration] Setting "smtp_port" used by "ewallet" not found.
ewallet_1   | 05:07:52.847 [warn] [Configuration] Setting "smtp_username" used by "ewallet" not found.
ewallet_1   | 05:07:52.848 [warn] [Configuration] Setting "smtp_password" used by "ewallet" not found.
ewallet_1   | 05:07:53.087 [warn] [Configuration] Setting "sender_email" used by "admin_api" not found.
ewallet_1   | 05:07:53.296 [warn] [Configuration] Setting "base_url" used by "ewallet_api" not found.
ewallet_1   | 05:07:53.297 [warn] [Configuration] Setting "enable_standalone" used by "ewallet_api" not found.
ewallet_1   | 05:07:53.298 [warn] [Configuration] Setting "sender_email" used by "ewallet_api" not found.
ewallet_1   | 05:07:53.300 [warn] [Configuration] Setting "redirect_url_prefixes" used by "ewallet_api" not found.
ewallet_1   | 05:07:53.307 [info] Setting up websockets dispatchers...
ewallet_1   | 05:07:53.352 [info] Running UrlDispatcher.Plug with Cowboy http on port 4000
ewallet_1   | 05:07:53.376 [warn] `SMTP_HOST` is no longer used but is still present as an environment variable. Please consider removing it and refer to `smtp_host` in the database's `setting` table instead. Alternatively, you may run `mix omg.migrate.settings` from the command line to migrate all your environment variable settings to the database at once.
ewallet_1   | 05:07:53.376 [warn] `SMTP_PORT` is no longer used but is still present as an environment variable. Please consider removing it and refer to `smtp_port` in the database's `setting` table instead. Alternatively, you may run `mix omg.migrate.settings` from the command line to migrate all your environment variable settings to the database at once.
ewallet_1   | 05:07:57.190 [info] tzdata release in place is from a file last modified Thu, 03 May 2018 23:55:14 GMT. Release file on server was last modified Sat, 27 Oct 2018 12:10:11 GMT.
ewallet_1   | 05:07:59.159 [info] Tzdata has updated the release from 2018e to 2018g

@unnawut
Copy link

unnawut commented Dec 17, 2018

Looks like the endless restart is a valid issue.

Starting the ewallet never makes a query to the database, but now that we have the customizable settings stored in the database, the ewallet makes DB queries right after it starts up. When a DB query fails, a restart is followed.

Because of that, the docker exec ... command to create + migrate + seed` the database doesn’t reliably work due to the repeated restart. And this is more likely to happen on freshly created instances than existing ones because the migration + seed takes some time, most likely longer than the container’s lifetime before each restart.

@samundra
Copy link

Have you guys found any solution for this? Is there anyway that we can manually create+migrate+seed the DB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment