As already discussed, I am currently using Plausible in their community edition for collecting anonymous metrics about people getting on my website. They lately published a major release of the application, and I did the upgrade today. This did not go completely smoothly, so I am going to write down what went wrong.
My compose file
My compose file is essentially the one they propose in their community edition repo:
services:
plausible_db:
image: harbor.tech-tales.blog/docker-proxy/library/postgres:16-alpine
restart: unless-stopped
volumes:
- ./db-data-16:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
start_period: 1m
plausible_events_db:
image: harbor.tech-tales.blog/docker-proxy/clickhouse/clickhouse-server:24.12-alpine
restart: unless-stopped
volumes:
- ./event-data:/var/lib/clickhouse
- ./event-logs:/var/log/clickhouse-server
- ./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
environment:
CLICKHOUSE_SKIP_USER_SETUP: "1"
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1"]
start_period: 1m
plausible:
image: harbor.tech-tales.blog/github-proxy/plausible/community-edition:v3.0.1
restart: unless-stopped
command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
depends_on:
plausible_db:
condition: service_healthy
plausible_events_db:
condition: service_healthy
ports:
- 8000:8000
env_file:
- .env
volumes:
- ./plausible-data:/var/lib/plausible
ulimits:
nofile:
soft: 65535
hard: 65535
The only real difference is the usage of Docker volumes for them, where I just use path mounts.
Permission problems, obviously
When updating, I took the time, checked their proposed compose file and adapted my file accordingly. There were two important things I did not have before:
- A mount for the
/var/log/clickhouse-server
directory - A mount for
/var/lib/plausible
I added both and already anticipated that there might be permission issues. And indeed, there were.
The permission looks really bad
plausible-1 | 15:57:51.776 [notice] Application tzdata exited: exited in: Tzdata.App.start(:normal, [])
plausible-1 | ** (EXIT) an exception was raised:
plausible-1 | ** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, Tzdata.EtsHolder, {%File.Error{reason: :enoent, path: "/var/lib/plausible/tzdata_data/release_ets", action: "list directory"}, [{File, :ls!, 1, [file: ~c"lib/file.ex", line: 1700]}, {Tzdata.EtsHolder, :release_files_for_dir, 1, [file: ~c"lib/tzdata/ets_holder.ex", line: 127]}, {Tzdata.EtsHolder, :make_sure_a_release_is_on_file, 0, [file: ~c"lib/tzdata/ets_holder.ex", line: 90]}, {Tzdata.EtsHolder, :init, 1, [file: ~c"lib/tzdata/ets_holder.ex", line: 16]}, {:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 2229]}, {:gen_server, :init_it, 6, [file: ~c"gen_server.erl", line: 2184]}, {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 329]}]}}}}
plausible-1 | (tzdata 1.1.3) lib/tzdata/tzdata_app.ex:13: Tzdata.App.start/2
plausible-1 | (kernel 10.2.4) application_master.erl:295: :application_master.start_it_old/4
plausible-1 | Kernel pid terminated (application_controller) ("{application_start_failure,tzdata,{bad_return,{{'Elixir.Tzdata.App',start,[normal,[]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,'Elixir.Tzdata.EtsHolder',{#{reason => enoent,path => <<\"/var/lib/plausible/tzdata_data/release_ets\">>,action => <<\"list directory\">>,'__struct__' => 'Elixir.File.Error','__exception__' => true},[{'Elixir.File','ls!',1,[{file,\"lib/file.ex\"},{line,1700}]},{'Elixir.Tzdata.EtsHolder',release_files_for_dir,1,[{file,\"lib/tzdata/ets_holder.ex\"},{line,127}]},{'Elixir.Tzdata.EtsHolder',make_sure_a_release_is_on_file,0,[{file,\"lib/tzdata/ets_holder.ex\"},{line,90}]},{'Elixir.Tzdata.EtsHolder',init,1,[{file,\"lib/tzdata/ets_holder.ex\"},{line,16}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,2229}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,2184}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,329}]}]}}}}},[{'Elixir.Tzdata.App',start,2,[{file,\"lib/tzdata/tzdata_app.ex\"},{line,13}
It’s not even mentioned that there might be a permission error somewhere…
But so be it. I checked which user ID plausible uses: docker compose exec plausible id
, which returned the ID 999
and the GID 65533
. I then ran (sudo) chmod -R 999 plausible-data
, and everything was fine again.
Side note
As it turns out, for me, not much changed with the new version. Everything still looks the same as before. But it’s probably a good thing that the major version was updated?