hassio-addons / addon-emqx

EMQX - Home Assistant Community Add-ons
MIT License
63 stars 13 forks source link

EMQX Crashes on start: Error Code 1 (Signal 0) #72

Closed kylepyke closed 10 months ago

kylepyke commented 11 months ago

Problem/Motivation

EMQX doesn't start in Home Assistant

Expected behavior

I expect the addon to start

Actual behavior

Crash on start with error code 1 (Signal 0)

Steps to reproduce

Click start addon.

Proposed changes

Perhaps this is a bug?

Log Output:

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting


Add-on: EMQX The most scalable open-source MQTT broker for IoT. An alternative for the Mosquitto add-on

Add-on version: 0.2.11 You are running the latest version of this add-on. System: Home Assistant OS 11.0 (amd64 / generic-x86-64) Home Assistant Core: 2023.10.3 Home Assistant Supervisor: 2023.10.0

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-timezone: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started [13:18:26] INFO: Configuring timezone (America/Chicago)... s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service base-addon-timezone successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-emqx: starting s6-rc: info: service init-emqx successfully started s6-rc: info: service emqx: starting s6-rc: info: service emqx successfully started s6-rc: info: service legacy-services: starting [13:18:26] INFO: Starting EMQX... s6-rc: info: service legacy-services successfully started EMQX_PLUGINSINSTALL_DIR [plugins.install_dir]: /data/emqx/plugins EMQX_RPC__PORT_DISCOVERY [rpc.port_discovery]: manual EMQX_NODEDATA_DIR [node.data_dir]: /data/emqx/data EMQX_NODE__COOKIE [node.cookie]: ** EMQX_NODE__NAME [node.name]: emqx@homeassistant.local 2023-10-16T13:18:30.935259-05:00 [error] ssl:default failed to listen on 8883 - eaddrinuse (address already in use) 2023-10-16T13:18:30.935588-05:00 [error] crasher: initial call: esockd_listener:init/1, pid: <0.2772.0>, registered_name: [], exit: {eaddrinuse,[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,835}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}, ancestors: [<0.2769.0>,esockd_sup,<0.2616.0>], message_queue_len: 0, messages: [], links: [<0.2769.0>], dictionary: [], trap_exit: true, status: running, heap_size: 1598, stack_size: 28, reductions: 2809; neighbours: Failed to start listener ssl:default on 0.0.0.0:8883: {eaddrinuse,{child,undefined,{listener_sup,{'ssl:default',{{0,0,0,0},8883}}},{esockd_listener_sup,start_link,[tcp,'ssl:default',{{0,0,0,0},8883},[{tcp_options,[binary,{packet,raw},{reuseaddr,true},{backlog,1024},{nodelay,true},{buffer,4096},{high_watermark,1048576},{send_timeout,15000},{send_timeout_close,true}]},{acceptors,16},{access_rules,[{allow,all}]},{max_connections,infinity},{proxy_protocol,false},{proxy_protocol_timeout,3000},{ssl_options,[{cacertfile,"/opt/emqx/etc/certs/cacert.pem"},{certfile,"/opt/emqx/etc/certs/cert.pem"},{ciphers,["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256","TLS_CHACHA20_POLY1305_SHA256","TLS_AES_128_CCM_SHA256","TLS_AES_128_CCM_8_SHA256","ECDHE-ECDSA-AES256-GCM-SHA384","ECDHE-RSA-AES256-GCM-SHA384","ECDHE-ECDSA-AES256-SHA384","ECDHE-RSA-AES256-SHA384","ECDH-ECDSA-AES256-GCM-SHA384","ECDH-RSA-AES256-GCM-SHA384","ECDH-ECDSA-AES256-SHA384","ECDH-RSA-AES256-SHA384","DHE-DSS-AES256-GCM-SHA384","DHE-DSS-AES256-SHA256","AES256-GCM-SHA384","AES256-SHA256","ECDHE-ECDSA-AES128-GCM-SHA256","ECDHE-RSA-AES128-GCM-SHA256","ECDHE-ECDSA-AES128-SHA256","ECDHE-RSA-AES128-SHA256","ECDH-ECDSA-AES128-GCM-SHA256","ECDH-RSA-AES128-GCM-SHA256","ECDH-ECDSA-AES128-SHA256","ECDH-RSA-AES128-SHA256","DHE-DSS-AES128-GCM-SHA256","DHE-DSS-AES128-SHA256","AES128-GCM-SHA256","AES128-SHA256","ECDHE-ECDSA-AES256-SHA","ECDHE-RSA-AES256-SHA","DHE-DSS-AES256-SHA","ECDH-ECDSA-AES256-SHA","ECDH-RSA-AES256-SHA","ECDHE-ECDSA-AES128-SHA","ECDHE-RSA-AES128-SHA","DHE-DSS-AES128-SHA","ECDH-ECDSA-AES128-SHA","ECDH-RSA-AES128-SHA","RSA-PSK-AES256-GCM-SHA384","RSA-PSK-AES256-CBC-SHA384","RSA-PSK-AES128-GCM-SHA256","RSA-PSK-AES128-CBC-SHA256","RSA-PSK-AES256-CBC-SHA","RSA-PSK-AES128-CBC-SHA"]},{client_renegotiation,true},{depth,10},{enable_crl_check,false},{fail_if_no_peer_cert,false},{gc_after_handshake,false},{handshake_timeout,15000},{hibernate_after,5000},{honor_cipher_order,true},{keyfile,"/opt/emqx/etc/certs/key.pem"},{log_level,notice},{ocsp,#{enable_ocsp_stapling => false,refresh_http_timeout => 15000,refresh_interval => 300000}},{reuse_sessions,true},{secure_renegotiate,true},{user_lookup_fun,{fun emqx_tls_psk:lookup/3,undefined}},{verify,verify_none},{versions,['tlsv1.3','tlsv1.2']}]},{tune_fun,{emqx_olp,backoff_new_conn,[default]}}],{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {ssl,default},zone => default}]}]},transient,false,infinity,supervisor,[esockd_listener_sup]}}. 2023-10-16T13:18:30.936743-05:00 [error] crasher: initial call: application_master:init/4, pid: <0.2660.0>, registered_name: [], exit: {{bad_return,{{emqx_app,start,[normal,[]]},{'EXIT',{{failed_to_start,"ssl:default(0.0.0.0:8883) : eaddrinuse"},[{emqx_listeners,'-foreach_listeners/1-fun-0-',2,[{file,"emqx_listeners.erl"},{line,781}]},{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},{emqx_app,maybe_start_listeners,0,[{file,"emqx_app.erl"},{line,93}]},{emqx_app,start,2,[{file,"emqx_app.erl"},{line,46}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,293}]}]}}}},[{application_master,init,4,[{file,"application_master.erl"},{line,142}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}, ancestors: [<0.2659.0>], message_queue_len: 1, messages: [{'EXIT',<0.2661.0>,normal}], links: [<0.2659.0>,<0.1989.0>], dictionary: [], trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 179; neighbours: {"Kernel pid terminated",application_controller,"{application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{'EXIT',{{failed_to_start,\"ssl:default(0.0.0.0:8883) : eaddrinuse\"},[{emqx_listeners,'-foreach_listeners/1-fun-0-',2,[{file,\"emqx_listeners.erl\"},{line,781}]},{lists,foreach_1,2,[{file,\"lists.erl\"},{line,1442}]},{emqx_app,maybe_start_listeners,0,[{file,\"emqx_app.erl\"},{line,93}]},{emqx_app,start,2,[{file,\"emqx_app.erl\"},{line,46}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,293}]}]}}}}}"}

Kernel pid terminated (application_controller) ({application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{'EXIT',{{failed_to_start,"ssl:default(0.0.0.0:8883) : eaddrinuse"},[{emqx_listeners,'-foreach_listeners/1-fun-0-',2,[{file,"emqx_listeners.erl"},{line,781}]},{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},{emqx_app,maybe_start_listeners,0,[{file,"emqx_app.erl"},{line,93}]},{emqx_app,start,2,[{file,"emqx_app.erl"},{line,46}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,293}]}]}}}}})

Crash dump is being written to: /opt/emqx/log/erl_crash.dump...done

[13:18:32] INFO: Service EMQX exited with code 1 (by signal 0) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service emqx: stopping s6-rc: info: service emqx successfully stopped s6-rc: info: service init-emqx: stopping s6-rc: info: service init-emqx successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-timezone: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-timezone successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

dMopp commented 11 months ago

2023-10-16T13:18:30.935259-05:00 [error] ssl:default failed to listen on 8883 - eaddrinuse (address already in use)

Looks like another process is using that port.

github-actions[bot] commented 10 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!