RabbitMQ fails to start with error: Waiting for RabbitMQ to be available: ... Failed
search cancel

RabbitMQ fails to start with error: Waiting for RabbitMQ to be available: ... Failed

book

Article ID: 434050

calendar_today

Updated On:

Products

VMware Smart Assurance Network Observability

Issue/Introduction

Verification steps for Smarts RabbitMQ service startup failures

Waiting for RabbitMQ to be available: ................................................................ Failed

Environment

All Supported Smarts releases

Resolution

  • Verify no processes are occupying the port 15672 & 25672:
netstat -anlp | grep -iE '15672|25672' 
  • Verify no stale epmd and beam processes are running on the server:
ps -ef | grep -iE 'epmd|beam.smp'
If output finds any stale processes, kill the processes accordingly. 
  • Verify Local Connectivity: 

Attempt to connect to the local endpoints using curl on the server where rabbitmq is running:

RabbitMQ: http://localhost:15642/api/exchanges

Reference Snippet from: <Base SAM Directory>/smarts/perl/lib/setup_rabbitmq.pl

print STDERR "Waiting for RabbitMQ to be available: ";

my $response;
my $OK = 0;

for ($try = 0; $try < $tries; $try++) {
   $response = $http->request('GET', $url . "/exchanges");
   if ($response->{success} && $response->{status} == "200") {
       print STDERR " OK\n";
       $OK = 1;
       last;
   }
   print STDERR ".";
   sleep $sleeps;
}

die " Failed!\n" unless $OK;

If the local connectivity fails, the rabbitmq will never return a response status of successful response or HTTP code 200 and fail. 

Engage with the server team to fix the local connectivity accordingly.