synrc / n2o

⭕ N2O: Distributed WebSocket Application Server ISO 20922
https://ws.n2o.dev
Other
1.34k stars 168 forks source link

n2o crash at startup: #340

Closed mryau closed 4 years ago

mryau commented 4 years ago

steps to reproduce and console output: ssp@ssp-rio:/tmp/2$ mad get n2o ==> dependency: "https://github.com/synrc/n2o" tag: [] OK ssp@ssp-rio:/tmp/2$ cd deps/n2o/ ssp@ssp-rio:/tmp/2/deps/n2o$ ls CNAME CONTRIBUTORS.md img index.html LICENSE mix.exs README.md src test COC.md HISTORY.md include lib man priv rebar.config sys.config ssp@ssp-rio:/tmp/2/deps/n2o$ mad dep com pla rep OK ==> "/tmp/2/deps/n2o" OK OK Configuration: [{n2o,[{app,n2o}, {ws_services,["chat","crm"]}, {mqtt_services,["chat"]}, {mq,n2o_syn}, {upload,"./priv/static/"}, {protocols,[]}, {session,n2o_session}, {pickler,n2o_pickle}]}] Applications: [kernel,stdlib,n2o] Erlang/OTP 22 [erts-10.5.6] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1]

Eshell V10.5.6 (abort with ^G) 1> =CRASH REPORT==== 3-Dec-2019::19:23:38.379570 === crasher: initial call: supervisor:n2o/1 pid: <0.394.0> registered_name: [] exception error: undefined function syn:init/0 in function n2o_syn:init/0 (/tmp/2/deps/n2o/src/ws/n2o_syn.erl, line 6) in call from n2o:init/1 (/tmp/2/deps/n2o/src/n2o.erl, line 21) in call from supervisor:init/1 (supervisor.erl, line 295) in call from gen_server:init_it/2 (gen_server.erl, line 374) in call from gen_server:init_it/6 (gen_server.erl, line 342) ancestors: [<0.393.0>] message_queue_len: 0 messages: [] links: [<0.393.0>] dictionary: [] trap_exit: true status: running heap_size: 610 stack_size: 27 reductions: 317 neighbours:

=CRASH REPORT==== 3-Dec-2019::19:23:38.395196 === crasher: initial call: application_master:init/4 pid: <0.392.0> registered_name: [] exception exit: {bad_return, {{n2o,start,[normal,[]]}, {'EXIT', {noproc, {gen_server,call, [n2o, {start_child, {{caching,"/timer"}, {n2o_pi,start_link, [{pi,"/timer",caching,n2o,n2o,[]}]}, transient,5000,worker, [n2o]}}, infinity]}}}}} in function application_master:init/4 (application_master.erl, line 138) ancestors: [<0.391.0>] message_queue_len: 1 messages: [{'EXIT',<0.393.0>,normal}] links: [<0.391.0>,<0.43.0>] dictionary: [] trap_exit: true status: running heap_size: 610 stack_size: 27 reductions: 219 neighbours:

=INFO REPORT==== 3-Dec-2019::19:23:38.395687 === application: n2o exited: {bad_return, {{n2o,start,[normal,[]]}, {'EXIT', {noproc, {gen_server,call, [n2o, {start_child, {{caching,"/timer"}, {n2o_pi,start_link, [{pi,"/timer",caching,n2o,n2o,[]}]}, transient,5000,worker, [n2o]}}, infinity]}}}}} type: temporary

etxemag75 commented 4 years ago

Had the same problem, seems related to latest Erlang release (22.x), works fine for 21.3.8.8

5HT commented 4 years ago

This is related to syn taken from master.

5HT commented 4 years ago

Also I've updated n2o_syn for SYN 2.0 only. So no longer syn:init problem for custom bus initialization.

mryau commented 4 years ago

it's not an full fix: there is syn:init() call in generated src/sample.erl code for 'mad app nitro sample' In case I change it to n2o_syn:init() then application starts without exceptions but the browser shows empty page with empty source.

5HT commented 4 years ago

Both synrc/sample and synrc/mad are updated! For them I leaved syn 1.6.3.