Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup issue - Clickhouse DB Connection #25

Closed
hottehead opened this issue Dec 4, 2020 · 2 comments
Closed

Startup issue - Clickhouse DB Connection #25

hottehead opened this issue Dec 4, 2020 · 2 comments

Comments

@hottehead
Copy link

hottehead commented Dec 4, 2020

Hey,

I tried to spin up the docker environment and im having the following error which I cannot resolve. It seems that the plausible_events_db container is not reachable.

Loading plausible..
Starting dependencies..
Starting repos..
create Plausible.Repo database if it doesn't exist
create Plausible.ClickhouseRepo database if it doesn't exist
13:47:45.948 [error] Clickhousex.Protocol (#PID<0.244.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
13:47:45.948 [error] Clickhousex.Protocol (#PID<0.245.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
13:47:45.962 [error] GenServer #PID<0.265.0> terminating
** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
    :econnrefused.exception([])
    (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
    (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil

[... repeat former block * 4]

** (MatchError) no match of right hand side value: {:error, "killed"}
    (plausible 0.0.1) lib/plausible_release.ex:56: anonymous fn/2 in Plausible.Release.createdb/0
    (elixir 1.10.3) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    (plausible 0.0.1) lib/plausible_release.ex:55: Plausible.Release.createdb/0
    (stdlib 3.12.1) erl_eval.erl:680: :erl_eval.do_apply/6
    (elixir 1.10.3) lib/code.ex:341: Code.eval_string_with_error_handling/3

In the beginning the server couldn't even bind to the requested IPv6 address. So I instructed it to bind on IPv4 in two ways like this in clickhouse-config.xml

<yandex>
    ...
    <listen_host>127.0.0.1</listen_host> // <listen_host>0.0.0.0</listen_host>
    ...
</yandex>

Due to the sparse log of where it tried to connect I set the upstream manually like this in plausible-conf.env. Still no luck.

CLICKHOUSE_DATABASE_URL=http://plausible_events_db:8123/plausible_events_db
@mabasic
Copy link
Contributor

mabasic commented Dec 4, 2020

I got it working by setting it to:

<listen_host>0.0.0.0</listen_host>

See PR #21

@hottehead
Copy link
Author

Totally confused now. I checked out everything in a new folder. Only applied the patch you mentioned and it works. Probably a docker error down the testing line. The configuration is working. Thanks for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants