[Windows] RabbitMQ disk monitoring failing in non English OS languages

527 views
Skip to first unread message

Philipp Chlebicki

unread,
Jan 7, 2022, 7:24:15 AM1/7/22
to rabbitmq-users
Hi,

with the upgrade to RabbitMQ 3.8.27 we detected that the disk monitoring is not working correctly:
  • Management UI indicates 0 BCapture.PNG
  • Prometheus fails to parse the Prometheus endpoint of Rabbitmq due to a parsing error ("unknown" is not supported for gauge types) 
    Capture.PNG
    • While the disk monitoring not working itself is not a big deal, it is problematic that Prometheus can not gather any data due to a parsing error.
Following problematic loglines have been identified (see attached logfile):

2022-01-07 11:36:40.457 [info] <0.436.0> Free disk space monitor encountered an error (e.g. failed to parse output from OS tools): {{'EXIT',{{case_clause,"Freie"},[{rabbit_disk_monitor,win32_get_disk_free_fsutil,1,[{file,"src/rabbit_disk_monitor.erl"},{line,296}]},{rabbit_disk_monitor,get_disk_free,2,[{file,"src/rabbit_disk_monitor.erl"},{line,256}]},{rabbit_disk_monitor,enable,1,[{file,"src/rabbit_disk_monitor.erl"},{line,384}]},{rabbit_disk_monitor,handle_info,2,[{file,"src/rabbit_disk_monitor.erl"},{line,165}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,695}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,771}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}},8589398016}, retries left: 9
... and so on ...

I assume that this error stems from the change in https://github.com/rabbitmq/rabbitmq-server/pull/3895/files

This is the output of fsutil called on a german OS (" {{'EXIT',{{case_clause,"Freie"}..."):

fsutil volume diskfree e:
Freie Bytes insgesamt: 10246963200 (9772.27MB)
Bytes insgesamt: 10735316992 (10.00GB)
Verfügbare freie Bytes insgesamt: 10246963200 (9772.27MB)

The implemented change seems to only be compatible with an english OS:

case run_cmd(FsutilCmd) of
{error, timeout} ->
error;
FsutilResult ->
case string:slice(FsutilResult, 0, 5) of
"Error" ->
error;
"Total" ->
FirstLine = hd(string:tokens(FsutilResult, "\r\n")),
{match, [FreeStr]} = re:run(FirstLine, "(\\d+,?)+", [{capture, first, list}]),
{ok, list_to_integer(lists:flatten(string:tokens(FreeStr, ",")))}
end
end.


Infrastructure details
  • RabbitMQ 3.8.27
  • Erlang 24.1.7
  • Win Server 2019 (German)
Thanks and BR,

Philipp
rabbitmq.log

Loïc Hoguin

unread,
Jan 7, 2022, 7:38:30 AM1/7/22
to rabbitm...@googlegroups.com

Hello,

 

You’re correct. I should have picked up on this when reviewing.

 

Do you know if there is a way to get the fsutil from your environment to print English text instead? Perhaps via an environment variable. Maybe LANG=C would do it like it often does on Linux. If that’s possible then the fix should not be too difficult to implement.

 

Thanks,

 

-- 

Loïc Hoguin

 

From: <rabbitm...@googlegroups.com> on behalf of Philipp Chlebicki <ska....@gmail.com>
Reply to: "rabbitm...@googlegroups.com" <rabbitm...@googlegroups.com>
Date: Friday 7 January 2022 at 13:24
To: rabbitmq-users <rabbitm...@googlegroups.com>
Subject: [Suspected Spam] [rabbitmq-users] [Windows] RabbitMQ disk monitoring failing in non English OS languages

 

Hi,

with the upgrade to RabbitMQ 3.8.27 we detected that the disk monitoring is not working correctly:

  • Management UI indicates 0 B
  • Prometheus fails to parse the Prometheus endpoint of Rabbitmq due to a parsing error ("unknown" is not supported for gauge types) 

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/c6932653-6024-494a-ba23-b580fa7deb3dn%40googlegroups.com.

Philipp Chlebicki

unread,
Jan 7, 2022, 8:25:33 AM1/7/22
to rabbitmq-users
Hey,

unfortunately you can not change on demand the OS language. If there is no option to use powershell, how about using wmic?

> wmic logicaldisk where caption="E:" get freespace
FreeSpace
10247045120

BR,

Philipp

Luke Bakken

unread,
Jan 7, 2022, 7:40:17 PM1/7/22
to rabbitmq-users
Hi  Philipp,

I completely overlooked non-English languages. Thanks for suggesting wmic. I also have Powershell as a backup but in this error case it's not used. I'll get a fix in soon.

Luke Bakken

unread,
Jan 7, 2022, 8:23:24 PM1/7/22
to rabbitmq-users

Wes Peng

unread,
Jan 8, 2022, 2:35:51 AM1/8/22
to rabbitm...@googlegroups.com
Luke, does the metadata such as exchange name support UTF8 char?

Thanks

Luke Bakken

unread,
Jan 8, 2022, 8:47:22 AM1/8/22
to rabbitmq-users
Please start a new discussion for a new topic. Thanks!
Reply all
Reply to author
Forward
0 new messages