2

I'm trying to connect to a remote rabbitmq host using the cli rabbitmqadmin.

The command I'm trying to execute is:

rabbitmqadmin --host=$RABBITMQ_HOST --port=443 --ssl --vhost=$RABBITMQ_VHOST --username=$RABBITMQ_USERNAME --password=$RABBITMQ_PASSWORD list queues

Before you ask: the environmental variables RABBITMQ_HOST, RABBITMQ_VHOST and so on are set... I double and triple checked this already.

The error I get back is:

Traceback (most recent call last):
File "/usr/local/sbin/rabbitmqadmin", line 1007, in <module>
main()
File "/usr/local/sbin/rabbitmqadmin", line 413, in main
method()
File "/usr/local/sbin/rabbitmqadmin", line 588, in invoke_list
format_list(self.get(uri), cols, obj_info, self.options)
File "/usr/local/sbin/rabbitmqadmin", line 436, in get
return self.http("GET", "%s/api%s" % (self.options.path_prefix, path), "")
File "/usr/local/sbin/rabbitmqadmin", line 475, in http
self.options.port)
File "/usr/local/sbin/rabbitmqadmin", line 451, in __initialize_https_connection
context = self.__initialize_tls_context())
File "/usr/local/sbin/rabbitmqadmin", line 467, in __initialize_tls_context
self.options.ssl_key_file)

TypeError: coercing to Unicode: need string or buffer, NoneType found

From the last line I assume it's a python related problem, my current python version is 2.7.12, if I try to connect to the local instance of rabbitmq with

rabbitmqadmin list queues

everything works fine. Any help is greatly appreciated thanks :)

Gnagno
  • 597
  • 1
  • 6
  • 18

2 Answers2

1

Validate that you are using the same rabbitmqadmin version as the version of your remote hosted broker. Using a mismatching rabbitmqadmin version will result in that error (for example rabbitmqadmin 3.6.4 querying a 3.5.7 server).

Browse to http://server-name:15672/cli/ and download correct tool from there.

https://github.com/rabbitmq/rabbitmq-management/issues/299

Lovisa Johansson
  • 9,721
  • 1
  • 16
  • 20
0

shouldn't those env vars have a $ in front of them, and the params without =?

rabbitmqadmin --host $RABBITMQ_HOST --port 443 --ssl --vhost $RABBITMQ_VHOST --username $RABBITMQ_USERNAME --password $RABBITMQ_PASSWORD list queues`

maybe the = doesn't matter, but i'm pretty sure you need $ in front of the env vars

Derick Bailey
  • 72,004
  • 22
  • 206
  • 219
  • Hello Derick, thank you for your comment, I am using the $ in front of the variables (I don't know why, but when I copied the string from vimwiki it copied it without them). And for the = signs I think they are mandatory, you can double check the output from rabbitmqadmin --help. I still think the error I am getting is related to something wrong with python, in fact if you google for the last string in the error messages you will only find python related pages. – Gnagno Sep 19 '16 at 13:26