英文:
RabbitMQ closed connection on method CreateModel()
问题
I'm trying to run Producer example from tutorials, but RabbitMQ closed connection with exception:
Exception thrown: 'RabbitMQ.Client.Exceptions.OperationInterruptedException' in RabbitMQ.Client.dll
An unhandled exception of type 'RabbitMQ.Client.Exceptions.OperationInterruptedException' occurred in RabbitMQ.Client.dll
The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=541, text='Unexpected Exception', classId=0, methodId=0, cause=System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
Code is:
var factory = new ConnectionFactory { HostName = "localhost" };
var connection = factory.CreateConnection();
var channel = connection.CreateModel(); // < -- crash is here on this line
Notes:
- RabbitMQ started and working - is easy to send/get message manually via RabbitMQ Management web-UI.
- Status or RabbitMQ received by command rabbitmq-diagnostics.bat status is ok, no one problem.
- exe-file added to Windows-firewall for avoid any blocking
- From the Wireshark we can see that RabbitMQ accepts connection and after some actions - sends Reset:
From the RabbitMQ logs:
2023-05-17 19:49:59.763000+03:00 [info] <0.930.0> accepting AMQP connection <0.930.0> ([::1]:49412 -> [::1]:5672)
2023-05-17 19:49:59.779000+03:00 [info] <0.930.0> connection <0.930.0> ([::1]:49412 -> [::1]:5672): user 'guest' authenticated and granted access to vhost '/'
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> crasher:
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> initial call: rabbit_reader:init/3
...
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> offender: [{pid,<0.930.0>},
...
QUESTION: how to fix this issue?
英文:
I'm trying to run Producer example from tutorials, but RabbitMQ closed connection with exception:
Exception thrown: 'RabbitMQ.Client.Exceptions.OperationInterruptedException' in RabbitMQ.Client.dll
An unhandled exception of type 'RabbitMQ.Client.Exceptions.OperationInterruptedException' occurred in RabbitMQ.Client.dll
The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=541, text='Unexpected Exception', classId=0, methodId=0, cause=System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
Code is:
var factory = new ConnectionFactory { HostName = "localhost" };
var connection = factory.CreateConnection();
var channel = connection.CreateModel(); // <-- crash is here on this line
Notes:
- RabbitMQ started and working - is easy to send/get message manually via RabbitMQ Management web-UI.
- Status or RabbitMQ received by command rabbitmq-diagnostics.bat status is ok, no one problem.
- exe-file added to Windows-firewall for avoid any blocking
- From the Wireshark we can see that RabbitMQ accepts connection and after some actions - sends Reset:
From the RabbitMQ logs:
2023-05-17 19:49:59.763000+03:00 [info] <0.930.0> accepting AMQP connection <0.930.0> ([::1]:49412 -> [::1]:5672)
2023-05-17 19:49:59.779000+03:00 [info] <0.930.0> connection <0.930.0> ([::1]:49412 -> [::1]:5672): user 'guest' authenticated and granted access to vhost '/'
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> crasher:
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> initial call: rabbit_reader:init/3
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> pid: <0.930.0>
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> registered_name: []
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> exception exit: {unexpected_message,{'EXIT',#Port<0.229>,einval}}
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> in function rabbit_reader:handle_other/2 (rabbit_reader.erl, line 644)
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> in call from rabbit_reader:mainloop/4 (rabbit_reader.erl, line 535)
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> in call from rabbit_reader:run/1 (rabbit_reader.erl, line 457)
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> in call from rabbit_reader:start_connection/5 (rabbit_reader.erl, line 356)
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> ancestors: [<0.928.0>,<0.603.0>,<0.602.0>,<0.601.0>,<0.599.0>,<0.598.0>,
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> rabbit_sup,<0.233.0>]
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> message_queue_len: 0
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> messages: []
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> links: [<0.928.0>]
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> dictionary: [{{ch_pid,<0.939.0>},{1,#Ref<0.2052854348.121110529.34620>}},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {client_properties,
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> [{<<"product">>,longstr,<<"RabbitMQ">>},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"version">>,longstr,
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> <<"6.5.0+4c91cae8ae5eb0194e02a83f1b0cedfe29ad8312">>},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"platform">>,longstr,<<".NET">>},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"copyright">>,longstr,
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> <<"Copyright (c) 2007-2020 VMware, Inc.">>},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"information">>,longstr,
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> <<"Licensed under the MPL. See https://www.rabbitmq.com/">>},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"capabilities">>,table,
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> [{<<"publisher_confirms">>,bool,true},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"exchange_exchange_bindings">>,bool,true},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"basic.nack">>,bool,true},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"consumer_cancel_notify">>,bool,true},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"connection.blocked">>,bool,true},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"authentication_failure_close">>,bool,true}]},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<<"connection_name">>,void,undefined}]},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {process_name,
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {rabbit_reader,<<"[::1]:49412 -> [::1]:5672">>}},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {{channel,1},
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> {<0.939.0>,{method,rabbit_framing_amqp_0_9_1}}}]
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> trap_exit: true
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> status: running
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> heap_size: 1598
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> stack_size: 28
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> reductions: 9624
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0> neighbours:
2023-05-17 19:50:00.784000+03:00 [error] <0.930.0>
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> supervisor: {<0.928.0>,rabbit_connection_sup}
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> errorContext: child_terminated
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> reason: {unexpected_message,{'EXIT',#Port<0.229>,einval}}
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> offender: [{pid,<0.930.0>},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {id,reader},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {mfargs,{rabbit_reader,start_link,
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> [<0.929.0>,
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {acceptor,{0,0,0,0,0,0,0,0},5672}]}},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {restart_type,intrinsic},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {shutdown,300000},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {child_type,worker}]
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> supervisor: {<0.928.0>,rabbit_connection_sup}
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> errorContext: shutdown
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> reason: reached_max_restart_intensity
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> offender: [{pid,<0.930.0>},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {id,reader},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {mfargs,{rabbit_reader,start_link,
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> [<0.929.0>,
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {acceptor,{0,0,0,0,0,0,0,0},5672}]}},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {restart_type,intrinsic},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {shutdown,300000},
2023-05-17 19:50:00.784000+03:00 [error] <0.928.0> {child_type,worker}]
QUESTION: how to fix this issue?
答案1
得分: 13
对于未来的读者。
这里的问题是您正在使用Erlang 26与RabbitMQ 3.11.x。
您必须使用Erlang 25。
请查看https://www.rabbitmq.com/which-erlang.html
Erlang 26目前尚未得到官方支持,我们正在努力工作;在某个时候3.12.x将会得到支持。
英文:
For future readers.
The problem here is that you are using Erlang 26 with RabbitMQ 3.11.x.
You have to use Erlang 25.
See https://www.rabbitmq.com/which-erlang.html
Erlang 26 is not officially supported yet, we are working on it; at some point in 3.12.x will be supported.
答案2
得分: 0
在Windows中,卸载Erlang 26并不容易 - 您需要卸载,然后删除以下位置的所有文件:
C:\Program Files\Erlang OTP\erts-14.1
否则,下次安装RabbitMQ时,它将绑定到此版本。
在regedit中查看以下值:
HKEY_LOCAL_MACHINE\SOFTWARE\Ericsson\Erlang\ErlSrv\1.1\RabbitMQ
Machine
应为
C:\Program Files\Erlang OTP\erts-13.0.4\bin\erl.exe
而不是erts-14.1。
英文:
in windows, unistall Erlang 26 is not easy - you need to unistall , and then delete all files in
C:\Program Files\Erlang OTP\erts-14.1
or else the next time you install
RabbitMQ it will bound to this version
in regedit see that value of
HKEY_LOCAL_MACHINE\SOFTWARE\Ericsson\Erlang\ErlSrv\1.1\RabbitMQ\
Machine
is
C:\Program Files\Erlang OTP\erts-13.0.4\bin\erl.exe
and not erts-14.1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论