代码之家  ›  专栏  ›  技术社区  ›  Augie Li

AWS上的Ejabberd MQTT:undefined exit,原因是{'exit',{undef,[{mod_MQTT,socket_type,[],[]}

  •  0
  • Augie Li  · 技术社区  · 6 年前

    我遵循教程 https://docs.ejabberd.im/admin/guide/mqtt/#enabling-mqtt-service-in-ejabberd .

    hosts:
      - "localhost"
    
    listen:
      -
        port: 1883
        module: mod_mqtt
        backlog: 1000      
      -
        port: 5280
        module: ejabberd_http
        request_handlers:
           ...
           "/mqtt": mod_mqtt
      -
        port: 8883
        module: mod_mqtt
        backlog: 1000
        tls: true
    
    # adapt the path to your own certfile    
    certfiles:
      - "/var/snap/ejabberd/tls/mqtt.pem"
    
    modules:
    ...
      mod_mqtt: {}
    

    2020-03-29 21:30:59.416 [error] <0.299.0> Supervisor ejabberd_listener had child 
    {1883,{0,0,0,0},tcp} started with ejabberd_listener:start({1883,{0,0,0,0},tcp}, 
    mod_mqtt, [{backlog,1000}]) at undefined exit with reason {'EXIT',{undef,
    [{mod_mqtt,socket_type,[],[]},{ejabberd_listener,start,3,[{file,
    "src/ejabberd_listener.erl"},{line,86}]},{supervisor,do_start_child,2,[{file,
    "supervisor.erl"},{line,358}]},{supervisor,start_children,3,[{file,
    "supervisor.erl"},{line,341}]},{supervisor,init_children,2,[{file,
    "supervisor.erl"},{line,307}]},{gen_server,init_it,6,[{file,"gen_server.erl"},
    {line,328}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}} 
    in context start_error
    

    2020-03-29 21:29:31.371 [error] <0.38.0>@ejabberd_config:validate_opts:1022 
    unknown option 'certfiles' will be likely ignored
    
    0 回复  |  直到 6 年前
        1
  •  1
  •   Badlop    6 年前

    {undef,[{mod_mqtt,套接字类型,[],[]},

    mod_mqtt.beam ... 或者可能找到了该文件,但它没有包含函数socket_type/0的定义。ejabberd 19.02中添加了具有该功能的模块: https://github.com/processone/ejabberd/commit/a3df791373c30ccc79a6082f4c910a378d726cdc

    选择权 certfiles

    https://github.com/processone/ejabberd/commit/35b7203e01aefbdfe4ea7804ebe20a8667466628

    推荐文章