补充说明,这是客户端的桥接信息
环境:docker
版本:5.0.13
配置如下:
错误信息:
2023-01-10T21:18:40.710780+08:00 [warning] line: 421, mfa: emqx_alarm:do_actions/3, msg: alarm_is_deactivated, name: <<“bridge:mqtt:cloud”>>
2023-01-10T21:18:55.538974+08:00 [error] State machine ‘bridge:mqtt206’ terminating. Reason: {bad_action_from_state_function,[reply,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>},{error,{shutdown,tcp_closed}}]}. Stack: [{gen_statem,loop_actions_list,13,[{file,“gen_statem.erl”},{line,1733}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]. Last event: {{call,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>}},{send_to_remote,#{clientid => <<“example”>>,event => ‘message.publish’,flags => #{retain => false},id => <<“0005F1E8B9CD742E2274000036560000”>>,node => ‘emqx@10.233.90.198’,payload => <<“{"s": "s"}”>>,peerhost => undefined,pub_props => #{‘User-Property’ => #{}},publish_received_at => 1673356735509,qos => 1,timestamp => 1673356735509,topic => <<“$cloud/0138a17127514fd7bb5c1c70f87e2b3c/2312312”>>,username => undefined}}}. State: {connected,#{connect_opts => #{auto_reconnect => true,bridge_mode => true,clean_start => false,clientid => <<“bridge:mqtt:cloud:206:emqx@10.233.90.198”>>,connect_timeout => 30,forwards => #{local => #{topic => <<“$cloud/0138a17127514fd7bb5c1c70f87e2b3c/#”>>},remote => #{payload => [{var,{var,<<“payload”>>}}],qos => 1,retain => false,topic => [{str,<<“$cloud/#”>>}]}},if_record_metrics => true,keepalive => 60,max_inflight => 32,name => ‘bridge:mqtt206’,password => <<“2dbe4d7e12e54fa9aae3d7cbddd62134”>>,proto_ver => v4,reconnect_interval => 10000,retry_interval => 10000,server => {{192,168,3,15},30311},ssl => false,ssl_opts => [{ciphers,[]},{depth,10},{reuse_sessions,true},{secure_renegotiate,true},{user_lookup_fun,{fun emqx_tls_psk:lookup/3,undefined}},{verify,verify_peer},{versions,[‘tlsv1.3’,‘tlsv1.2’,‘tlsv1.1’,tlsv1]}],subscriptions => #{local => #{payload => [{var,{var,<<“payload”>>}}],qos => 1,retain => false,topic => [{str,<<“$edge/#”>>}]},on_message_received => {emqx_connector_mqtt,on_message_received,[<<“$bridges/mqtt:cloud”>>,<<“bridge:mqtt:cloud”>>]},remote => #{qos => 1,topic => <<“$edge/#”>>}},username => <<“0138a17127514fd7bb5c1c70f87e2b3c”>>},connection => #{client_pid => <0.13851.0>,subscriptions => #{local => #{payload => [{var,{var,<<“payload”>>}}],qos => 1,retain => false,topic => [{str,<<“$edge/#”>>}]},on_message_received => {emqx_connector_mqtt,on_message_received,[<<“$bridges/mqtt:cloud”>>,<<“bridge:mqtt:cloud”>>]},remote => #{qos => 1,topic => <<“$edge/#”>>}}},max_inflight => 32,mountpoint => undefined,name => ‘bridge:mqtt206’,reconnect_interval => 10000,start_type => manual}}. Client ‘emqx_resource_worker:bridge:mqtt3’ stacktrace: [{gen,do_call,4,[{file,“gen.erl”},{line,214}]},{gen_statem,call_dirty,4,[{file,“gen_statem.erl”},{line,693}]},{emqx_resource_worker,apply_query_fun,6,[{file,“emqx_resource_worker.erl”},{line,457}]},{emqx_resource_worker,query_or_acc,3,[{file,“emqx_resource_worker.erl”},{line,309}]}].
2023-01-10T21:18:55.540023+08:00 [error] crasher: initial call: emqx_connector_mqtt_worker:init/1, pid: <0.13850.0>, registered_name: ‘bridge:mqtt206’, error: {{bad_action_from_state_function,[reply,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>},{error,{shutdown,tcp_closed}}]},[{gen_statem,loop_actions_list,13,[{file,“gen_statem.erl”},{line,1733}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [emqx_connector_mqtt,emqx_connector_sup,<0.2513.0>], message_queue_len: 1, messages: [{disconnected,<0.13851.0>,{shutdown,tcp_closed}}], links: [<0.2515.0>,<0.13911.0>], dictionary: [], trap_exit: true, status: running, heap_size: 28690, stack_size: 29, reductions: 63781; neighbours:
2023-01-10T21:18:55.540418+08:00 [error] Supervisor: {local,emqx_connector_mqtt}. Context: child_terminated. Reason: {{bad_action_from_state_function,[reply,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>},{error,{shutdown,tcp_closed}}]},[{gen_statem,loop_actions_list,13,[{file,“gen_statem.erl”},{line,1733}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}. Offender: id=‘bridge:mqtt206’,pid=<0.13850.0>.
2023-01-10T21:18:55.540511+08:00 [error] State machine <0.13911.0> terminating. Reason: {{bad_action_from_state_function,[reply,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>},{error,{shutdown,tcp_closed}}]},[{gen_statem,loop_actions_list,13,[{file,“gen_statem.erl”},{line,1733}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}. Stack: [{gen_statem,loop_receive,3,[{file,“gen_statem.erl”},{line,1078}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]. State: {connected,{state,undefined,<0.13850.0>,#{disconnected => {fun emqx_connector_mqtt_mod:handle_disconnected/2,[<0.13850.0>]},publish => {fun emqx_connector_mqtt_mod:handle_publish/3,[#{local => #{payload => [{var,{var,<<“payload”>>}}],qos => 1,retain => false,topic => [{str,<<“$edge/#”>>}]},mountpoint => undefined,on_message_received => {emqx_connector_mqtt,on_message_received,[<<“$bridges/mqtt:cloud”>>,<<“bridge:mqtt:cloud”>>]},remote => #{qos => 1,topic => <<“$edge/#”>>}},#{server => <<“192.168.3.15:30311”>>}]}},{192,168,3,15},30311,[],emqtt_sock,#Port<0.325>,[],30000,true,<<“bridge:mqtt:cloud:206:emqx@10.233.90.198”>>,true,<<“0138a17127514fd7bb5c1c70f87e2b3c”>>,#Fun<emqtt_secret.0.70488618>,4,<<“MQTT”>>,60,#Ref<0.4237789018.4220518403.42036>,true,false,false,{mqtt_msg,0,false,false,undefined,undefined,undefined,undefined},#{},[],#{<<“$edge/#”>> => #{nl => 0,qos => 1,rap => 0,rh => 0}},#{max_inflight => 32,sent => #{},seq => 1},#{},true,30000,#Ref<0.4237789018.4220518403.42038>,10000000,undefined,0,3,false,{none,#{max_size => 268435455,strict_mode => false,version => 4}},false,false,undefined,#{count => 0,requests => {[],[]}},#{}}}.
2023-01-10T21:18:55.541188+08:00 [error] crasher: initial call: emqtt:init/1, pid: <0.13911.0>, registered_name: [], exit: {{{bad_action_from_state_function,[reply,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>},{error,{shutdown,tcp_closed}}]},[{gen_statem,loop_actions_list,13,[{file,“gen_statem.erl”},{line,1733}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]},[{gen_statem,loop_receive,3,[{file,“gen_statem.erl”},{line,1078}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [‘bridge:mqtt206’,emqx_connector_mqtt,emqx_connector_sup,<0.2513.0>], message_queue_len: 0, messages: [], links: [], dictionary: [], trap_exit: true, status: running, heap_size: 10958, stack_size: 29, reductions: 18006; neighbours:
2023-01-10T21:18:55.540640+08:00 [error] bridge: <<“mqtt:cloud”>>, error: {resource_error,#{msg => #{error => {exit,{{{bad_action_from_state_function,[reply,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>},{error,{shutdown,tcp_closed}}]},[{gen_statem,loop_actions_list,13,[{file,“gen_statem.erl”},{line,1733}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]},{gen_statem,call,[‘bridge:mqtt206’,{send_to_remote,#{clientid => <<“example”>>,event => ‘message.publish’,flags => #{retain => false},id => <<“0005F1E8B9CD742E2274000036560000”>>,node => ‘emqx@10.233.90.198’,payload => <<“{"s": "s"}”>>,peerhost => undefined,pub_props => #{‘User-Property’ => #{}},publish_received_at => 1673356735509,qos => 1,timestamp => 1673356735509,topic => <<“$cloud/0138a17127514fd7bb5c1c70f87e2b3c/2312312”>>,username => undefined}},infinity]}}},id => <<“bridge:mqtt:cloud”>>,name => call_query,request => {send_message,#{clientid => <<“example”>>,event => ‘message.publish’,flags => #{retain => false},id => <<“0005F1E8B9CD742E2274000036560000”>>,node => ‘emqx@10.233.90.198’,payload => <<“{"s": "s"}”>>,peerhost => undefined,pub_props => #{‘User-Property’ => #{}},publish_received_at => 1673356735509,qos => 1,timestamp => 1673356735509,topic => <<“$cloud/0138a17127514fd7bb5c1c70f87e2b3c/2312312”>>,username => undefined}},stacktrace => [{gen,do_call,4,[{file,“gen.erl”},{line,220}]},{gen_statem,call_dirty,4,[{file,“gen_statem.erl”},{line,693}]},{emqx_resource_worker,apply_query_fun,6,[{file,“emqx_resource_worker.erl”},{line,457}]},{emqx_resource_worker,query_or_acc,3,[{file,“emqx_resource_worker.erl”},{line,309}]},{gen_statem,loop_state_callback,11,[{file,“gen_statem.erl”},{line,1203}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]},reason => exception}}, line: 150, mfa: emqx_bridge:send_to_matched_egress_bridges/2, msg: send_message_to_bridge_failed
2023-01-10T21:18:55.540528+08:00 [error] info: #{error => {exit,{{{bad_action_from_state_function,[reply,{<0.13203.0>,#Ref<0.4237789018.4220518402.36887>},{error,{shutdown,tcp_closed}}]},[{gen_statem,loop_actions_list,13,[{file,“gen_statem.erl”},{line,1733}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]},{gen_statem,call,[‘bridge:mqtt206’,{send_to_remote,#{clientid => <<“example”>>,event => ‘message.publish’,flags => #{retain => false},id => <<“0005F1E8B9CD742E2274000036560000”>>,node => ‘emqx@10.233.90.198’,payload => <<“{"s": "s"}”>>,peerhost => undefined,pub_props => #{‘User-Property’ => #{}},publish_received_at => 1673356735509,qos => 1,timestamp => 1673356735509,topic => <<“$cloud/0138a17127514fd7bb5c1c70f87e2b3c/2312312”>>,username => undefined}},infinity]}}},id => <<“bridge:mqtt:cloud”>>,name => call_query,request => {send_message,#{clientid => <<“example”>>,event => ‘message.publish’,flags => #{retain => false},id => <<“0005F1E8B9CD742E2274000036560000”>>,node => ‘emqx@10.233.90.198’,payload => <<“{"s": "s"}”>>,peerhost => undefined,pub_props => #{‘User-Property’ => #{}},publish_received_at => 1673356735509,qos => 1,timestamp => 1673356735509,topic => <<“$cloud/0138a17127514fd7bb5c1c70f87e2b3c/2312312”>>,username => undefined}},stacktrace => [{gen,do_call,4,[{file,“gen.erl”},{line,220}]},{gen_statem,call_dirty,4,[{file,“gen_statem.erl”},{line,693}]},{emqx_resource_worker,apply_query_fun,6,[{file,“emqx_resource_worker.erl”},{line,457}]},{emqx_resource_worker,query_or_acc,3,[{file,“emqx_resource_worker.erl”},{line,309}]},{gen_statem,loop_state_callback,11,[{file,“gen_statem.erl”},{line,1203}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, line: 373, mfa: emqx_resource_worker:handle_query_result/4, msg: resource_exception
2023-01-10T21:18:56.098354+08:00 [warning] line: 415, message: <<“resource down: bridge:mqtt:cloud”>>, mfa: emqx_alarm:do_actions/3, msg: alarm_is_activated, name: <<“bridge:mqtt:cloud”>>
2023-01-10T21:18:56.098855+08:00 [error] id: <<“bridge:mqtt:cloud”>>, line: 558, mfa: emqx_resource_manager:handle_connected_health_check/1, msg: health_check_failed, status: connecting
2023-01-10T21:19:10.873740+08:00 [error] bridge: <<“mqtt:cloud”>>, error: {resource_error,#{msg => “resource not connected”,reason => not_connected}}, line: 150, mfa: emqx_bridge:send_to_matched_egress_bridges/2, msg: send_message_to_bridge_failed
以下是报错信息