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:
| |
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-serverdirectory - 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?