plausible / community-edition

Example Docker Compose setup for hosting Plausible Community Edition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-compose up - Gives database errors and main app dies

that-guy-iain opened this issue · comments

When doing docker-compose up on master there is an error that causes the main app docker to terminate

Attaching to hosting_plausible_db_1, hosting_plausible_events_db_1, hosting_mail_1, hosting_plausible_1
mail_1                 |     1 LOG: MAIN
mail_1                 |     1   exim 4.89 daemon started: pid=1, -q30m, listening for SMTP on port 25 (IPv6 and IPv4)
plausible_db_1         | 
plausible_db_1         | PostgreSQL Database directory appears to contain a database; Skipping initialization
plausible_db_1         | 
plausible_db_1         | 2020-12-06 17:29:53.646 UTC [1] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
plausible_events_db_1  | Processing configuration file '/etc/clickhouse-server/config.xml'.
plausible_db_1         | 2020-12-06 17:29:53.698 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
plausible_db_1         | 2020-12-06 17:29:53.698 UTC [1] LOG:  listening on IPv6 address "::", port 5432
plausible_db_1         | 2020-12-06 17:29:53.708 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
plausible_db_1         | 2020-12-06 17:29:53.720 UTC [25] LOG:  database system was shut down at 2020-12-06 17:23:28 UTC
plausible_events_db_1  | Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
plausible_db_1         | 2020-12-06 17:29:53.733 UTC [1] LOG:  database system is ready to accept connections
plausible_events_db_1  | Include not found: clickhouse_remote_servers
plausible_events_db_1  | Include not found: clickhouse_compression
plausible_events_db_1  | Logging warning to /var/log/clickhouse-server/clickhouse-server.log
plausible_events_db_1  | Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
plausible_events_db_1  | Logging warning to console
plausible_events_db_1  | Include not found: networks
plausible_events_db_1  | 2020.12.06 17:29:53.926051 [ 1 ] {} <Warning> Application: Listen [::1]:8123 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:8123 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1  | 2020.12.06 17:29:53.926781 [ 1 ] {} <Warning> Application: Listen [::1]:9000 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:9000 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1  | 2020.12.06 17:29:53.927464 [ 1 ] {} <Warning> Application: Listen [::1]:9009 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:9009 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1  | 2020.12.06 17:29:53.928301 [ 1 ] {} <Warning> Application: Listen [::1]:9004 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:9004 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1  | Include not found: clickhouse_remote_servers
plausible_events_db_1  | Include not found: clickhouse_compression
plausible_1            | Loading plausible..
plausible_1            | Starting dependencies..
plausible_1            | Starting repos..
plausible_1            | create Plausible.Repo database if it doesn't exist
plausible_db_1         | 2020-12-06 17:30:06.347 UTC [34] ERROR:  database "plausible_db" already exists
plausible_db_1         | 2020-12-06 17:30:06.347 UTC [34] STATEMENT:  CREATE DATABASE "plausible_db" ENCODING 'UTF8'
plausible_1            | create Plausible.ClickhouseRepo database if it doesn't exist
plausible_1            | 17:23:12.470 [error] Clickhousex.Protocol (#PID<0.245.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
plausible_1            | 17:23:12.470 [error] Clickhousex.Protocol (#PID<0.244.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
plausible_1            | 17:23:12.475 [error] GenServer #PID<0.265.0> terminating
plausible_1            | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1            |     :econnrefused.exception([])
plausible_1            |     (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1            |     (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1            |     (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1            | Last message: nil
plausible_1            | 17:23:12.477 [error] GenServer #PID<0.266.0> terminating
plausible_1            | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1            |     :econnrefused.exception([])
plausible_1            |     (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1            |     (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1            |     (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1            | Last message: nil
plausible_1            | 17:23:12.479 [error] GenServer #PID<0.267.0> terminating
plausible_1            | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1            |     :econnrefused.exception([])
plausible_1            |     (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1            |     (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1            |     (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1            | Last message: nil
plausible_1            | 17:23:12.482 [error] GenServer #PID<0.268.0> terminating
plausible_1            | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1            |     :econnrefused.exception([])
plausible_1            |     (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1            |     (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1            |     (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1            | Last message: nil
plausible_1            | ** (MatchError) no match of right hand side value: {:error, "killed"}
plausible_1            |     (plausible 0.0.1) lib/plausible_release.ex:56: anonymous fn/2 in Plausible.Release.createdb/0
plausible_1            |     (elixir 1.10.3) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
plausible_1            |     (plausible 0.0.1) lib/plausible_release.ex:55: Plausible.Release.createdb/0
plausible_1            |     (stdlib 3.12.1) erl_eval.erl:680: :erl_eval.do_apply/6
plausible_1            |     (elixir 1.10.3) lib/code.ex:341: Code.eval_string_with_error_handling/3
hosting_plausible_1 exited with code 1

Interesting enough if I did docker-compose up to get more logs and figure out if clickhouse is active the entire app works. Failed 3-4 times, but currently is working.

See PR #21