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

Simon MacMullen simon at rabbitmq.com
Wed Oct 30 15:54:45 GMT 2013


Hmm. Yeah, this is a bug. I am much more inclined to say that it's the 
comment in rabbit_channel that is at fault though. Since the AMQP spec 
requires these things be UTF-8 (and doesn't give a way to specify an 
alternate encoding) then if you send an invalid UTF-8 sequence then you 
haven't really sent a string.

I guess we need to tighten this up in the channel. Thanks for the report.

Cheers, Simon

On 30/10/13 14:56, Ceri Storey wrote:
> 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!
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list