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

Getting an undef when combining HTTP and cache backends #155

Closed pigochu closed 4 years ago

pigochu commented 4 years ago

My rabbit version is 3.8.9 , I test it using docker image rabbitmq:3.8.9-mangement When I only use rabbitmq_auth_backend_http , it can work , when I use rabbit_auth_backend_cache + rabbitmq_auth_backend_http , log show CRASH Report.

2020-10-16 06:43:11.834 [info] <0.992.0> [{initial_call,{cowboy_stream_h,request_process,['Argument__1','Argument__2','Argument__3']}},{pid,<0.992.0>},{registered_name,[]},{error_info,{error,{badmatch,undefined},[]}},{ancestors,[<0.991.0>,<0.748.0>,<0.747.0>,rabbit_web_dispatch_sup,<0.736.0>]},{message_queue_len,0},{messages,[]},{links,[<0.991.0>]},{dictionary,[]},{trap_exit,false},{status,running},{heap_size,4185},{stack_size,28},{reductions,5694}], []

2020-10-16 06:43:11.834 [error] <0.992.0> CRASH REPORT Process <0.992.0> with 0 neighbours crashed with reason: {{badmatch,undefined},[]}

2020-10-16 06:43:11.835 [error] <0.991.0> Ranch listener {acceptor,{0,0,0,0,0,0,0,0},15672}, connection process <0.991.0>, stream 1 had its request process <0.992.0> exit with reason {badmatch,undefined} and stacktrace []

/etc/rabbitmq/enable_plugins

[rabbitmq_auth_backend_http,rabbit_auth_backend_cache,rabbitmq_management,rabbitmq_mqtt,rabbitmq_web_mqtt].

/etc/rabbitmq/rabbitmq.conf

web_mqtt.tcp.port = 1884
web_mqtt.ssl.port = 1885

log.console = true
log.console.level = debug
log.connection.level = debug
log.channel.level = debug

auth_backends.1 = cache
auth_cache.cached_backend = http

auth_http.http_method   = post
auth_http.user_path     = http://XXXXX/rabbitmq-auth/user
auth_http.vhost_path    = http://XXXXXX/rabbitmq-auth/vhost
auth_http.resource_path = http://XXXXX/rabbitmq-auth/resource
auth_http.topic_path    = http://XXXXX/rabbitmq-auth/topic
michaelklishin commented 4 years ago

Duplicate of #154. There is no need to repeatedly post the same question.

The name of the plugin is rabbitmq_auth_backend_cache, not rabbit_auth_backend_cache which you have. Therefore the plugin is not actually on the code path and you get an undef (function undefined) exception: none of the modules of the plugin are on the code path.