Fix: Unable to connect to RabbitMQ server from remote clients

Problem : When connected from a remote client, this error is thrown (at client) – An unexpected connection driver error occured (Exception message: Socket closed)

Reason : As per default settings, the default user (“guest”) can access only from localhost (or Loop back IP).

Fix: Remove “guest” user from “loopback_users”. This is how –

sudo vi /etc/rabbitmq/rabbitmq.config # create new file if in Ubuntu
[{rabbit, [{loopback_users, []}]}]. # Add this line, save and quit vim.

sudo rabbit-server restart # this mostly fails. So we grep & kill in next steps.

ps auxx|grep rabbitmq # gives multiple processes

kill -9 3099 3288 3289 10263 # process-Ids are place holders

sudo rabbitmq-server start


Should be able to connect from remote clients now.

Kj [/.] Sreekumar programs computers as a hobby and profession. Into programming from his school days, Sree uses Codemarvels to key in facts and fixes he finds interesting while working on different projects. Some of the articles here give away a few shades of his philosophical leanings too.

Leave a Comment

Your email address will not be published. Required fields are marked *