rabbitmq / rabbitmq-amqp1.0

AMQP 1.0 support for RabbitMQ
https://www.rabbitmq.com/
Other
93 stars 20 forks source link

Gracefully handle refused access (e.g. to insufficient permissions) in session process #87

Closed michaelklishin closed 5 years ago

michaelklishin commented 5 years ago

Currently it fails with an exception that makes it hard to spot the root cause:

2019-05-08 08:43:38.977 [debug] <0.995.0> Supervisor {<0.995.0>,amqp_connection_sup} started amqp_gen_connection:start_link(<0.996.0>, {amqp_params_direct,<<"shovel-57">>,none,<<"/">>,rabbit@mercurio,{amqp_adapter_info,{0,0,0,0,0,65535,...},...},...}) at pid <0.997.0>
2019-05-08 08:43:38.977 [error] <0.994.0> CRASH REPORT Process <0.994.0> with 0 neighbours exited with reason: no match of right hand value {error,not_allowed} in rabbit_amqp1_0_session_process:init/1 line 52 in gen_server2:init_it/6 line 597
2019-05-08 08:43:38.977 [error] <0.986.0> AMQP 1.0 connection <0.986.0> (running), channel 0 - error:
<<"Reader error: {badmatch,\n               {error,\n                {'EXIT',\n                 {{badmatch,\n                   {error,\n                    {{{badmatch,{error,not_allowed}},\n                      [{rabbit_amqp1_0_session_process,init,1,\n                        [{file,\"src/rabbit_amqp1_0_session_process.erl\"},\n                         {line,52}]}

Discovered while QA'ing https://github.com/rabbitmq/rabbitmq-shovel/pull/57.