Plugin fails with error undefined
rayalex opened this issue · 4 comments
I've tried setting up this plugin on RabbitMQ 3.6.6, however it seems to be failing with unknown error. HTTP Server logs indicate that request was never received, so it's probably failing before that.
Setup:
- Freshly installed RabbitMQ
3.6.6on Ubuntu16.04.1 - Server is visible from RabbitMQ node, e.g.
curl -X POST http://192.168.1.101/auth/userreturns valid response. - Plugin downloaded from bintray, though I have tried version built from sources, unfortunately to the same result.
Configuration:
[
{rabbit, [{auth_backends, [rabbitmq_auth_backend_http]}]},
{rabbitmq_auth_backend_http,
[{http_method, post},
{user_path, "http://192.168.1.101/auth/user"},
{vhost_path, "http://192.168.1.101/auth/vhost"},
{resource_path, "http://192.168.1.101/auth/resource"}]}
].Server is configured to always return allow and allow administrator for user path.
Logs:
Starting RabbitMQ 3.6.6 on Erlang 18.3
Copyright (C) 2007-2016 Pivotal Software, Inc.
Licensed under the MPL. See http://www.rabbitmq.com/
*** snip
=INFO REPORT==== 11-Dec-2016::11:58:28 ===
Server startup complete; 8 plugins started.
* rabbitmq_management
* rabbitmq_management_agent
* rabbitmq_web_dispatch
* rabbitmq_mqtt
* rabbitmq_auth_backend_http
* webmachine
* mochiweb
* amqp_client
*** snip
=ERROR REPORT==== 11-Dec-2016::11:58:29 ===
webmachine error: path="/api/whoami"
{error,undef,
[{rabbitmq_auth_backend_http,user_login_authentication,
[<<"123">>,[{password,<<"123">>}]],
[]},
{rabbit_access_control,try_authenticate,3,
[{file,"src/rabbit_access_control.erl"},
{line,88}]},
{rabbit_access_control,'-check_user_login/2-fun-0-',4,
[{file,"src/rabbit_access_control.erl"},
{line,74}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1262}]},
{rabbit_mgmt_util,is_authorized,6,
[{file,"src/rabbit_mgmt_util.erl"},{line,134}]},
{webmachine_resource,resource_call,3,
[{file,"src/webmachine_resource.erl"},
{line,186}]},
{webmachine_resource,do,3,
[{file,"src/webmachine_resource.erl"},
{line,142}]},
{webmachine_decision_core,resource_call,1,
[{file,"src/webmachine_decision_core.erl"},
{line,48}]}]}
Any ideas what might be an issue here?
Thanks.
EDIT:
Resolution: First line of configuration should say {rabbit, [{auth_backends, [rabbit_auth_backend_http]}]}, instead of {rabbit, [{auth_backends, [rabbitmq_auth_backend_http]}]},
Please post questions to rabbitmq-users or Stack Overflow. RabbitMQ uses GitHub issues for specific actionable items engineers can work on, not questions. Thank you.
The error says thatrabbitmq_auth_backend_http:user_login_authentication/3 is undefined. Your config is incomplete and I suspect it may be incorrectly nested. Please take this to the mailing list.
There's plenty of examples of authn/authz backend configurations, including this very plugin, in the docs.
@michaelklishin The issue indeed was in my configuration, thanks.