Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQ: "Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only" #2048

Closed
AratKruglik opened this issue Mar 18, 2019 · 11 comments
Labels

Comments

@AratKruglik
Copy link

Info:

  • Docker version ($ docker --version): Docker version 18.09.2, build 6247962
  • Laradock commit ($ git rev-parse HEAD): 254a9ae
  • System info (Mac, PC, Linux): PC
  • System info disto/version: Windows 10

Issue:

RabbitMQ not starting

Terminal output:
rabbitmq_1 | 09:50:10.483 [error] Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only

rabbitmq_1 | Distribution failed: {{:shutdown, {:failed_to_start_child, :auth, {'Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only', [{:auth, :init_cookie, 0, [file: 'auth.erl', line: 286]}, {:auth, :init, 1, [file: 'auth.erl
', line: 140]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}, {:child, :undefined, :net_sup_dynamic, {:erl_d
istribution, :start_link, [[:"rabbitmqcli-58-rabbit@laradock-rabbitmq", :shortnames, 15000], false]}, :permanent, 1000, :supervisor, [:erl_distribution]}}

rabbitmq_1 | label: 201#{label=>{proc_lib,crash},report=>[9-03-18 09:50:23.738598 crash_report [{initial_call,{auth,init,['Argument__1']}},{pid,<0.59.0>},{registered_name,[]},{error_info,{error,"Cookie file /var/lib/rabbitmq/.erlang.cookie mu
st be accessible by owner only",[{auth,init_cookie,0,[{file,"auth.erl"},{line,286}]},{auth,init,1,[{file,"auth.erl"},{line,140}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,374}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,342}]},{proc_lib,init_
p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}},{ancestors,[net_sup,kernel_sup,<0.46.0>]},{message_queue_len,0},{messages,[]},{links,[<0.57.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,27},{reductions,559}],[]]}
rabbitmq_1 | 2019-03-18 09:50:23.739147 supervisor_report #{label=>{supervisor,start_error},report=>[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{"Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",[{aut
h,init_cookie,0,[{file,"auth.erl"},{line,286}]},{auth,init,1,[{file,"auth.erl"},{line,140}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,374}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,342}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{
line,249}]}]}},{offender,[{pid,undefined},{id,auth},{mfargs,{auth,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}

rabbitmq_1 | 2019-03-18 09:50:23.740906 supervisor_report 2019-03-18 09:50:23.741883 crash_report #{label=>{proc_lib,crash},report=>[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.45.
0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,auth,{"Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",[{auth,init_cookie,0,[{file,"auth.erl"},{line,286}]},{auth,in
it,1,[{file,"auth.erl"},{line,140}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,374}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,342}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}}}}},{kernel,start,[normal,[]]}},[{applicat
ion_master,init,4,[{file,"application_master.erl"},{line,138}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}},{ancestors,[<0.44.0>]},{message_queue_len,1},{messages,[{'EXIT',<0.46.0>,normal}]},{links,[<0.44.0>,<0.43.0>]},{dictionary,[]},{trap_e
xit,true},{status,running},{heap_size,987},{stack_size,27},{reductions,184}],[]]}

Expected behavior:

RabbitMQ starts

Reproduce:

Build and run docker-compose build rabbitmq, docker-compose up rabbitmq

@AratKruglik
Copy link
Author

AratKruglik commented Mar 18, 2019

How I can fix it?

@AratKruglik
Copy link
Author

Any ideas?

@ScottChayaa
Copy link

the .erlang.cookie location seems be changed
try modify docker-compose.yml

### RabbitMQ #############################################
      volumes:
        - ${DATA_PATH_HOST}/rabbitmq:/var/lib/rabbitmq/mnesia

@ishanbhutagate6
Copy link

@ScottChayaa
Thanks for the resolution, It works for me.

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
@dendihandian
Copy link

docker-compose.yml:

### RabbitMQ #############################################
    rabbitmq:
      build: ./rabbitmq
      ports:
        - "${RABBITMQ_NODE_HOST_PORT}:5672"
        - "${RABBITMQ_MANAGEMENT_HTTP_HOST_PORT}:15672"
        - "${RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT}:15671"
      privileged: true
      environment:
        - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
        - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
      hostname: laradock-rabbitmq
      volumes:
        - ${DATA_PATH_HOST}/rabbitmq:/var/lib/rabbitmq/mnesia
      depends_on:
        - php-fpm
      networks:
        - backend

Now I got this error...

C:\Users\dhn\git\laradock>docker-compose up rabbitmq
laradock_docker-in-docker_1 is up-to-date
laradock_workspace_1 is up-to-date
laradock_php-fpm_1 is up-to-date
Starting laradock_rabbitmq_1 ... done
Attaching to laradock_rabbitmq_1
rabbitmq_1             | 2020-03-27 15:16:33.794 [info] <0.8.0> Feature flags: list of feature flags found:
rabbitmq_1             | 2020-03-27 15:16:33.794 [info] <0.8.0> Feature flags:   [x] drop_unroutable_metric
rabbitmq_1             | 2020-03-27 15:16:33.794 [info] <0.8.0> Feature flags:   [x] empty_basic_get_metric
rabbitmq_1             | 2020-03-27 15:16:33.794 [info] <0.8.0> Feature flags:   [x] implicit_default_bindings
rabbitmq_1             | 2020-03-27 15:16:33.794 [info] <0.8.0> Feature flags:   [x] quorum_queue
rabbitmq_1             | 2020-03-27 15:16:33.794 [info] <0.8.0> Feature flags:   [x] virtual_host_metadata
rabbitmq_1             | 2020-03-27 15:16:33.794 [info] <0.8.0> Feature flags: feature flag states written to disk: yes
rabbitmq_1             | 2020-03-27 15:16:35.984 [error] <0.8.0> 
rabbitmq_1             | Error description:
rabbitmq_1             |     init:do_boot/3
rabbitmq_1             |     init:start_em/1
rabbitmq_1             |     rabbit:start_it/1 line 465
rabbitmq_1             |     rabbit:'-boot/0-fun-0-'/0 line 313
rabbitmq_1             |     rabbit_node_monitor:write_cluster_status/1 line 134
rabbitmq_1             | throw:{error,{could_not_write_file,"/var/lib/rabbitmq/mnesia/rabbit@laradock-rabbitmq/cluster_nodes.config",
rabbitmq_1             |                                    ebusy}}
rabbitmq_1             | Log file(s) (may contain more information):
rabbitmq_1             |    <stdout>
rabbitmq_1             |
rabbitmq_1             | BOOT FAILED
rabbitmq_1             | ===========
rabbitmq_1             |
rabbitmq_1             | Error description:
rabbitmq_1             |     init:do_boot/3
rabbitmq_1             |     init:start_em/1
rabbitmq_1             |     rabbit:start_it/1 line 465
rabbitmq_1             |     rabbit:'-boot/0-fun-0-'/0 line 313
rabbitmq_1             |     rabbit_node_monitor:write_cluster_status/1 line 134
rabbitmq_1             | throw:{error,{could_not_write_file,"/var/lib/rabbitmq/mnesia/rabbit@laradock-rabbitmq/cluster_nodes.config",
rabbitmq_1             |                                    ebusy}}
rabbitmq_1             | Log file(s) (may contain more information):
rabbitmq_1             |    <stdout>
rabbitmq_1             |
rabbitmq_1             | {"init terminating in do_boot",{error,{could_not_write_file,"/var/lib/rabbitmq/mnesia/rabbit@laradock-rabbitmq/cluster_nodes.config",ebusy}}}
rabbitmq_1             | init terminating in do_boot ({error,{could_not_write_file,/var/lib/rabbitmq/mnesia/rabbit@laradock-rabbitmq/cluster_nodes.config,ebusy}})
rabbitmq_1             |
rabbitmq_1             | Crash dump is being written to: /var/log/rabbitmq/erl_crash.dump...done
laradock_rabbitmq_1 exited with code 0

C:\Users\dhn\git\laradock>

@webtekindo
Copy link

Same as @dendihandian , do you have a solution?

@mohamedhafezqo
Copy link

mohamedhafezqo commented Jun 17, 2020

Hey @webtekindo,
Just, rm .erlang.cookie file from the rabbit folder and then docker-compose up

@mohamedhafezqo
Copy link

or chmod 600 ~/.erlang.cookie

@littletom1
Copy link

littletom1 commented Sep 12, 2022

Hey @webtekindo, Just, rm .erlang.cookie file from the rabbit folder and then docker-compose up

it works for me thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants