We are currently trying to setup gitlab CI to continuously run tests for all our branches. Unfortunately, quite a lot of them fail due to the following kind of errors:
test description
test/shop/shop_test.exs:134
** (RuntimeError) cannot use Logger, the :logger application is not running
We do not see those errors when running tests locally. The initial startup phase looks like:
The structure for Api.Repo has been loaded from /builds/prepaidticket/api/priv/repo/structure.sql
20:56:55.099 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':start_link({error_logger,'Elixir.Logger.ErrorHandler',{true,false,500}}) at <0.8054.0> exit with reason normal in context child_terminated
20:56:55.163 [info] Application lager started on node nonode@nohost
…
20:56:56.494 [warning] lager_error_logger_h dropped 0 messages in the last second that exceeded the limit of 50 messages/sec
20:57:03.688 [info] Application logger exited with reason: stopped
20:57:03.754 [info] Application ex_unit started on node nonode@nohost
No idea why the logger application just stops.
And then we also see errors in between like this:
=ERROR REPORT==== 23-Jul-2018::20:57:05 ===
** Generic server tzdata_release_updater terminating
** Last message in was check_if_time_to_update
** When Server state == []
** Reason for termination ==
** {#{'__exception__' => true,'__struct__' => 'Elixir.RuntimeError',
message =>
<<"cannot use Logger, the :logger application is not running">>},
[{'Elixir.Logger.Config','__data__',0,
[{file,"lib/logger/config.ex"},{line,53}]},
{'Elixir.Logger',bare_log,3,[{file,"lib/logger.ex"},{line,621}]},
{'Elixir.Tzdata.ReleaseUpdater',poll_for_update,0,
[{file,"lib/tzdata/release_updater.ex"},
{line,38}]},
{'Elixir.Tzdata.ReleaseUpdater',handle_info,2,
[{file,"lib/tzdata/release_updater.ex"},
{line,17}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,616}]},
{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,686}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
20:57:05.819 [error] gen_server tzdata_release_updater terminated with reason: #{'__exception__' => true,'__struct__' => 'Elixir.RuntimeError',message => <<"cannot use Logger, the :logger application is not running">>} in 'Elixir.Logger.Config':'__data__'/0 line 53
20:57:05.819 [error] CRASH REPORT Process tzdata_release_updater with 0 neighbours crashed with reason: #{'__exception__' => true,'__struct__' => 'Elixir.RuntimeError',message => <<"cannot use Logger, the :logger application is not running">>} in 'Elixir.Logger.Config':'__data__'/0 line 53
20:57:05.820 [error] Supervisor {<0.380.0>,'Elixir.Supervisor.Default'} had child 'Elixir.Tzdata.ReleaseUpdater' started with 'Elixir.Tzdata.ReleaseUpdater':start_link() at <0.386.0> exit with reason #{'__exception__' => true,'__struct__' => 'Elixir.RuntimeError',message => <<"cannot use Logger, the :logger application is not running">>} in 'Elixir.Logger.Config':'__data__'/0 line 53 in context child_terminated
Any idea how to fix it?