rabbitmq / discussions

Please use RabbitMQ mailing list for questions. Issues that are questions, discussions or lack details necessary to investigate them are moved to this repository.
3 stars 4 forks source link

MQTT: error in the log #28

Closed running-g closed 4 years ago

running-g commented 4 years ago

I have an error in rabbitmq

OS:Windows Server 2019 RabbitMQ version:3.7.23 Erlang version 22.0 RabbitMQ server and client application log

2019-12-11 17:35:15 =ERROR REPORT====
** Generic server <0.6073.243> terminating
** Last message in was {tcp,#Port<0.742653>,<<16,114,0,4,77,81,84,84,4,192,1,44,0,17,68,95,51,53,56,57,56,49,49,48,48,48,51,49,48,53,50,0,17,68,95,51,53,56,57,56,49,49,48,48,48,51,49,48,53,50,0,64,49,103,112,49,49,54,122,56,50,81,43,81,74,48,110,77,97,68,48,71,85,81,55,55,98,79,122,81,86,110,70,120,78,112,116,49,84,80,68,107,76,47,121,70,119,82,70,69,68,102,112,116,53,111,77,115,48,97,69,56,114,80,113,106>>}
** When Server state == {state,#Port<0.742653>,"xxx.58.47.9:60857 -> xxx.31.19.xxx:1883",true,undefined,false,running,{none,none},<0.30039.247>,false,none,{proc_state,#Port<0.742653>,#{},{undefined,undefined},{0,nil},{0,nil},undefined,1,undefined,undefined,undefined,{undefined,undefined},undefined,<<"amq.topic">>,{amqp_adapter_info,{172,31,19,134},1883,{172,58,47,9},60857,<<"172.58.47.9:60857 -> 172.31.19.134:1883">>,{'MQTT',"N/A"},[{channels,1},{channel_max,1},{frame_max,0},{client_properties,[{<<"product">>,longstr,<<"MQTT client">>}]},{ssl,false}]},none,undefined,undefined,#Fun<rabbit_mqtt_processor.0.18620547>,{172,58,47,9},#Fun<rabbit_mqtt_util.4.62058906>,#Fun<rabbit_mqtt_util.5.62058906>},undefined,{state,fine,5000,undefined}}
** Reason for termination == 
** {{badmatch,{error,einval}},[{rabbit_mqtt_processor,process_login,4,[{file,"src/rabbit_mqtt_processor.erl"},{line,533}]},{rabbit_mqtt_processor,process_request,3,[{file,"src/rabbit_mqtt_processor.erl"},{line,137}]},{rabbit_mqtt_processor,process_frame,2,[{file,"src/rabbit_mqtt_processor.erl"},{line,77}]},{rabbit_mqtt_reader,process_received_bytes,2,[{file,"src/rabbit_mqtt_reader.erl"},{line,286}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1067}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}
2019-12-11 17:35:15 =CRASH REPORT====
  crasher:
    initial call: rabbit_mqtt_reader:init/1
    pid: <0.6073.243>
    registered_name: []
    exception exit: {{{badmatch,{error,einval}},[{rabbit_mqtt_processor,process_login,4,[{file,"src/rabbit_mqtt_processor.erl"},{line,533}]},{rabbit_mqtt_processor,process_request,3,[{file,"src/rabbit_mqtt_processor.erl"},{line,137}]},{rabbit_mqtt_processor,process_frame,2,[{file,"src/rabbit_mqtt_processor.erl"},{line,77}]},{rabbit_mqtt_reader,process_received_bytes,2,[{file,"src/rabbit_mqtt_reader.erl"},{line,286}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1067}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]},[{gen_server2,terminate,3,[{file,"src/gen_server2.erl"},{line,1183}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}
    ancestors: [<0.16309.235>,<0.29707.6>,<0.29705.6>,<0.29703.6>,rabbit_mqtt_sup,<0.29676.6>]
    message_queue_len: 1
    messages: [{tcp_closed,#Port<0.742653>}]
    links: [<0.16309.235>]
    dictionary: [{rand_seed,{#{jump => #Fun<rand.24.53802439>,max => 288230376151711743,next => #Fun<rand.23.53802439>,type => exsplus},[185523379786012086|162008706961358891]}}]
    trap_exit: true
    status: running
    heap_size: 1598
    stack_size: 27
    reductions: 5392
  neighbours:

rabbitmq-plugins list: [ ] rabbitmq_amqp1_0 3.7.23 [E] rabbitmq_auth_backend_cache 3.7.23 [E] rabbitmq_auth_backend_http 3.7.23 [ ] rabbitmq_auth_backend_ldap 3.7.23 [ ] rabbitmq_auth_mechanism_ssl 3.7.23 [ ] rabbitmq_consistent_hash_exchange 3.7.23 [E] rabbitmq_event_exchange 3.7.23 [ ] rabbitmq_federation 3.7.23 [ ] rabbitmq_federation_management 3.7.23 [ ] rabbitmq_jms_topic_exchange 3.7.23 [E] rabbitmq_management 3.7.23 [e] rabbitmq_management_agent 3.7.23 [E] rabbitmq_mqtt 3.7.23 [ ] rabbitmq_peer_discovery_aws 3.7.23 [ ] rabbitmq_peer_discovery_common 3.7.23 [ ] rabbitmq_peer_discovery_consul 3.7.23 [ ] rabbitmq_peer_discovery_etcd 3.7.23 [ ] rabbitmq_peer_discovery_k8s 3.7.23 [ ] rabbitmq_random_exchange 3.7.23 [ ] rabbitmq_recent_history_exchange 3.7.23 [ ] rabbitmq_sharding 3.7.23 [ ] rabbitmq_shovel 3.7.23 [ ] rabbitmq_shovel_management 3.7.23 [ ] rabbitmq_stomp 3.7.23 [ ] rabbitmq_top 3.7.23 [ ] rabbitmq_tracing 3.7.23 [ ] rabbitmq_trust_store 3.7.23 [e] rabbitmq_web_dispatch 3.7.23 [E] rabbitmq_web_mqtt 3.7.23 [ ] rabbitmq_web_mqtt_examples 3.7.23 [ ] rabbitmq_web_stomp 3.7.23 [ ] rabbitmq_web_stomp_examples 3.7.23

Client library: Java,C#,Node,more....

image

michaelklishin commented 4 years ago

The plugin tried to fetch some socket information and the returned value was einval, meaning the socket was "invalid" (most likely already closed) in the middle of a login operation.

michaelklishin commented 4 years ago

FTR, here is the line in question which does not handle such scenarios. I'm not really sure how it should since if the socket is already closed or otherwise cannot be used, the connection cannot send any meaningful information to the client. It could avoid the exception but I struggle to come up with an error message that would be actually useful.

running-g commented 4 years ago

thks