title: Rabbitmq commands are not working
body: <p>When I perform <code>sudo rabbitmqctl add_user james mypassword</code> it returns:</p>
  
  <pre><code>Creating user "james" ...
  Error: {badarg,
             [{erlang,group_leader,[undefined,&lt;5490.18387.0&gt;],[]},
              {rabbit_log,with_local_io,1,
                  [{file,"src/rabbit_log.erl"},{line,99}]},
              {rabbit_auth_backend_internal,add_user,2,
                  [{file,"src/rabbit_auth_backend_internal.erl"},{line,149}]},
              {rpc,'-handle_call_call/6-fun-0-',5,
                  [{file,"rpc.erl"},{line,206}]}]}
  </code></pre>
  
  <p>I previously did not have a problem with this. However it has recently spawned this error and I'm not sure why. It also returns the same error when I try <code>sudo rabbitmqctl stop</code>:</p>
  
  <pre><code>Stopping and halting node rabbit@postr ...
  Error: {badarg,[{erlang,group_leader,[undefined,&lt;5490.18408.0&gt;],[]},
                  {rabbit_log,with_local_io,1,
                              [{file,"src/rabbit_log.erl"},{line,99}]},
                  {rabbit,'-stop_and_halt/0-after$^0/0-0-',0,
                          [{file,"src/rabbit.erl"},{line,387}]},
                  {rabbit,stop_and_halt,0,[{file,"src/rabbit.erl"},{line,384}]},
                  {rpc,'-handle_call_call/6-fun-0-',5,
                       [{file,"rpc.erl"},{line,206}]}]}
  </code></pre>
  
  <p>My rabbitmq log file looks like this:</p>
  
  <pre><code>=ERROR REPORT==== 1-May-2018::21:48:06 ===
  closing AMQP connection &lt;0.14307.0&gt; (174.824.62.219:39718 -&gt; 174.824.62.219:5672):
  {handshake_error,starting,0,
                   {amqp_error,access_refused,
                               "AMQPLAIN login refused: user 'james' - invalid credentials",
                               'connection.start_ok'}}
  </code></pre>
  
  <p>However the user <code>james</code> doesn't exist now, <code>sudo rabbitmqctl list_users</code> returns:</p>
  
  <pre><code>Listing users ...
  guest   [administrator]
  </code></pre>
  
  <p>I've tried changing my <code>CELERY_BROKER_URL</code> from <code>'amqp://{}:{}@174.824.62.219/vhost'.format(config('RABBIT_USER'), config('RABBIT_PW'))</code> to <code>'amqp://guest:guest@localhost'</code> - however still getting the same error.</p>
  
  <p>Any idea what the problem is?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've also tried <code>service rabbitmq-server start</code> (to restart rabbitmq), and it returns:</p>
  
  <pre><code>Job for rabbitmq-server.service failed because the control process exited with error code. 
  See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
  </code></pre>
  
  <p>so <code>systemctl status rabbitmq-server.service</code> returns:</p>
  
  <pre><code>● rabbitmq-server.service - RabbitMQ Messaging Server
     Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2018-05-03 07:30:37 UTC; 19s ago
    Process: 29946 ExecStop=/usr/sbin/rabbitmqctl stop (code=exited, status=2)
    Process: 8566 ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmq-server-wait (code=exited, status=2)
    Process: 8565 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
   Main PID: 8565 (code=exited, status=1/FAILURE)
  </code></pre>
  
  <p>Output of:</p>
  
  <pre><code>(env) james@postr:~/postr$ sudo netstat -plant
  Active Internet connections (servers and established)
  Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1403/sshd       
  tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      8409/postgres   
  tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      4690/nginx -g daemo
  tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      10518/beam      
  tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      4690/nginx -g daemo
  tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      30095/epmd      
  tcp        0      0 127.0.0.1:51656         127.0.0.1:4369          TIME_WAIT   -               
  tcp        0      0 127.0.1.1:4369          127.0.0.1:35352         TIME_WAIT   -               
  tcp        0    332 174.824.62.219:22       49.194.155.110:49861    ESTABLISHED 5856/sshd: james [p
  tcp        0      0 127.0.0.1:59810         127.0.0.1:4369          TIME_WAIT   -               
  tcp        0      0 127.0.0.1:56945         127.0.1.1:25672         TIME_WAIT   -               
  tcp        0      0 127.0.0.1:4369          127.0.0.1:41000         ESTABLISHED 30095/epmd      
  tcp        0      0 127.0.0.1:41000         127.0.0.1:4369          ESTABLISHED 10518/beam      
  tcp        0      0 127.0.1.1:4369          127.0.0.1:51514         TIME_WAIT   -               
  tcp        0      0 127.0.1.1:4369          127.0.0.1:48547         TIME_WAIT   -               
  tcp        0      0 127.0.0.1:57392         127.0.0.1:4369          TIME_WAIT   -               
  tcp6       0      0 :::22                   :::*                    LISTEN      1403/sshd       
  tcp6       0      0 :::5672                 :::*                    LISTEN      10518/beam      
  tcp6       0      0 :::80                   :::*                    LISTEN      4690/nginx -g daemo
  tcp6       0      0 :::4369                 :::*                    LISTEN      30095/epmd   
  </code></pre>