rabbitmq / rabbitmq-auth-backend-http

HTTP-based authorisation and authentication for RabbitMQ
Other
199 stars 72 forks source link

Operation on an exchange fails with bad_scheme #89

Closed samarthraman closed 5 years ago

samarthraman commented 5 years ago

I am trying to use this plugin with the example code present in the repo as the back end, basically sending back "allow" for all the calls. Everything is working as expected, except when I try and do an exchange to exchange binding. It errors out both from the code and management UI. Here is the error I get in the code while subscribing to exchange "SubTest" which is subscribing to the publisher exchange "PubTest" on topic "key"

_RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=403, text="ACCESS_REFUSED - access to topic 'key' in exchange 'SubTest' in vhost '/' refused for user 'admin', backend rabbit_auth_backend_http returned an error: {bad_scheme, ...", classId=50, methodId=20, cause= at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout) at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body) at RabbitMQ.Client.Framing.Impl.Model._PrivateQueueBind(String queue, String exchange, String routingKey, Boolean nowait, IDictionary2 arguments) at RabbitMQ.Client.Impl.AutorecoveringModel.QueueBind(String queue, String exchange, String routingKey, IDictionary2 arguments)

And here is the error in the rabbit log corresponding to this

_2019-05-02 15:16:50.004 [error] <0.929.0> access to topic 'key' in exchange 'SubTest.Sam' in vhost '/' refused for user 'admin', backend rabbit_auth_backend_http returned an error: {bad_scheme,"hhttp"} 2019-05-02 15:16:50.005 [error] <0.929.0> Channel error on connection <0.919.0> (127.0.0.1:12862 -> 127.0.0.1:5672, vhost: '/', user: 'admin'), channel 1: operation queue.bind caused a channel exception access_refused: access to topic 'key' in exchange 'SubTest' in vhost '/' refused for user 'admin', backend rabbit_auth_backend_http returned an error: {badscheme, "hhttp"}

Any help will be greatly appreciated.

michaelklishin commented 5 years ago

Thank you for your time.

Team RabbitMQ uses GitHub issues for specific actionable items engineers can work on. GitHub issues are not used for questions, investigations, root cause analysis, discussions of potential issues, etc (as defined by this team).

We get at least a dozen of questions through various venues every single day, often light on details. At that rate GitHub issues can very quickly turn into a something impossible to navigate and make sense of even for our team. Because GitHub is a tool our team uses heavily nearly every day, the signal/noise ratio of issues is something we care about a lot.

Please post this to rabbitmq-users.

Thank you.

michaelklishin commented 5 years ago
ACCESS_REFUSED - access to topic 'key' in exchange 'SubTest' in vhost '/' refused for user 'admin', backend rabbit_auth_backend_http returned an error:

suggests the operation involved has nothing to do with E2E bindings (as topic access is not checked for exchange.bind, only publishes).

{bad_scheme,
...",

lacks details (not sure if they were edited out or reported that way by the server) but "bad scheme" likely means that this plugin had to parse a URI it must use and it contained an unsupported scheme (something other than http or https or no scheme at all.

Without config file and effective configuration we cannot suggest anything more. Please start a mailing list thread with additional details.

michaelklishin commented 5 years ago

bad_scheme is used by Erlang's HTTP client when scheme of a request is something other than http, https or a blank string (which I assume defaults to http).