Having trouble interpreting this Eshell crash report

I’m trying to use the ecpool library to pool Mongo db connections.

My supervisor’s init looks like what I added in the first code snippet.

mongo_client is a module that I use to setup the connection to a Mongo instance.

No matter the input, I get an undef error at runtime but I am having trouble interpreting the crash report. Any hints would be appreciated.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>init([]) ->
PoolSize = 10,
Urls = ["localhost:27017"],
Database = "test",
Username = "test",
Password = "test",
Type = single,
% Define the worker arguments
WorkerArgs = [
{hosts, Urls},
{database, Database},
{login, Username},
{password, Password},
{type, Type}
],
PoolOptions = [
{pool_size, PoolSize},
{auto_reconnect, 1},
{options, []},
{worker_options, WorkerArgs}
],
PoolSpec = ecpool:pool_spec(?APP, ?APP, mongo_client, PoolOptions),
{ok, {{one_for_all, 10, 100}, [PoolSpec]}}.
</code>
<code>init([]) -> PoolSize = 10, Urls = ["localhost:27017"], Database = "test", Username = "test", Password = "test", Type = single, % Define the worker arguments WorkerArgs = [ {hosts, Urls}, {database, Database}, {login, Username}, {password, Password}, {type, Type} ], PoolOptions = [ {pool_size, PoolSize}, {auto_reconnect, 1}, {options, []}, {worker_options, WorkerArgs} ], PoolSpec = ecpool:pool_spec(?APP, ?APP, mongo_client, PoolOptions), {ok, {{one_for_all, 10, 100}, [PoolSpec]}}. </code>
init([]) ->
    PoolSize = 10,
    Urls = ["localhost:27017"],
    Database = "test",
    Username = "test",
    Password = "test",
    Type = single,

    % Define the worker arguments
    WorkerArgs = [
        {hosts, Urls},
        {database, Database},
        {login, Username},
        {password, Password},
        {type, Type}
    ],

    PoolOptions = [
        {pool_size, PoolSize},
        {auto_reconnect, 1},
        {options, []},
        {worker_options, WorkerArgs}
    ],

    PoolSpec = ecpool:pool_spec(?APP, ?APP, mongo_client, PoolOptions),

    {ok, {{one_for_all, 10, 100}, [PoolSpec]}}. 

Crash report:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Eshell V15.0.1 (press Ctrl+G to abort, type help(). for help)
=CRASH REPORT==== 29-Aug-2024::16:19:21.153000 ===
crasher:
initial call: ecpool_worker:init/1
pid: <0.253.0>
registered_name: []
exception exit: undef
in function gen_server:init_it/6 (gen_server.erl, line 2038)
ancestors: [<0.252.0>,<0.250.0>,mongo_app_sup,<0.248.0>]
message_queue_len: 0
messages: []
links: [<0.252.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 233
stack_size: 29
reductions: 103
neighbours:
=SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 ===
supervisor: {<0.252.0>,ecpool_worker_sup}
errorContext: start_error
reason: undef
offender: [{pid,undefined},
{id,{worker,1}},
{mfargs,
{ecpool_worker,start_link,
[mongo_app,1,mongo_client,
[{pool_size,10},
{auto_reconnect,1},
{options,[]},
{worker_options,
[{hosts,["localhost:27017"]},
{database,"test"},
{login,"test"},
{password,"test"},
{type,single}]}]]}},
{restart_type,transient},
{significant,false},
{shutdown,5000},
{child_type,worker}]
=SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 ===
supervisor: {<0.250.0>,ecpool_pool_sup}
errorContext: start_error
reason: {shutdown,{failed_to_start_child,{worker,1},undef}}
offender: [{pid,undefined},
{id,worker_sup},
{mfargs,
{ecpool_worker_sup,start_link,
[mongo_app,mongo_client,
[{pool_size,10},
{auto_reconnect,1},
{options,[]},
{worker_options,
[{hosts,["localhost:27017"]},
{database,"test"},
{login,"test"},
{password,"test"},
{type,single}]}]]}},
{restart_type,transient},
{significant,false},
{shutdown,infinity},
{child_type,supervisor}]
=SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 ===
supervisor: {local,mongo_app_sup}
errorContext: start_error
reason: {shutdown,
{failed_to_start_child,worker_sup,
{shutdown,{failed_to_start_child,{worker,1},undef}}}}
offender: [{pid,undefined},
{id,mongo_app},
{mfargs,
{ecpool,start_pool,
[mongo_app,mongo_client,
[{pool_size,10},
{auto_reconnect,1},
{options,[]},
{worker_options,
[{hosts,["localhost:27017"]},
{database,"test"},
{login,"test"},
{password,"test"},
{type,single}]}]]}},
{restart_type,permanent},
{significant,false},
{shutdown,5000},
{child_type,supervisor}]
=INFO REPORT==== 29-Aug-2024::16:19:21.158000 ===
application: mongo_app
exited: {{shutdown,
{failed_to_start_child,mongo_app,
{shutdown,
{failed_to_start_child,worker_sup,
{shutdown,
{failed_to_start_child,{worker,1},undef}}}}}},
{mongo_app_app,start,[normal,[]]}}
type: temporary
=CRASH REPORT==== 29-Aug-2024::16:19:21.158000 ===
crasher:
initial call: application_master:init/3
pid: <0.247.0>
registered_name: []
exception exit: {{shutdown,
{failed_to_start_child,mongo_app,
{shutdown,
{failed_to_start_child,worker_sup,
{shutdown,
{failed_to_start_child,{worker,1},undef}}}}}},
{mongo_app_app,start,[normal,[]]}}
in function application_master:init/3 (application_master.erl, line 143)
ancestors: [application_controller,<0.10.0>]
message_queue_len: 1
messages: [{'EXIT',<0.248.0>,normal}]
links: [<0.45.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 29
reductions: 70
neighbours:
=INFO REPORT==== 29-Aug-2024::16:19:21.165000 ===
application: ecpool
exited: stopped
type: temporary
=INFO REPORT==== 29-Aug-2024::16:19:21.171000 ===
application: gproc
exited: stopped
type: temporary
=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
application: mongodb
exited: stopped
type: temporary
=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
application: pbkdf2
exited: stopped
type: temporary
=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
application: poolboy
exited: stopped
type: temporary
=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
application: bson
exited: stopped
type: temporary
===> Booted sasl
===> Failed to boot mongo_app for reason {{shutdown,
{failed_to_start_child,mongo_app,
{shutdown,
{failed_to_start_child,
worker_sup,
{shutdown,
{failed_to_start_child,
{worker,1},
undef}}}}}},
{mongo_app_app,start,[normal,[]]}}
</code>
<code>Eshell V15.0.1 (press Ctrl+G to abort, type help(). for help) =CRASH REPORT==== 29-Aug-2024::16:19:21.153000 === crasher: initial call: ecpool_worker:init/1 pid: <0.253.0> registered_name: [] exception exit: undef in function gen_server:init_it/6 (gen_server.erl, line 2038) ancestors: [<0.252.0>,<0.250.0>,mongo_app_sup,<0.248.0>] message_queue_len: 0 messages: [] links: [<0.252.0>] dictionary: [] trap_exit: true status: running heap_size: 233 stack_size: 29 reductions: 103 neighbours: =SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 === supervisor: {<0.252.0>,ecpool_worker_sup} errorContext: start_error reason: undef offender: [{pid,undefined}, {id,{worker,1}}, {mfargs, {ecpool_worker,start_link, [mongo_app,1,mongo_client, [{pool_size,10}, {auto_reconnect,1}, {options,[]}, {worker_options, [{hosts,["localhost:27017"]}, {database,"test"}, {login,"test"}, {password,"test"}, {type,single}]}]]}}, {restart_type,transient}, {significant,false}, {shutdown,5000}, {child_type,worker}] =SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 === supervisor: {<0.250.0>,ecpool_pool_sup} errorContext: start_error reason: {shutdown,{failed_to_start_child,{worker,1},undef}} offender: [{pid,undefined}, {id,worker_sup}, {mfargs, {ecpool_worker_sup,start_link, [mongo_app,mongo_client, [{pool_size,10}, {auto_reconnect,1}, {options,[]}, {worker_options, [{hosts,["localhost:27017"]}, {database,"test"}, {login,"test"}, {password,"test"}, {type,single}]}]]}}, {restart_type,transient}, {significant,false}, {shutdown,infinity}, {child_type,supervisor}] =SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 === supervisor: {local,mongo_app_sup} errorContext: start_error reason: {shutdown, {failed_to_start_child,worker_sup, {shutdown,{failed_to_start_child,{worker,1},undef}}}} offender: [{pid,undefined}, {id,mongo_app}, {mfargs, {ecpool,start_pool, [mongo_app,mongo_client, [{pool_size,10}, {auto_reconnect,1}, {options,[]}, {worker_options, [{hosts,["localhost:27017"]}, {database,"test"}, {login,"test"}, {password,"test"}, {type,single}]}]]}}, {restart_type,permanent}, {significant,false}, {shutdown,5000}, {child_type,supervisor}] =INFO REPORT==== 29-Aug-2024::16:19:21.158000 === application: mongo_app exited: {{shutdown, {failed_to_start_child,mongo_app, {shutdown, {failed_to_start_child,worker_sup, {shutdown, {failed_to_start_child,{worker,1},undef}}}}}}, {mongo_app_app,start,[normal,[]]}} type: temporary =CRASH REPORT==== 29-Aug-2024::16:19:21.158000 === crasher: initial call: application_master:init/3 pid: <0.247.0> registered_name: [] exception exit: {{shutdown, {failed_to_start_child,mongo_app, {shutdown, {failed_to_start_child,worker_sup, {shutdown, {failed_to_start_child,{worker,1},undef}}}}}}, {mongo_app_app,start,[normal,[]]}} in function application_master:init/3 (application_master.erl, line 143) ancestors: [application_controller,<0.10.0>] message_queue_len: 1 messages: [{'EXIT',<0.248.0>,normal}] links: [<0.45.0>] dictionary: [] trap_exit: true status: running heap_size: 376 stack_size: 29 reductions: 70 neighbours: =INFO REPORT==== 29-Aug-2024::16:19:21.165000 === application: ecpool exited: stopped type: temporary =INFO REPORT==== 29-Aug-2024::16:19:21.171000 === application: gproc exited: stopped type: temporary =INFO REPORT==== 29-Aug-2024::16:19:21.176000 === application: mongodb exited: stopped type: temporary =INFO REPORT==== 29-Aug-2024::16:19:21.176000 === application: pbkdf2 exited: stopped type: temporary =INFO REPORT==== 29-Aug-2024::16:19:21.176000 === application: poolboy exited: stopped type: temporary =INFO REPORT==== 29-Aug-2024::16:19:21.176000 === application: bson exited: stopped type: temporary ===> Booted sasl ===> Failed to boot mongo_app for reason {{shutdown, {failed_to_start_child,mongo_app, {shutdown, {failed_to_start_child, worker_sup, {shutdown, {failed_to_start_child, {worker,1}, undef}}}}}}, {mongo_app_app,start,[normal,[]]}} </code>
Eshell V15.0.1 (press Ctrl+G to abort, type help(). for help)
=CRASH REPORT==== 29-Aug-2024::16:19:21.153000 ===
  crasher:
    initial call: ecpool_worker:init/1
    pid: <0.253.0>
    registered_name: []
    exception exit: undef
      in function  gen_server:init_it/6 (gen_server.erl, line 2038)
    ancestors: [<0.252.0>,<0.250.0>,mongo_app_sup,<0.248.0>]
    message_queue_len: 0
    messages: []
    links: [<0.252.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 233
    stack_size: 29
    reductions: 103
  neighbours:

=SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 ===
    supervisor: {<0.252.0>,ecpool_worker_sup}
    errorContext: start_error
    reason: undef
    offender: [{pid,undefined},
               {id,{worker,1}},
               {mfargs,
                   {ecpool_worker,start_link,
                       [mongo_app,1,mongo_client,
                        [{pool_size,10},
                         {auto_reconnect,1},
                         {options,[]},
                         {worker_options,
                             [{hosts,["localhost:27017"]},
                              {database,"test"},
                              {login,"test"},
                              {password,"test"},
                              {type,single}]}]]}},
               {restart_type,transient},
               {significant,false},
               {shutdown,5000},
               {child_type,worker}]

=SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 ===
    supervisor: {<0.250.0>,ecpool_pool_sup}
    errorContext: start_error
    reason: {shutdown,{failed_to_start_child,{worker,1},undef}}
    offender: [{pid,undefined},
               {id,worker_sup},
               {mfargs,
                   {ecpool_worker_sup,start_link,
                       [mongo_app,mongo_client,
                        [{pool_size,10},
                         {auto_reconnect,1},
                         {options,[]},
                         {worker_options,
                             [{hosts,["localhost:27017"]},
                              {database,"test"},
                              {login,"test"},
                              {password,"test"},
                              {type,single}]}]]}},
               {restart_type,transient},
               {significant,false},
               {shutdown,infinity},
               {child_type,supervisor}]

=SUPERVISOR REPORT==== 29-Aug-2024::16:19:21.158000 ===
    supervisor: {local,mongo_app_sup}
    errorContext: start_error
    reason: {shutdown,
                {failed_to_start_child,worker_sup,
                    {shutdown,{failed_to_start_child,{worker,1},undef}}}}
    offender: [{pid,undefined},
               {id,mongo_app},
               {mfargs,
                   {ecpool,start_pool,
                       [mongo_app,mongo_client,
                        [{pool_size,10},
                         {auto_reconnect,1},
                         {options,[]},
                         {worker_options,
                             [{hosts,["localhost:27017"]},
                              {database,"test"},
                              {login,"test"},
                              {password,"test"},
                              {type,single}]}]]}},
               {restart_type,permanent},
               {significant,false},
               {shutdown,5000},
               {child_type,supervisor}]

=INFO REPORT==== 29-Aug-2024::16:19:21.158000 ===
    application: mongo_app
    exited: {{shutdown,
                 {failed_to_start_child,mongo_app,
                     {shutdown,
                         {failed_to_start_child,worker_sup,
                             {shutdown,
                                 {failed_to_start_child,{worker,1},undef}}}}}},
             {mongo_app_app,start,[normal,[]]}}
    type: temporary

=CRASH REPORT==== 29-Aug-2024::16:19:21.158000 ===
  crasher:
    initial call: application_master:init/3
    pid: <0.247.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,mongo_app,
                       {shutdown,
                        {failed_to_start_child,worker_sup,
                         {shutdown,
                          {failed_to_start_child,{worker,1},undef}}}}}},
                     {mongo_app_app,start,[normal,[]]}}
      in function  application_master:init/3 (application_master.erl, line 143)
    ancestors: [application_controller,<0.10.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.248.0>,normal}]
    links: [<0.45.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 376
    stack_size: 29
    reductions: 70
  neighbours:

=INFO REPORT==== 29-Aug-2024::16:19:21.165000 ===
    application: ecpool
    exited: stopped
    type: temporary

=INFO REPORT==== 29-Aug-2024::16:19:21.171000 ===
    application: gproc
    exited: stopped
    type: temporary

=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
    application: mongodb
    exited: stopped
    type: temporary

=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
    application: pbkdf2
    exited: stopped
    type: temporary

=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
    application: poolboy
    exited: stopped
    type: temporary

=INFO REPORT==== 29-Aug-2024::16:19:21.176000 ===
    application: bson
    exited: stopped
    type: temporary

===> Booted sasl
===> Failed to boot mongo_app for reason {{shutdown,
                                           {failed_to_start_child,mongo_app,
                                            {shutdown,
                                             {failed_to_start_child,
                                              worker_sup,
                                              {shutdown,
                                               {failed_to_start_child,
                                                {worker,1},
                                                undef}}}}}},
                                          {mongo_app_app,start,[normal,[]]}}

Pretty odd. Looks to me like the ecpool_worker_sup starts, but somehow the ecpool_worker gets too few arguments to its init function. It should get [Pool, Id, Mod, Opts, InitialConnectResultReceiverAlias], but in the error message I only see [mongo_app,1,mongo_client,[{pool_size,10},...]], so the undef probably refers to not finding init/4, because ecpool_worker exports init/5.

Could it be that you’ve got mismatched versions of ecpool_worker_sup and ecpool_worker? Perhaps just old .beam files lying around.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật