noxdafox / rabbitmq-message-deduplication

RabbitMQ Plugin for filtering message duplicates
Mozilla Public License 2.0
283 stars 34 forks source link

Crash when access to exchanges tab in managment web interface #49

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello! When I try to open exchanges tab I get 500 error, in log/crash.log

2020-01-22 07:29:08 =CRASH REPORT====
  crasher:
    initial call: cowboy_stream_h:request_process/3
    pid: <0.3686.0>
    registered_name: []
    exception error: {badarith,[{erlang,'*',[undefined,8],[]},{'Elixir.RabbitMQ.MessageDeduplicationPlugin.Cache',info,1,[{file,"lib/cache.ex"},{line,131}]},{'Elixir.RabbitMQ.MessageDeduplicationPlugin.Exchange',info,2,[{file,"lib/rabbit_message_deduplication_exchange.ex"},{line,179}]},{rabbit_exchange,info,1,[{file,"src/rabbit_exchange.erl"},{line,365}]},{lists,map,2,[{file,"lists.erl"},{line,1239}]},{lists,map,2,[{file,"lists.erl"},{line,1239}]},{rabbit_mgmt_util,'-all_or_one_vhost/2-lc$^0/1-0-',2,[{file,"src/rabbit_mgmt_util.erl"},{line,977}]},{rabbit_mgmt_util,all_or_one_vhost,2,[{file,"src/rabbit_mgmt_util.erl"},{line,977}]}]}
    ancestors: [<0.3653.0>,<0.1285.0>,<0.1284.0>,rabbit_web_dispatch_sup,<0.1251.0>]
    message_queue_len: 0
    messages: []
    links: [<0.3653.0>]
    dictionary: [{{xtype_to_module,direct},rabbit_exchange_type_direct},{{xtype_to_module,'x-message-deduplication'},'Elixir.RabbitMQ.MessageDeduplicationPlugin.Exchange'},{{xtype_to_module,fanout},rabbit_exchange_type_fanout}]
    trap_exit: false
    status: running
    heap_size: 6772
    stack_size: 27
    reductions: 8285
  neighbours:
2020-01-22 07:29:08 =ERROR REPORT====
Ranch listener rabbit_web_dispatch_sup_15673, connection process <0.3653.0>, stream 16 had its request process <0.3686.0> exit with reason badarith and stacktrace [{erlang,'*',[undefined,8],[]},{'Elixir.RabbitMQ.MessageDeduplicationPlugin.Cache',info,1,[{file,"lib/cache.ex"},{line,131}]},{'Elixir.RabbitMQ.MessageDeduplicationPlugin.Exchange',info,2,[{file,"lib/rabbit_message_deduplication_exchange.ex"},{line,179}]},{rabbit_exchange,info,1,[{file,"src/rabbit_exchange.erl"},{line,365}]},{lists,map,2,[{file,"lists.erl"},{line,1239}]},{lists,map,2,[{file,"lists.erl"},{line,1239}]},{rabbit_mgmt_util,'-all_or_one_vhost/2-lc$^0/1-0-',2,[{file,"src/rabbit_mgmt_util.erl"},{line,977}]},{rabbit_mgmt_util,all_or_one_vhost,2,[{file,"src/rabbit_mgmt_util.erl"},{line,977}]}]

Runtime

OS PID: 380
OS: Linux
Uptime (seconds): 728
RabbitMQ version: 3.8.2
Node name: rabbit@staging-rabbitmq-1
Erlang configuration: Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:64]
Erlang processes: 1445 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

Plugins

# rabbitmq-plugins list
Listing plugins with pattern ".*" ...
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@staging-rabbitmq-1
 |/
[  ] rabbitmq_amqp1_0                  3.8.2
[  ] rabbitmq_auth_backend_cache       3.8.2
[  ] rabbitmq_auth_backend_http        3.8.2
[  ] rabbitmq_auth_backend_ldap        3.8.2
[  ] rabbitmq_auth_backend_oauth2      3.8.2
[  ] rabbitmq_auth_mechanism_ssl       3.8.2
[  ] rabbitmq_consistent_hash_exchange 3.8.2
[  ] rabbitmq_event_exchange           3.8.2
[  ] rabbitmq_federation               3.8.2
[  ] rabbitmq_federation_management    3.8.2
[  ] rabbitmq_jms_topic_exchange       3.8.2
[E*] rabbitmq_management               3.8.2
[e*] rabbitmq_management_agent         3.8.2
[E*] rabbitmq_message_deduplication    0.4.3
[  ] rabbitmq_mqtt                     3.8.2
[  ] rabbitmq_peer_discovery_aws       3.8.2
[  ] rabbitmq_peer_discovery_common    3.8.2
[  ] rabbitmq_peer_discovery_consul    3.8.2
[  ] rabbitmq_peer_discovery_etcd      3.8.2
[  ] rabbitmq_peer_discovery_k8s       3.8.2
[  ] rabbitmq_prometheus               3.8.2
[  ] rabbitmq_random_exchange          3.8.2
[  ] rabbitmq_recent_history_exchange  3.8.2
[  ] rabbitmq_sharding                 3.8.2
[  ] rabbitmq_shovel                   3.8.2
[  ] rabbitmq_shovel_management        3.8.2
[E*] rabbitmq_stomp                    3.8.2
[  ] rabbitmq_top                      3.8.2
[  ] rabbitmq_tracing                  3.8.2
[  ] rabbitmq_trust_store              3.8.2
[e*] rabbitmq_web_dispatch             3.8.2
[  ] rabbitmq_web_mqtt                 3.8.2
[  ] rabbitmq_web_mqtt_examples        3.8.2
[  ] rabbitmq_web_stomp                3.8.2
[  ] rabbitmq_web_stomp_examples       3.8.2

This error start appear after restarting one of is RabbitMQ in cluster. And on other machine in cluster it work without problem.

noxdafox commented 4 years ago

Hello,

if I understand correctly, the way to trigger this issue is by restarting a node within a cluster and visiting the MGMT console on that same node. Am I correct?

ghost commented 4 years ago

Hello,

Yes, you are correct. I found a workaround. In my case importing a configuration bring this issue. I've stop importing and plugin works as expected.