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

Raspberry Pi + Cloudflare tunnel issue while docker compose #130

Closed
paullotz opened this issue May 27, 2024 · 5 comments
Closed

Raspberry Pi + Cloudflare tunnel issue while docker compose #130

paullotz opened this issue May 27, 2024 · 5 comments

Comments

@paullotz
Copy link

Hello.

I have an issue with installing Plausible on my RPi 4 with Cloudflare Tunnel. Downloaded the official repo. Set the BASE_URL and the two tokens and started it up with sudo docker compose up -d after 1min this errors occurs. Already checked the issue here but seems like no one encountered this issue yet. Thanks for the help.

plausible-1 | 19:14:37.067 [error] Ch.Connection (#PID<0.174.0>) failed to connect: ** (Mint.TransportError) non-existing domain plausible-1 | 19:14:37.067 [error] Ch.Connection (#PID<0.175.0>) failed to connect: ** (Mint.TransportError) non-existing domain plausible-1 | create Plausible.IngestRepo database if it doesn't exist plausible-1 | ** (MatchError) no match of right hand side value: {:error, %Mint.TransportError{reason: :nxdomain}} plausible-1 | (plausible 0.0.1) lib/plausible_release.ex:47: anonymous fn/2 in Plausible.Release.createdb/0 plausible-1 | (elixir 1.16.0) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3 plausible-1 | (plausible 0.0.1) lib/plausible_release.ex:46: Plausible.Release.createdb/0 plausible-1 | nofile:1: (file) plausible-1 | (stdlib 5.2) erl_eval.erl:750: :erl_eval.do_apply/7

@paullotz
Copy link
Author

paullotz commented May 27, 2024

Output from sudo docker container ls:

85689772ac39 ghcr.io/plausible/community-edition:v2.1.0 "/entrypoint.sh sh -…" 9 minutes ago Up 4 seconds 127.0.0.1:8000->8000/tcp hosting-plausible-1

72f62ddc7c1c clickhouse/clickhouse-server:24.3.3.102-alpine "/entrypoint.sh" 9 minutes ago Restarting (132) 58 seconds ago hosting-plausible_events_db-1

aa611a6fb187 postgres:16-alpine "docker-entrypoint.s…" 9 minutes ago Up 9 minutes 5432/tcp hosting plausible_db-1

@ruslandoga
Copy link
Contributor

ruslandoga commented May 28, 2024

👋 @paullotz

Plausible fails because it cannot connect to ClickHouse (Ch.Connection (#PID<0.174.0>) failed to connect).
ClickHouse cannot be connected to because it is not running (Restarting (132)).
ClickHouse is not running because it uses illegal instructions (exit code 132).

This is probably relevant: plausible/analytics#3817 (comment)

@wreidlinger
Copy link

wreidlinger commented Jun 1, 2024

@paullotz I think a had a similar issue first running the containers.
Guess adding DATABASE_URL and CLICKHOUSE_DATABASE_URL did the trick.
This URLs has to fit with your docker-compose config.

  • plausible-conf.env
BASE_URL=https://plausible.mydomain.com
SECRET_KEY_BASE=***
TOTP_VAULT_KEY=***
DISABLE_REGISTRATION=true
DATABASE_URL=postgres:https://postgres:postgres@plausible_db:5432/plausible_db
CLICKHOUSE_DATABASE_URL=http:https://plausible_events_db:8123/plausible_events_db
  • docker-compose.yml
name: plausible
services:
# **************************************
# MAILSERVICE
# **************************************
  mail:
    image: sverzegnassi/smtp
    container_name: plausible_mail
    hostname: smtpmail
    restart: always
    env_file:
      - plausible-conf.env
   
# **************************************
# DATABASE
# **************************************
  plausible_db:
    image: postgres:14-alpine
    container_name: plausible_db
    hostname: postgres
    restart: always
    volumes:
      - ./data/db-plausible:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=postgres

# **************************************
# EVENTS DATABASE
# **************************************
  plausible_events_db:
    image: clickhouse/clickhouse-server:23.3.7.5-alpine
    container_name: plausible_events_db
    hostname: clickhouse
    restart: always
    volumes:
      - ./data/db-clickhouse:/var/lib/clickhouse
      - ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
      - ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
    ulimits:
      nofile:
        soft: 262144
        hard: 262144

# **************************************
# PLAUSIBLE SERVICE
# **************************************
  plausible:
    image: ghcr.io/plausible/community-edition:latest
    container_name: plausible_plausible
    hostname: plausible
    restart: always
    command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db
      migrate && /entrypoint.sh run"
    depends_on:
      - plausible_db
      - plausible_events_db
      - mail
    ports:
      - 127.0.0.1:8000:8000
    env_file:
      - plausible-conf.env

Hope this helps.

@ruslandoga
Copy link
Contributor

ruslandoga commented Jun 4, 2024

Adding DATABASE_URL and CLICKHOUSE_DATABASE_URL set to default values wouldn't really change anything.

I'm going to close this issue as it's not related to Plausible but rather to ClickHouse. You might have a better chance of getting help in finding an image that works on Raspberry Pi on https://github.com/clickhouse/clickhouse or https://t.me/clickhouse_en

@ruslandoga
Copy link
Contributor

ruslandoga commented Jul 4, 2024

The solution seems to be to build your own ClickHouse image. Please see ClickHouse/ClickHouse#50852

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

3 participants