首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Docker rabbitmq图像出现[错误]太短的cookie字符串失败

Docker rabbitmq图像出现[错误]太短的cookie字符串失败
EN

Stack Overflow用户
提问于 2020-08-12 21:04:45
回答 5查看 9.9K关注 0票数 16

似乎我确实有一个问题,在我的Windows机器运行对接机桌面上的rabbitmq和rabbitmq管理对接器映像。

当尝试运行它时,在它关闭之前会出现以下日志:

代码语言:javascript
复制
21:01:21.726 [error] Failed to write to cookie file '/var/lib/rabbitmq/.erlang.cookie': enospc

21:01:22.355 [error] Too short cookie string

21:01:22.356 [error] Too short cookie string

21:01:23.161 [error] Too short cookie string

21:01:23.162 [error] Too short cookie string

21:01:23.783 [error] Too short cookie string

21:01:23.784 [error] Too short cookie string

21:01:24.405 [error] Too short cookie string

21:01:24.406 [error] Too short cookie string

21:01:25.027 [error] Too short cookie string

21:01:25.028 [error] Too short cookie string

21:01:25.661 [error] Too short cookie string

21:01:25.662 [error] Too short cookie string

21:01:26.281 [error] Too short cookie string

21:01:26.282 [error] Too short cookie string

21:01:26.910 [error] Too short cookie string

21:01:26.911 [error] Too short cookie string

21:01:27.533 [error] Too short cookie string

21:01:27.534 [error] Too short cookie string

21:01:28.161 [error] Too short cookie string
Distribution failed: {{:shutdown, {:failed_to_start_child, :auth, {'Too short cookie string', [{:auth, :init_cookie, 0, [file: 'auth.erl', line: 290]}, {:auth, :init, 1, [file: 'auth.erl', line: 144]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 417]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 385]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]}}}, {:child, :undefined, :net_sup_dynamic, {:erl_distribution, :start_link, [[:"rabbitmqcli-47-rabbit@90cc77cefcb8", :shortnames, 15000], false, :net_sup_dynamic]}, :permanent, 1000, :supervisor, [:erl_distribution]}}
Configuring logger redirection

21:01:29.717 [error]
21:01:29.715 [error] Too short cookie string
21:01:29.715 [error] Supervisor net_sup had child auth started with auth:start_link() at undefined exit with reason "Too short cookie string" in auth:init_cookie/0 line 290 in context start_error
21:01:29.715 [error] CRASH REPORT Process <0.201.0> with 0 neighbours crashed with reason: "Too short cookie string" in auth:init_cookie/0 line 290
21:01:29.719 [error] BOOT FAILED
BOOT FAILED
21:01:29.719 [error] ===========
===========
21:01:29.719 [error] Exception during startup:
Exception during startup:
21:01:29.720 [error]

21:01:29.720 [error]     supervisor:children_map/4 line 1171
    supervisor:children_map/4 line 1171
    supervisor:'-start_children/2-fun-0-'/3 line 355
21:01:29.721 [error]     supervisor:'-start_children/2-fun-0-'/3 line 355
21:01:29.721 [error]     supervisor:do_start_child/2 line 371
    supervisor:do_start_child/2 line 371
21:01:29.721 [error]     supervisor:do_start_child_i/3 line 385
    supervisor:do_start_child_i/3 line 385
21:01:29.721 [error]     rabbit_prelaunch:run_prelaunch_first_phase/0 line 27
    rabbit_prelaunch:run_prelaunch_first_phase/0 line 27
21:01:29.721 [error]     rabbit_prelaunch:do_run/0 line 111
    rabbit_prelaunch:do_run/0 line 111
21:01:29.722 [error]     rabbit_prelaunch_dist:setup/1 line 15
    rabbit_prelaunch_dist:setup/1 line 15
    rabbit_prelaunch_dist:duplicate_node_check/1 line 51
21:01:29.722 [error]     rabbit_prelaunch_dist:duplicate_node_check/1 line 51
21:01:29.722 [error] error:{badmatch,
error:{badmatch,
          {error,
21:01:29.722 [error]           {error,
21:01:29.722 [error]               {{shutdown,
              {{shutdown,
21:01:29.722 [error]                    {failed_to_start_child,auth,
                   {failed_to_start_child,auth,
21:01:29.723 [error]                        {"Too short cookie string",
                       {"Too short cookie string",
21:01:29.723 [error]                         [{auth,init_cookie,0,[{file,"auth.erl"},{line,290}]},
                        [{auth,init_cookie,0,[{file,"auth.erl"},{line,290}]},
21:01:29.723 [error]                          {auth,init,1,[{file,"auth.erl"},{line,144}]},
                         {auth,init,1,[{file,"auth.erl"},{line,144}]},
21:01:29.723 [error]                          {gen_server,init_it,2,
                         {gen_server,init_it,2,
                             [{file,"gen_server.erl"},{line,417}]},
21:01:29.723 [error]                              [{file,"gen_server.erl"},{line,417}]},
21:01:29.724 [error]                          {gen_server,init_it,6,
                         {gen_server,init_it,6,
                             [{file,"gen_server.erl"},{line,385}]},
21:01:29.724 [error]                              [{file,"gen_server.erl"},{line,385}]},
21:01:29.724 [error]                          {proc_lib,init_p_do_apply,3,
                         {proc_lib,init_p_do_apply,3,
21:01:29.724 [error]                              [{file,"proc_lib.erl"},{line,226}]}]}}},
                             [{file,"proc_lib.erl"},{line,226}]}]}}},
21:01:29.724 [error]                {child,undefined,net_sup_dynamic,
               {child,undefined,net_sup_dynamic,
21:01:29.725 [error]                    {erl_distribution,start_link,
                   {erl_distribution,start_link,
21:01:29.725 [error]                        [[rabbit_prelaunch_510@localhost,shortnames],
                       [[rabbit_prelaunch_510@localhost,shortnames],
21:01:29.725 [error]                         false,net_sup_dynamic]},
                        false,net_sup_dynamic]},
21:01:29.725 [error]                    permanent,1000,supervisor,
                   permanent,1000,supervisor,
21:01:29.725 [error]                    [erl_distribution]}}}}
21:01:29.726 [error]
                   [erl_distribution]}}}}

21:01:30.726 [error] Supervisor rabbit_prelaunch_sup had child prelaunch started with rabbit_prelaunch:run_prelaunch_first_phase() at undefined exit with reason {badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"Too short cookie string",[{auth,init_cookie,0,[{file,"auth.erl"},{line,290}]},{auth,init,1,[{file,"auth.erl"},{line,144}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,417}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,385}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_510@localhost,shortnames],false,net_sup_dynamic]},...}}}} in context start_error
21:01:30.726 [error] CRASH REPORT Process <0.153.0> with 0 neighbours exited with reason: {{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"Too short cookie string",[{auth,init_cookie,0,[{file,"auth.erl"},{line,290}]},{auth,init,1,[{file,"auth.erl"},{line,144}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,417}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,385}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_510@localhost,...],...]},...}}}}}},...} in application_master:init/4 line 138
{"Kernel pid terminated",application_controller,"{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{\"Too short cookie string\",[{auth,init_cookie,0,[{file,\"auth.erl\"},{line,290}]},{auth,init,1,[{file,\"auth.erl\"},{line,144}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,417}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,385}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_510@localhost,shortnames],false,net_sup_dynamic]},permanent,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"Too

Crash dump is being written to: erl_crash.dump...

我已经使用这个图像几个月了,没有任何问题,但突然之间,它不再工作了。

我还试着在我的覆盆子皮上运行这个。结果它在那里起作用了,所以这对我来说更像是本地的事情,这有点奇怪,因为码头工人基本上是为了避免这些问题。

我还尝试将RABBITMQ_ERLANG_COOKIE环境变量设置为长名称,但没有成功。有什么想法吗?

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2020-08-12 23:27:15

似乎RabbitMQ没有空间可以编写cookie:21:01:21.726 [error] Failed to write to cookie file '/var/lib/rabbitmq/.erlang.cookie': enospc

也许你在码头有一些空间限制,或者你实际上没有空间在主机上?

票数 19
EN

Stack Overflow用户

发布于 2020-08-20 11:11:21

我也犯了同样的错误,听从了欧文·布朗的建议。不幸的是,删除rabbitmq映像不能解决我的问题,但删除所有其他冗余映像(特别是较大的图像)也为我解决了问题。

如果您想知道所有图像的大小,您可以使用

docker system df

编辑:

几个小时后,当我再次遇到同样的问题时,我又研究了一下,发现了this answer,它解决了我的麻烦。

比删除图像更重要的是使用以下方法删除卷:

docker volume rm $(docker volume ls -f dangling=true -q) //删除所有卷

票数 20
EN

Stack Overflow用户

发布于 2020-08-18 04:40:45

使用docker run rabbitmq:management隔离启动兔in。

如果仍然收到“未能写入cookie文件”/var/lib/ RabbitMQ /.erlang.cookie‘:enospc“错误,则会导致问题,因为RabbitMQ使用的文件已损坏。

因为一旦发生错误,容器就会退出,并且容器是从缓存的坞映像启动的,所以您将无法进入容器来修复这个问题。相反,您需要删除缓存的映像。

  1. 消除了原始问题的原因,这可能是分配给Docker的内存不足。您可以通过docker的utility.
  2. Delete删除图像或分配更多的内存--无论是rabbitmq停靠器图像docker images | grep rabbit,还是每个图像id的run docker rmi <image_id(s)>
  3. 删除所有缓存的图像。列出所有使用$ docker rmi $(docker images -f "dangling=true" -q)

的图像,然后用$ docker images --filter "dangling=true删除它们

最后,使用docker run rabbitmq:management再次运行rabbitmq。如果它运转正常,你就会重新开始工作。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63384705

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档