Actually it sometimes crashes when used by Ecto… and sometimes when rendering a web view. Is there a way to assert that the function is available or force its loading?
Like:
12:42:47.065 mfa=:telemetry.execute/3 [error] Handler {Phoenix.Logger, [:phoenix, :router_dispatch, :start]} has failed and has been
detached. Class=:error
Reason=:undef
Stacktrace=[
{Inspect, :inspect,
[
LogfwdWeb.PageController,
%Inspect.Opts{
base: :decimal,
binaries: :infer,
char_lists: :infer,
charlists: :infer,
custom_options: [],
inspect_fun: &Inspect.inspect/2,
limit: 50,
pretty: false,
printable_limit: 4096,
safe: true,
structs: true,
syntax_colors: [],
width: 80
}
], []},
{Kernel, :inspect, 2, [file: 'lib/kernel.ex', line: 2203]},
{Phoenix.Logger, :"-phoenix_router_dispatch_start/4-fun-0-", 4,
[file: 'lib/phoenix/logger.ex', line: 234]},
{Logger, :__do_log__, 4, [file: 'lib/logger.ex', line: 777]},
{:telemetry, :"-execute/3-fun-0-", 4,
[file: '/root/src/LogFwd/deps/telemetry/src/telemetry.erl', line: 135]},
{:lists, :foreach, 2, [file: 'lists.erl', line: 1342]},
{Phoenix.Router, :__call__, 2, [file: 'lib/phoenix/router.ex', line: 345]},
{LogfwdWeb.Endpoint, :plug_builder_call, 2,
[file: 'lib/logfwd_web/endpoint.ex', line: 1]},
{LogfwdWeb.Endpoint, :"call (overridable 3)", 2,
[file: 'lib/plug/debugger.ex', line: 136]},
{LogfwdWeb.Endpoint, :call, 2, [file: 'lib/logfwd_web/endpoint.ex', line: 1]},
{Phoenix.Endpoint.Cowboy2Handler, :init, 4,
[file: 'lib/phoenix/endpoint/cowboy2_handler.ex', line: 65]},
{:cowboy_handler, :execute, 2,
[file: '/root/src/LogFwd/deps/cowboy/src/cowboy_handler.erl', line: 37]},
{:cowboy_stream_h, :execute, 3,
[file: '/root/src/LogFwd/deps/cowboy/src/cowboy_stream_h.erl', line: 300]},
{:cowboy_stream_h, :request_process, 3,
[file: '/root/src/LogFwd/deps/cowboy/src/cowboy_stream_h.erl', line: 291]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}
]
or
** (UndefinedFunctionError) function Inspect.inspect/2 is undefined or private
(elixir 1.12.2) Inspect.inspect({:ok, %{.......}, %Inspect.Opts{base: :decimal, binaries: :infer, char_lists: :infer, charlists: :infer, custom_options: [], inspect_fun: &Inspect.inspect/2, limit: 50, pretty: false, printable_limit: 4096, safe: true, structs: true, syntax_colors: [], width: 80})
(elixir 1.12.2) lib/kernel.ex:2203: Kernel.inspect/2
(logfwd 0.3.12) lib/logfwd/tools.ex:424: Logfwd.Tools.jsonHttp/5
(logfwd 0.3.12) lib/logfwd/tx/apis.ex:929: Logfwd.Teams.Apis.jsonCallGet/3
(logfwd 0.3.12) lib/logfwd/tx/subs.ex:144: Logfwd.Teams.Subs.listSubscriptions/1
(logfwd 0.3.12) lib/logfwd/tx/subs.ex:161: Logfwd.Teams.Subs.listSubscriptionsAsSubs/2
(elixir 1.12.2) lib/enum.ex:2385: Enum."-reduce/3-lists^foldl/2-0-"/3
(logfwd 0.3.12) lib/logfwd/tx/subsrv.ex:385: Logfwd.Teams.SubsSrv.handle_call/3
(stdlib 3.15.1) gen_server.erl:721: :gen_server.try_handle_call/4
(stdlib 3.15.1) gen_server.erl:750: :gen_server.handle_msg/6
(stdlib 3.15.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
or this coming from Ecto:
** (UndefinedFunction
Error) function Inspect.inspect/2 is undefined or private
(elixir 1.12.2) Inspect.inspect("t_calls", %Inspect.Opts{base: :decimal, binaries: :infer, char_lists: :infer, charlists: :infer, custom_options: [], inspect_fun: &Inspect.inspect/2, limit: 50, pretty: false, printable_limit: 4096, safe: true, structs: true, syntax_colors: [], width: 80})
(elixir 1.12.2) lib/kernel.ex:2203: Kernel.inspect/2
(ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:998: Ecto.Adapters.SQL.log_ok_source/1
(ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:982: Ecto.Adapters.SQL.log_iodata/2
(logger 1.12.2) lib/logger.ex:777: Logger.__do_log__/4
(ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:948: Ecto.Adapters.SQL.log/4
(db_connection 2.3.1) lib/db_connection.ex:1401: DBConnection.log/5
(myxql 0.4.5) lib/myxql.ex:243: MyXQL.do_query/4
(ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:717: Ecto.Adapters.SQL.execute!/4
(ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:684: Ecto.Adapters.SQL.execute/5
(ecto 3.5.6) lib/ecto/repo/queryable.ex:229: Ecto.Repo.Queryable.execute/4
(ecto 3.5.6) lib/ecto/repo/queryable.ex:17: Ecto.Repo.Queryable.all/3
(logfwd 0.3.12) lib/logfwd/tx/db/dbcall.ex:358: Logfwd.Teams.Db.DbCall.fetch_open_call_if_exists/2
(logfwd 0.3.12) lib/logfwd/tx/db/dbcall.ex:162: Logfwd.Teams.Db.DbCall.new_call_notification/2
(logfwd 0.3.12) lib/logfwd/tx/calltrackersrv.ex:154: Logfwd.Teams.CallTrackerSrv.call_received/3
(logfwd 0.3.12) lib/logfwd_web/controllers/page_controller.ex:122: LogfwdWeb.PageController.notifyTenantOfCall/3
(logfwd 0.3.12) lib/logfwd_web/controllers/page_controller.ex:108: anonymous fn/2 in LogfwdWeb.PageController.downloadEntries/1
(elixir 1.12.2) lib/enum.ex:2385: Enum."-reduce/3-lists^foldl/2-0-"/3