[rabbitmq-discuss] [BUG] Management interface fails to render queues with non utf-8 names.

Ceri Storey ceri at lshift.net
Wed Oct 30 14:56:56 GMT 2013


Hi,

We noticed that one of our customers has created some queues whose names
aren't valid UTF-8. From the AMQP spec it looks like short-strings
should be valid UTF-8, and contain only certain character classes.
However, my colleague Frank has tracked down some code in
rabbit_channel:check_name/2
<https://github.com/rabbitmq/rabbitmq-server/blob/dc37e725f535861f6d98e7b9c4592978aae57a04/src/rabbit_channel.erl#L560>,
where there's a comment to the effect that those rules aren't enforced
deliberately.

However, if we try to request the list of queues via the API, we get the
following backtrace:

webmachine error: path="/api/queues"
{error,{exit,{ucs,{bad_utf8_character_code}},
             [{xmerl_ucs,from_utf8,1,[{file,"xmerl_ucs.erl"},{line,185}]},
              {mochijson2,json_encode_string,2,[]},
              {mochijson2,'-json_encode_proplist/2-fun-0-',3,[]},
              {lists,foldl,3,[{file,"lists.erl"},{line,1248}]},
              {mochijson2,json_encode_proplist,2,[]},
              {mochijson2,'-json_encode_array/2-fun-0-',3,[]},
              {lists,foldl,3,[{file,"lists.erl"},{line,1248}]},
              {mochijson2,json_encode_array,2,[]}]}}

Which seems to indicate that the management console assumes that entity
names are valid UTF-8. We've advised our customer to consider renaming
their queues, but it'd be good to somehow rectify the difference in
assumptions around name encodings. My first thought might be to
percent-encoded non-utf8 data. but there's likely better ways to handle
this.

The quickest way to reproduce the problem would be to run this ruby
script using Bunny (assuming you have a local rabbit with the default
credentials):

require 'bunny'
bunny = Bunny.new().tap { |b| b.start }
q = bunny.queue("foo\316null")

Once you've done that, if you try to list the queues in the root
virtualhost, you'll find you get the above exception.

Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131030/310f108d/attachment.htm>


More information about the rabbitmq-discuss mailing list