erlang.cookie: eacces error

4,684 views
Skip to first unread message

Bernard M

unread,
Jan 20, 2015, 10:49:57 AM1/20/15
to rabbitm...@googlegroups.com
I am on MAC OS X Yosemite and installed Rabbitmq 3.4.2. The install went well but I keep getting this cookie error “Error when reading /Users/myusername/.erlang.cookie: eacces” (full error is below).

The file is readable.
/Users/username/.erlang.cookie
-rw-------  1 Guest  staff    20B Jan 19 00:00 .erlang.cookie

This is a fresh install using Homebrew - http://www.rabbitmq.com/install-homebrew.html. This install is bundled with errlang so presumable need to (brew install erlang + SSL ??)
I followed steps on - https://www.rabbitmq.com/install-homebrew.html
and http://gordondickens.com/wordpress/2012/01/31/installing-and-configuring-rabbitmq/comment-page-1/ (This older article)

Here’s the full error and ay assistance is much appreciated.



{error_logger,{{2015,1,19},{16,39,4}},"Error when reading /Users/username/.erlang.cookie: eacces",[]}
{error_logger,{{2015,1,19},{16,39,4}},crash_report,[[{initial_call,{auth,init,['Argument__1']}},{pid,<0.19.0>},{registered_name,[]},{error_info,{exit,{"Error when reading /Users/username/.erlang.cookie: eacces",[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,330}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[net_sup,kernel_sup,<0.10.0>]},{messages,[]},{links,[<0.17.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,27},{reductions,657}],[]]}
{error_logger,{{2015,1,19},{16,39,4}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{"Error when reading /Users/username/.erlang.cookie: eacces",[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{offender,[{pid,undefined},{name,auth},{mfargs,{auth,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2015,1,19},{16,39,4}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{shutdown,{failed_to_start_child,auth,{"Error when reading /Users/username/.erlang.cookie: eacces",[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}}}},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2015,1,19},{16,39,4}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.9.0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,auth,{"Error when reading /Users/username/.erlang.cookie: eacces",

[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}}}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,133}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[<0.8.0>]},{messages,[{'EXIT',<0.10.0>,normal}]},{links,[<0.8.0>,<0.7.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,27},{reductions,150}],[]]}

{error_logger,{{2015,1,19},{16,39,4}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,auth,{"Error when reading /Users/username/.erlang.cookie: eacces",[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},

{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}}}}},{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,auth,{\"Error when reading /Users/username/.erlang.cookie: eacces\",[{auth,init_cookie,0,[{file,\"auth.erl\"},{line,285}]},{auth,init,1,[{file,\"auth.erl\"},{line,139}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,239}]}]}}}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,auth,{"Error when reading /Users/username/






rabbitmqctl status

Status of node rabbit@sungura ...
Error: unable to connect to node rabbit@sungura: nodedown

DIAGNOSTICS
===========

attempted to contact: [rabbit@sungura]

rabbit@sungura:
  * connected to epmd (port 4369) on sungura
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on sungura
  * suggestion: start the node

current node details:
- node name: 'rabbitmqctl-40941@sungura'
- home dir: /var/root
- cookie hash: LasAcWpkCvxskTzZ896BjQ==




sudo rabbitmq-server - only shows the below

              RabbitMQ 3.4.2. Copyright (C) 2007-2014 GoPivotal, Inc.
  ##  ##      Licensed under the MPL.  See http://www.rabbitmq.com/
  ##  ##
  ##########  Logs: /usr/local/var/log/rabbitmq/rab...@sungura.log
  ######  ##        /usr/local/var/log/rabbitmq/rab...@sungura-sasl.log
  ##########
              Starting broker... completed with 11 plugins.





 rabbitmqctl status
Status of node rabbit@sungura ...
[{pid,41177},
 {running_applications,
     [{rabbitmq_tracing,"RabbitMQ message logging / tracing","3.4.2"},
      {rabbitmq_management_visualiser,"RabbitMQ Visualiser","3.4.2"},
      {rabbitmq_management,"RabbitMQ Management Console","3.4.2"},
      {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.4.2"},
      {webmachine,"webmachine","1.10.3-rmq3.4.2-gite9359c7"},
      {mochiweb,"MochiMedia Web Server","2.7.0-rmq3.4.2-git680dba8"},
      {rabbitmq_mqtt,"RabbitMQ MQTT Adapter","3.4.2"},
      {rabbitmq_stomp,"Embedded Rabbit Stomp Adapter","3.4.2"},
      {rabbitmq_management_agent,"RabbitMQ Management Agent","3.4.2"},
      {rabbitmq_amqp1_0,"AMQP 1.0 support for RabbitMQ","3.4.2"},
      {rabbit,"RabbitMQ","3.4.2"},
      {os_mon,"CPO  CXC 138 46","2.2.15"},
      {inets,"INETS  CXC 138 49","5.10.2"},
      {mnesia,"MNESIA  CXC 138 12","4.12.1"},
      {amqp_client,"RabbitMQ AMQP Client","3.4.2"},
      {xmerl,"XML parser","1.3.7"},
      {sasl,"SASL  CXC 138 11","2.4"},
      {stdlib,"ERTS  CXC 138 10","2.1"},
      {kernel,"ERTS  CXC 138 10","3.0.1"}]},
 {os,{unix,darwin}},
 {erlang_version,
     "Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:4:4] [async-threads:30] [hipe] [kernel-poll:true]\n"},
 {memory,
     [{total,42503200},
      {connection_readers,0},
      {connection_writers,0},
      {connection_channels,0},
      {connection_other,5616},
      {queue_procs,2808},
      {queue_slave_procs,0},
      {plugins,674576},
      {other_proc,13702488},
      {mnesia,61920},
      {mgmt_db,138200},
      {msg_index,47680},
      {other_ets,1278064},
      {binary,14528},
      {code,20456767},
      {atom,711569},
      {other_system,5408984}]},
 {alarms,[]},
 {listeners,
     [{clustering,25672,"::"},
      {amqp,5672,"::"},
      {stomp,61613,"::"},
      {mqtt,1883,"::"}]},
 {vm_memory_high_watermark,0.4},
 {vm_memory_limit,6251945984},
 {disk_free_limit,50000000},
 {disk_free,256883400704},
 {file_descriptors,
     [{total_limit,2460},
      {total_used,5},
      {sockets_limit,2212},
      {sockets_used,3}]},
 {processes,[{limit,1048576},{used,198}]},
 {run_queue,0},
 {uptime,400}]









Michael Klishin

unread,
Jan 20, 2015, 10:53:08 AM1/20/15
to rabbitm...@googlegroups.com, Bernard M
On 20 January 2015 at 18:49:59, Bernard M (bem...@gmail.com) wrote:
> I am on MAC OS X Yosemite and installed Rabbitmq 3.4.2. The install
> went well but I keep getting this cookie error “Error when reading
> /Users/myusername/.erlang.cookie: eacces” (full error is
> below).
>
> The file is readable.
> /Users/username/.erlang.cookie
> -rw------- 1 Guest staff 20B Jan 19(http://airmail.calendar/2015-01-19%2012:00:00%20GMT+3)
> 00:00(http://airmail.calendar/2015-01-20%2000:00:00%20GMT+3)
> .erlang.cookie

Note that the owner is Guest. Are you running RabbitMQ while being signed in as Guest? If not, you
should change ~/.erlang.cookie ownership with `sudo chown`.

> This is a fresh install using Homebrew - http://www.rabbitmq.com/install-homebrew.html.
> This install is bundled with errlang so presumable need to (brew
> install erlang + SSL ??)
> I followed steps on - https://www.rabbitmq.com/install-homebrew.html
> and http://gordondickens.com/wordpress/2012/01/31/installing-and-configuring-rabbitmq/comment-page-1/
> (This older article)
>
> Here’s the full error and ay assistance is much appreciated.

The standalone install does not need Erlang to be installed via Homebrew.

The post you are referring to is 3 years old. I'd rather use RabbitMQ documentation.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Jan 20, 2015, 11:03:53 AM1/20/15
to Bernard M, rabbitm...@googlegroups.com
+rabbitmq-users

On 20 January 2015 at 19:01:14, Bernard M (bem...@gmail.com) wrote:
> I have had this error for over 12 hours hence my post. I would appreciate
> some assistance

The file is readable.
/Users/username/.erlang.cookie
-rw-------  1 Guest  staff    20B Jan 19 00:00 .erlang.cookie

What username are you signed in as? I suspect it is not Guest. You need to correct ~/.erlang.cookie
owner to be your active user, e.g. if the user is `bernard`:

sudo chown bernard ~/.erlang.cookie

See `chown` documentation if something isn't clear.

Bernard M

unread,
Jan 20, 2015, 11:04:44 AM1/20/15
to rabbitm...@googlegroups.com, bem...@gmail.com
I followed Rabbit MQ documentation.
I was simply referencing that I also looked at the older link/documentation after much searching online but RabbitMQ was my primary documentation for the installation per my original posting.
Thank you for the confirmation on Erlang. I would appreciate some input on the cookie error. Thanks

Bernard M

unread,
Jan 20, 2015, 11:13:48 AM1/20/15
to rabbitm...@googlegroups.com, bem...@gmail.com

I am now the current owner of ~/.erlang.cookie but exhibiting inconsistencies still. See below.


Wanted to add that
http://localhost:5672/ shows this weird character below so looks like things are not actually starting up given the error.

AMQP��	 


rabbitmqctl stop
Stopping and halting node rabbit@sungura ...

Error: unable to connect to node rabbit@sungura: nodedown

DIAGNOSTICS
===========

attempted to contact: [rabbit@sungura]

rabbit@sungura:
* connected to epmd (port 4369) on sungura
  * epmd reports node 'rabbit' running on port 25672
* TCP connection succeeded but Erlang distribution failed
* suggestion: hostname mismatch?
* suggestion: is the cookie set correctly?

current node details:
- node name: 'rabbitmqctl-44664@sungura'
- home dir: /Users/myusername
- cookie hash: 1gVJN4HpaHRiZqzcWxZhqg==



Michael Klishin

unread,
Jan 20, 2015, 11:18:45 AM1/20/15
to rabbitm...@googlegroups.com, Bernard M
On 20 January 2015 at 19:13:49, Bernard M (bem...@gmail.com) wrote:
> I am now the current owner of ~/.erlang.cookie but exhibiting
> inconsistencies still. See below.
>
>
> Wanted to add that
> http://localhost:5672/ shows this weird character below so
> looks like things are not actually starting up given the error.
>
> AMQP��

Port 5672 is not meant to be accessible over HTTP. It is a RabbitMQ port used by client libraries.
You want http://localhost:15672, as documented on http://www.rabbitmq.com/management.html.

The fact that you get a response suggests that the server is, in fact, up and running. The DIAGNOSTICS
info below says as much.

> rabbitmqctl stop
> Stopping and halting node rabbit@sungura ...
> Error: unable to connect to node rabbit@sungura: nodedown
>
> DIAGNOSTICS
> ===========
>
> attempted to contact: [rabbit@sungura]
>
> rabbit@sungura:
> * connected to epmd (port 4369) on sungura
> * epmd reports node 'rabbit' running on port 25672(tel://port%2025672)
> * TCP connection succeeded but Erlang distribution failed
> * suggestion: hostname mismatch?
> * suggestion: is the cookie set correctly?
>
> current node details:
> - node name: 'rabbitmqctl-44664@sungura'
> - home dir: /Users/myusername
> - cookie hash: 1gVJN4HpaHRiZqzcWxZhqg==

I'm not sure how you install Homebrew but something is pretty unusual. Have you maybe used `sudo` with Homebrew?
Homebrew is supposed to be located in your $HOME directory and owned by your user, so there is no need to use
`sudo` with it.

See what user rabbitmq server (the beam process) uses and make sure it has the same cookie
in its $HOME directory which is readable.

There is a brief section on the Erlang cookie:
http://www.rabbitmq.com/clustering.html.

Bernard M

unread,
Jan 20, 2015, 4:03:54 PM1/20/15
to rabbitm...@googlegroups.com
Okay thank you for that clarification however I saw this message after beginning a new install due to the erlang errors and the fact that I was getting the afore mentioned errors.
I am including my notes on the fresh install below. IN the meantime, with this new install, I have these error.

- Error: unable to connect to node rabbit@localhost: nodedown
- TCP connection succeeded but Erlang distribution failed. suggestion: hostname mismatch? suggestion: is the cookie set correctly
- rabbitmq-plugins enable rabbitmq_management - results in an error.- Plugin configuration unchanged. Applying plugin configuration to rabbit@localhost... failed.
 * Could not contact node rabbit@localhost. Changes will take effect at broker restart.
 * Options: --online  - fail if broker cannot be contacted.
            --offline - do not try to contact broke

I am guessing there are additional configuration and install steps not listed in http://www.rabbitmq.com/install-homebrew.html hence the errors??

Note that the cookie has read access and owned by my account after the install. I did not need to perform a chown. -
-r--------  1 username  staff  20 Jan 20 00:00 /Users/bernard/.erlang.cookie



INSTALLATION STEPS TAKEN
My account is an admin account on MAC OS X Yosemite .
My username owns usr/local, usr/bin, usr/local/Cellar and /Library/Caches/Homebrew/

After uninstalling using brew uninstall rabbitmq, I noticed that these folders and files were not removed so I manually deleted them - /usr/local/etc/rabbitmq, rm ~/.erlang.cookie, /usr/local/var/log/rabbitmq, /usr/local/var/lib/rabbitmq/

When deleting contents of /usr/local/var/lib/rabbitmq/, I received a “permissions denied message ”. It looks like many files under the path /usr/local/var/lib/rabbitmq/mnesia/ are owned by root.Why, I do not know given that I installed it using my account and brew install with no sudo. I “su” to delete /usr/local/var/lib/rabbitmq.

At this point, there are no more reference of rabbitmq in my system so I proceed with reinstallation.

I installed RabbitMQ using instructions on - http://www.rabbitmq.com/install-homebrew.html
During installation, I do not use sudo with brew but brew install.

INSTALLATION

<machinename:username> 0 [01-20 14:40] brew install rabbitmq
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/rabbitmq-3.4.2.yosemite.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/rabbitmq-3.4.2.yosemite.bottle.tar.gz
==> Pouring rabbitmq-3.4.2.yosemite.bottle.tar.gz
==> Caveats
Management Plugin enabled by default at http://localhost:15672

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

To have launchd start rabbitmq at login:
    ln -sfv /usr/local/opt/rabbitmq/*.plist ~/Library/LaunchAgents
Then to load rabbitmq now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist
Or, if you don't want/need launchctl, you can just run:
    rabbitmq-server
==> Summary
🍺  /usr/local/Cellar/rabbitmq/3.4.2: 1031 files, 27M
.

Michael Klishin

unread,
Jan 20, 2015, 4:09:37 PM1/20/15
to rabbitm...@googlegroups.com, Bernard M
On 21 January 2015 at 00:03:56, Bernard M (bem...@gmail.com) wrote:
> I am guessing there are additional configuration and install
> steps not listed in http://www.rabbitmq.com/install-homebrew.html
> hence the errors??

There should be no additional steps.

What does `hostname -f` return on your machine? What is in /etc/hosts?

Bernard M

unread,
Jan 20, 2015, 6:06:42 PM1/20/15
to rabbitm...@googlegroups.com, bem...@gmail.com
I have gotten further without prior errors. There was an issue with the hsotname as it had ".local" attached to the name so I used scutil hostname to fix.
Here's a transcript of current messages and a few clarifications ...

etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost mymachinename
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost

hostname -f - This returns the value in /etc/hosts above -- mymachinename

I was able to get to http://localhost:15672/#/
Config file not found ../usr/local/etc/rabbitmq.config -- Should I rename the files in this folder  rabbitmq-env.conf  and  rabbitmq.config.example ..

rabbitmq-plugins enable rabbitmq_management
Plugin configuration unchanged.
Applying plugin configuration to rabbit@localhost... nothing to do. - This is good I guess.














rabbitmqctl status
Status of node rabbit@localhost ...
[{pid,951},
 {running_applications,
     [{rabbitmq_management_visualiser,"RabbitMQ Visualiser","3.4.2"},

      {rabbitmq_management,"RabbitMQ Management Console","3.4.2"},
      {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.4.2"},
      {webmachine,"webmachine","1.10.3-rmq3.4.2-gite9359c7"},
      {mochiweb,"MochiMedia Web Server","2.7.0-rmq3.4.2-git680dba8"},
      {rabbitmq_mqtt,"RabbitMQ MQTT Adapter","3.4.2"},
      {rabbitmq_stomp,"Embedded Rabbit Stomp Adapter","3.4.2"},
      {rabbitmq_management_agent,"RabbitMQ Management Agent","3.4.2"},
      {rabbitmq_amqp1_0,"AMQP 1.0 support for RabbitMQ","3.4.2"},
      {rabbit,"RabbitMQ","3.4.2"},
      {mnesia,"MNESIA  CXC 138 12","4.12.1"},
      {os_mon,"CPO  CXC 138 46","2.2.15"},
      {inets,"INETS  CXC 138 49","5.10.2"},
      {amqp_client,"RabbitMQ AMQP Client","3.4.2"},
      {xmerl,"XML parser","1.3.7"},
      {sasl,"SASL  CXC 138 11","2.4"},
      {stdlib,"ERTS  CXC 138 10","2.1"},
      {kernel,"ERTS  CXC 138 10","3.0.1"}]},
 {os,{unix,darwin}},
 {erlang_version,
     "Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:4:4] [async-threads:30] [hipe] [kernel-poll:true]\n"},
 {memory,
     [{total,42418352},

      {connection_readers,0},
      {connection_writers,0},
      {connection_channels,0},
      {connection_other,5616},
      {queue_procs,2808},
      {queue_slave_procs,0},
      {plugins,549320},
      {other_proc,13898200},
      {mnesia,62448},
      {mgmt_db,112672},
      {msg_index,47680},
      {other_ets,1257520},
      {binary,14664},
      {code,20361280},
      {atom,703377},
      {other_system,5402767}]},

 {alarms,[]},
 {listeners,
     [{clustering,25672,"::"},
      {amqp,5672,"127.0.0.1"},

      {stomp,61613,"::"},
      {mqtt,1883,"::"}]},
 {vm_memory_high_watermark,0.4},
 {vm_memory_limit,6143497011},
 {disk_free_limit,50000000},
 {disk_free,259560914944},

 {file_descriptors,
     [{total_limit,2460},
      {total_used,5},
      {sockets_limit,2212},
      {sockets_used,3}]},
 {processes,[{limit,1048576},{used,194}]},
 {run_queue,0},
 {uptime,287}]

Michael Klishin

unread,
Jan 20, 2015, 6:12:05 PM1/20/15
to rabbitm...@googlegroups.com, Bernard M
On 21 January 2015 at 02:06:44, Bernard M (bem...@gmail.com) wrote:
> I was able to get to http://localhost:15672/#/
> Config file not found ../usr/local/etc/rabbitmq.config --
> Should I rename the files in this folder rabbitmq-env.conf and
> rabbitmq.config.example ..

If you want to configure something. You can get started and go quite far without
altering the config.

> rabbitmq-plugins enable rabbitmq_management
> Plugin configuration unchanged.
> Applying plugin configuration to rabbit@localhost... nothing
> to do. - This is good I guess.

This means the plugin is already enabled, so RabbitMQ has no changes to apply.

Note that starting with 3.4.0 you don't have to restart the server after you enable or disable
a plugin.

Bernard M

unread,
Jan 20, 2015, 6:39:59 PM1/20/15
to rabbitm...@googlegroups.com, bem...@gmail.com
Alright thank you Michael!
Reply all
Reply to author
Forward
0 new messages