emq无法订阅/#问题解决

环境信息

  • EMQ X 版本:4.3.5
  • 操作系统及版本:linux centos7
  • 其他

问题描述

在研究emq共享订阅的时候发现没有办法订阅通配符 /#

在多次卸载重装更换版本无果后,也是没有办法

今天突发奇想,emqx通常目录为

/usr/lib/emqx
/etc/emqx
/var/lib/emqx
/var/log/emqx

我在卸载完emq后 发现/etc/emqx、/var/lib/emqx、/var/log/emqx 目录中还有文件剩余
将剩余文件全部删除后,重装emq,订阅 test/# 发现成功

大概率问题文件为 /etc/emqx/emqx.conf.rpmsave
因为经过比对(其实就是我忘了删了哪些东西)
发现只有这个文件是额外存在的

配置文件及日志

(emqx@127.0.0.1)1> 2021-09-27T16:01:42.789021+08:00 [error] 8d73f102-9fd7-45f7-bc53-0a591821eaaa1632729479219@10.11.80.167:57132 crasher: initial call: emqx_connection:init/4, pid: <0.1912.0>, registered_name: [], error: {{badmatch,{error,{bad_type,{emqx_trie,{<<"queue/#">>,1},1}}}},[{emqx_session,subscribe,4,[{file,"emqx_session.erl"},{line,248}]},{emqx_channel,do_subscribe,3,[{file,"emqx_channel.erl"},{line,659}]},{emqx_channel,process_subscribe,4,[{file,"emqx_channel.erl"},{line,644}]},{emqx_channel,handle_in,2,[{file,"emqx_channel.erl"},{line,636}]},{emqx_connection,with_channel,3,[{file,"emqx_connection.erl"},{line,659}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,364}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,370}]},{emqx_connection,handle_recv,3,[{file,"emqx_connection.erl"},{line,328}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}, ancestors: [<0.1795.0>,<0.1794.0>,esockd_sup,<0.1556.0>], message_queue_len: 0, messages: [], links: [<0.1795.0>], dictionary: [{send_pkt,1},{'$logger_metadata$',#{clientid => "8d73f102-9fd7-45f7-bc53-0a591821eaaa1632729479219",peername => "10.11.80.167:57132"}},{guid,{1632729695209492,268568599988088,1}},{acl_keys_q,{[{subscribe,<<"queue/#">>}],[]}},{incoming_bytes,99},{acl_cache_size,1},{{subscribe,<<"queue/#">>},{allow,1632729702788}},{recv_pkt,2},{outgoing_bytes,4}], trap_exit: false, status: running, heap_size: 2586, stack_size: 28, reductions: 7476; neighbours:
2021-09-27T16:01:42.790323+08:00 [error] supervisor: 'esockd_connection_sup - <0.1795.0>', errorContext: connection_crashed, reason: {{badmatch,{error,{bad_type,{emqx_trie,{<<"queue/#">>,1},1}}}},[{emqx_session,subscribe,4,[{file,"emqx_session.erl"},{line,248}]},{emqx_channel,do_subscribe,3,[{file,"emqx_channel.erl"},{line,659}]},{emqx_channel,process_subscribe,4,[{file,"emqx_channel.erl"},{line,644}]},{emqx_channel,handle_in,2,[{file,"emqx_channel.erl"},{line,636}]},{emqx_connection,with_channel,3,[{file,"emqx_connection.erl"},{line,659}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,364}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,370}]},{emqx_connection,handle_recv,3,[{file,"emqx_connection.erl"},{line,328}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}, offender: [{pid,<0.1912.0>},{name,connection},{mfargs,{emqx_connection,start_link,[[{deflate_options,[]},{max_conn_rate,1000},{active_n,100},{zone,external},{proxy_address_header,<<>>},{proxy_port_header,<<>>},{supported_subprotocols,[]}]]}}]

image

1 个赞

感谢分享:fireworks:

你拯救了我一下午!!u save me all day!