14

My RabbitMQ server went down and it is impossible to restart it. I tried to restart, reinstall it... I still don't understand the error. This is what I get

BOOT FAILED

===========

Error description:
   {could_not_start,rabbit,
    {bad_return,
     {{rabbit,start,[normal,[]]},
      {'EXIT',
       {rabbit,failure_during_boot,
        {badmatch,
         {error,
          {{{function_clause,
             [{rabbit_queue_index,journal_minus_segment1,
               [{no_pub,del,no_ack},
                {{<<115,254,171,167,171,226,110,171,251,38,217,145,3,12,215,151>>,
                  {message_properties,1409712663123302,false},
                  true},
                 del,ack}],
               [{file,"src/rabbit_queue_index.erl"},{line,989}]},
              {rabbit_queue_index,'-journal_minus_segment/2-fun-0-',4,
               [{file,"src/rabbit_queue_index.erl"},{line,973}]},
              {array,sparse_foldl_3,7,[{file,"array.erl"},{line,1675}]},
              {array,sparse_foldl_2,9,[{file,"array.erl"},{line,1669}]},
              {rabbit_queue_index,'-recover_journal/1-fun-0-',1,
               [{file,"src/rabbit_queue_index.erl"},{line,701}]},
              {lists,map,2,[{file,"lists.erl"},{line,1224}]},
              {rabbit_queue_index,segment_map,2,
               [{file,"src/rabbit_queue_index.erl"},{line,819}]},
              {rabbit_queue_index,recover_journal,1,
               [{file,"src/rabbit_queue_index.erl"},{line,693}]}]},
            {gen_server2,call,[<0.186.0>,out,infinity]}},
           {child,undefined,msg_store_persistent,
            {rabbit_msg_store,start_link,
             [msg_store_persistent,
              "/var/lib/rabbitmq/mnesia/rabbit@host",[],
              {#Fun<rabbit_queue_index.2.132977059>,
               {start,
                [{resource,<<"/">>,queue,
                  <<"photos_to_be_tagged_user_36">>}]}}]},
            transient,4294967295,worker,
            [rabbit_msg_store]}}}}}}}}}

Can anyone help with this?

Thanks a lot

tarkovski
  • 187
  • 1
  • 2
  • 8

3 Answers3

29

For anyone else looking for this error rabbit,failure_during_boot,

{badmatch,  
     {error,  
      {{{function_clause,  
         [{rabbit_queue_index,journal_minus_segment1, ...

I just dealt with the same issue and what helped was going to the mnesia directories and deleting the queues and msg_store_transient directories.

From what I understand, what happens is that you end up with a bad queue db (for whatever reason -i.e. a sudden power failure, some other process touches the files) which rabbitmq can't parse and so it crashes. Once you clear the queue of messages, it works fine.

Luís Cruz
  • 14,780
  • 16
  • 68
  • 100
Rush
  • 443
  • 5
  • 6
  • Thanks. I was worried about doing that, but it recovered nicely. My affected instance is part of a cluster and it synced up with the other one nicely after deleting the queues and msg_store_persistent (in my case) directories. – David Welborn Feb 04 '19 at 18:59
  • Thanks, Man. You saved my day – fahad Apr 23 '21 at 17:29
  • Thanks, after deleting the files, the issue got resolved. And for more info, files will be located under /var/lib/rabbitmq/mnesia/rabbit@/. Here mainly you need to clear the content from these directories msg_store_persistent, msg_store_transient, and queues. – Arjun Thakur Nov 14 '22 at 08:00
5

I ran into the same issue and this is what helped me.

The Mnesia files in questions were located in /var/lib/rabbitmq/.

Seth McClaine
  • 9,142
  • 6
  • 38
  • 64
Win T
  • 66
  • 1
  • 2
1

I had to delete everything in ...\AppData\Roaming\RabbitMQ\db, not just the Mnesia files (on Windows, obviously).

Benjamin
  • 1,983
  • 23
  • 33