Skip to content

CONFIG_DIR file-based configuration ignored? #258

@Ginner

Description

@Ginner

First off thank you for all your work and for making a community edition available to your users!

I'm at the end of my wits. I'm attempting to get the docker compose project running with 'CONFIG_DIR' set.

Here's a relevant excerpt from my docker-compose.yml file:

services:
  plausible:
    image: ghcr.io/plausible/community-edition:v3.0.1
    volumes:
      - /run/secrets/plausible:/run/secrets:ro
    environment:
      CONFIG_DIR: /run/secrets   # I've attempte with and without this (as it should be default)
    depends_on:
      - plausible_db
      - plausible_events_db

Secret files on the host (notice read-permissions):

sudo ls -la /run/secrets/plausible
total 20
drwxr-x--- 2 root root 140 Oct 29 10:28 .
drwxr-x--- 3 root root  60 Oct 29 10:28 ..
-rw-r--r-- 1 root root  23 Oct 29 10:28 BASE_URL
-rw-r--r-- 1 root root  41 Oct 29 10:28 CLICKHOUSE_DATABASE_URL
-rw-r--r-- 1 root root  81 Oct 29 10:28 DATABASE_URL
-rw-r--r-- 1 root root  29 Oct 29 10:28 POSTGRES_PASSWORD
-rw-r--r-- 1 root root  64 Oct 29 10:28 SECRET_KEY_BASE

What I've attempted so far(amongst other, less sane trouble-shootings):

  • I've verified that CONFIG_DIR is present in the container with docker inspect
  • Verified the secret file's presence and contents (no \n, ", or similar - Single line variable)
  • All kinds of file permission and ownership
  • Tried mounting to /run/secrets/plausible and setting CONFIG_DIR to that
  • Added BASE_URL as an environment variable in docker-compose.yml, Which bumps the issue down to SECRET_KEY_BASE(!)
  • At each attempt I've nuked the containers (docker compose down -> docker system prune -a -> confirm empty docker ps, etc.)
  • Added _FILE to the variables (Hail Mary, but one gets desperate)

It seems to me, that CONFIG_DIR file-based configuration are ignored or unread inside the container, causing Plausible to crash with “BASE_URL configuration option is required." and the container to perpetually restart.

Here is a full error output (perceived repetition excluded), docker logs plausible-plausible-1:

ERROR! Config provider Config.Reader failed with:
** (RuntimeError) BASE_URL configuration option is required. See https://github.com/plausible/community-edition/wiki/configuration#base_url
    /app/releases/0.0.1/runtime.exs:68: (file)
    (elixir 1.18.3) src/elixir.erl:386: :elixir.eval_external_handler/3
    (stdlib 6.2.2) erl_eval.erl:919: :erl_eval.do_apply/7
    (stdlib 6.2.2) erl_eval.erl:271: :erl_eval.exprs/6
    (elixir 1.18.3) src/elixir.erl:364: :elixir.eval_forms/4
    (elixir 1.18.3) lib/module/parallel_checker.ex:120: Module.ParallelChecker.verify/1
    (elixir 1.18.3) lib/code.ex:572: Code.validated_eval_string/3
    (elixir 1.18.3) lib/config.ex:316: Config.__eval__!/3

Runtime terminating during boot ({#{message=><<"BASE_URL configuration option is required. See https://github.com/plausible/community-edition/wiki/configuration#base_url">>,'__struct__'=>'Elixir.RuntimeError','__exception__'=>true},[{elixir_eval,'__FILE__',1,[{file,"/app/releases/0.0.1/runtime.exs"},{line,68}]},{elixir,eval_external_handler,3,[{file,"src/elixir.erl"},{line,386},{error_info,#{module=>'Elixir.Exception'}}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,919}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,271}]},{elixir,eval_forms,4,[{file,"src/elixir.erl"},{line,364}]},{'Elixir.Module.ParallelChecker',verify,1,[{file,"lib/module/parallel_checker.ex"},{line,120}]},{'Elixir.Code',validated_eval_string,3,[{file,"lib/code.ex"},{line,572}]},{'Elixir.Config','__eval__!',3,[{file,"lib/config.ex"},{line,316}]}]})

Crash dump is being written to: erl_crash.dump...ERROR! Config provider Config.Reader failed with:
Runtime terminating during boot ({#{message=><<"BASE_URL configuration option is required. See https://github.com/plausible/community-edition/wiki/configuration#base_url">>,'__struct__'=>'Elixir.RuntimeError','__exception__'=>true},[{elixir_eval,'__FILE__',1,[{file,"/app/releases/0.0.1/runtime.exs"},{line,68}]},{elixir,eval_external_handler,3,[{file,"src/elixir.erl"},{line,386},{error_info,#{module=>'Elixir.Exception'}}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,919}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,271}]},{elixir,eval_forms,4,[{file,"src/elixir.erl"},{line,364}]},{'Elixir.Module.ParallelChecker',verify,1,[{file,"lib/module/parallel_checker.ex"},{line,120}]},{'Elixir.Code',validated_eval_string,3,[{file,"lib/code.ex"},{line,572}]},{'Elixir.Config','__eval__!',3,[{file,"lib/config.ex"},{line,316}]}]})
** (RuntimeError) BASE_URL configuration option is required. See https://github.com/plausible/community-edition/wiki/configuration#base_url
    /app/releases/0.0.1/runtime.exs:68: (file)
    (elixir 1.18.3) src/elixir.erl:386: :elixir.eval_external_handler/3
    (stdlib 6.2.2) erl_eval.erl:919: :erl_eval.do_apply/7
    (stdlib 6.2.2) erl_eval.erl:271: :erl_eval.exprs/6
    (elixir 1.18.3) src/elixir.erl:364: :elixir.eval_forms/4
    (elixir 1.18.3) lib/module/parallel_checker.ex:120: Module.ParallelChecker.verify/1
    (elixir 1.18.3) lib/code.ex:572: Code.validated_eval_string/3
    (elixir 1.18.3) lib/config.ex:316: Config.__eval__!/3


Crash dump is being written to: erl_crash.dump...ERROR! Config provider Config.Reader failed with:
** (RuntimeError) BASE_URL configuration option is required. See https://github.com/plausible/community-edition/wiki/configuration#base_url
    /app/releases/0.0.1/runtime.exs:68: (file)
    (elixir 1.18.3) src/elixir.erl:386: :elixir.eval_external_handler/3
    (stdlib 6.2.2) erl_eval.erl:919: :erl_eval.do_apply/7
    (stdlib 6.2.2) erl_eval.erl:271: :erl_eval.exprs/6
    (elixir 1.18.3) src/elixir.erl:364: :elixir.eval_forms/4
    (elixir 1.18.3) lib/module/parallel_checker.ex:120: Module.ParallelChecker.verify/1
    (elixir 1.18.3) lib/code.ex:572: Code.validated_eval_string/3
    (elixir 1.18.3) lib/config.ex:316: Config.__eval__!/3

Any insight or comments are highly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions