Rebar3 + Cowboy内核PID终止 [英] Rebar3 + Cowboy Kernel PID Terminated

查看:174
本文介绍了Rebar3 + Cowboy内核PID终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 rebar3 并创建了一个新版本,其中




cd〜/ apps
rebar3 new release tunnel



然后



我将 src 文件从〜/ tunnel / src / * 复制到 〜/ apps / tunnel / src /



我遇到一个编译错误, rebar3 run 并发现 ErlangKernel pid terminated错误作为可能的解决方案。我将所有关于 tunnel_app 的内容重命名为 tunnel 。所以我的 src 包含 tunnel.erl tunnel.app.src tunnel_sup.erl 。我重新命名模块定义。



这是$ code> rebar3运行错误:

 〜/ apps / tunnel:.rebar3运行
===>验证依赖关系...
===>编译隧道
===>启动relx构建过程...
===>从目录中解析OTP应用程序:
/ Users / quantum / apps / tunnel / _build / default / lib
/ Users / quantum / apps / tunnel / apps
/ usr / local / Cellar / erlang /19.2/lib/erlang/lib
/ Users / quantum / apps / tunnel / _build / default / rel
===>已解决的隧道-0.1.0
===>开发模式启用,释放将被符号链接
===>发布成功创建!
readlink:非法选项 - f
用法:readlink [-n] [文件...]
Exec:/usr/local/Cellar/erlang/19.2/lib/erlang/erts -8.2 / bin / erlexec -boot /Users/quantum/apps/tunnel/_build/default/rel/tunnel/releases/0.1.0/tunnel -mode embedded -boot_var ERTS_LIB_DIR /usr/local/Cellar/erlang/19.2/lib / erlang / lib -config /Users/quantum/apps/tunnel/_build/default/rel/tunnel/releases/0.1.0/sys.config -args_file / Users / quantum / apps / tunnel / _build / default / rel / tunnel /releases/0.1.0/vm.args -pa - console
根:/ Users / quantum / apps / tunnel / _build / default / rel / tunnel
/ Users / quantum / apps / tunnel / _build / default / rel / tunnel
Erlang / OTP 19 [erts-8.2] [source] [64位] [smp:8:8] [async-threads:30] [hipe] [kernel-poll: true] [dtrace]


= INFO REPORT ==== 16-Feb-2017 :: 15:02:21 ===
应用程序:tunnel
退出:{bad_return,
{{tunnel,start,[normal,[]]},
{'EXIT',
{undef,
[{cowboy_router,compile,
[[{'_',
[{/ info,lobby_handler,[]},
{/ join /:name,join_handler, ]},
{/ play /:table_pid /:name /:auth /:team /:action /:x /:y,
play_handler,[]}]],
[]},
{tunnel,start,2,
[{file,
/ Users / quantum / apps / tunnel / _build / default / lib / tunnel / src / tunnel .erl},
{line,8}]},
{application_master,start_it_old,4,
[{file,application_master.erl},
{ 273}]}]}}}}
type:permanent
{kernel pid terminated,application_controller,{application_start_failure,tunnel,{bad_return,{{tunnel,start,[n ormal,[]]},{ '退出',{是undef,[{cowboy_router,编译,[[{ '_',[{\ / info\,lobby_handler,[]},{\/加入/:name\,join_handler,[]},{\ /播放/:table_pid /:名称/:AUTH /:团队/:动作/:X /:y\,play_handler,[]} ]}]],[]},{隧道,启动,2,[{文件,\ /Users/quantum/apps/tunnel/_build/default/lib/tunnel/src/tunnel.erl\}, {line,8}]},{application_master,start_it_old,4,[{file,\application_master.erl\},{line,273}]}]}}}}}}}
内核pid terminated(application_controller)({application_start_failure,tunnel,{bad_return,{{tunnel,start,[normal,[]]},{'EXIT',{undef,[{cowboy_router,compile,[[{'_' {/ info,lobby_handler,[]},{/ j

正在写崩溃转储

为什么这是崩溃?

解决方案

如果这是您第一次使用rebar3的经验,使用OTP应用程序,而不是OTP版本:

  rebar3新应用程序隧道
/ pre>

,然后不要盲目地复制源文件,因为您有风险覆盖在 src 之下为您创建的文件。请先查看该目录的内容。



我还建议花时间阅读rebar3 https://www.rebar3.org/docs/basic-usage 页面。



您还必须阅读有关OTP应用程序的内容。我知道,相当多的理解和有时混乱。免费来源是 http://learnyousomeerlang.com/building-applications-with-otp。买一本关于Erlang的书也是值得的。有几个,我建议 https://www.manning.com / books / erlang-and-otp-in-action



还有一个在线课程,免费,从几天开始(二月二十日2017) https://www.mooc-list.com/course/功能编程 - erlang-futurelearn


I installed rebar3 and created a new release with

cd ~/apps rebar3 new release tunnel

Then

I copied my src files from ~/tunnel/src/* to ~/apps/tunnel/src/

I ran into a compile error with rebar3 run and found Erlang "Kernel pid terminated" error as a possible solution. I renamed everything about tunnel_app to tunnel. So my src contains tunnel.erl , tunnel.app.src and tunnel_sup.erl. I renamed the module definition as appropriate.

Here's the rebar3 run error:

~/apps/tunnel:.rebar3 run
===> Verifying dependencies...
===> Compiling tunnel
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
          /Users/quantum/apps/tunnel/_build/default/lib
          /Users/quantum/apps/tunnel/apps
          /usr/local/Cellar/erlang/19.2/lib/erlang/lib
          /Users/quantum/apps/tunnel/_build/default/rel
===> Resolved tunnel-0.1.0
===> Dev mode enabled, release will be symlinked
===> release successfully created!
readlink: illegal option -- f
usage: readlink [-n] [file ...]
Exec: /usr/local/Cellar/erlang/19.2/lib/erlang/erts-8.2/bin/erlexec -boot /Users/quantum/apps/tunnel/_build/default/rel/tunnel/releases/0.1.0/tunnel -mode embedded -boot_var ERTS_LIB_DIR /usr/local/Cellar/erlang/19.2/lib/erlang/lib -config /Users/quantum/apps/tunnel/_build/default/rel/tunnel/releases/0.1.0/sys.config -args_file /Users/quantum/apps/tunnel/_build/default/rel/tunnel/releases/0.1.0/vm.args -pa -- console
Root: /Users/quantum/apps/tunnel/_build/default/rel/tunnel
/Users/quantum/apps/tunnel/_build/default/rel/tunnel
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:30] [hipe] [kernel-poll:true] [dtrace]


=INFO REPORT==== 16-Feb-2017::15:02:21 ===
    application: tunnel
    exited: {bad_return,
                {{tunnel,start,[normal,[]]},
                 {'EXIT',
                     {undef,
                         [{cowboy_router,compile,
                              [[{'_',
                                    [{"/info",lobby_handler,[]},
                                     {"/join/:name",join_handler,[]},
                                     {"/play/:table_pid/:name/:auth/:team/:action/:x/:y",
                                      play_handler,[]}]}]],
                              []},
                          {tunnel,start,2,
                              [{file,
                                   "/Users/quantum/apps/tunnel/_build/default/lib/tunnel/src/tunnel.erl"},
                               {line,8}]},
                          {application_master,start_it_old,4,
                              [{file,"application_master.erl"},
                               {line,273}]}]}}}}
    type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,tunnel,{bad_return,{{tunnel,start,[normal,[]]},{'EXIT',{undef,[{cowboy_router,compile,[[{'_',[{\"/info\",lobby_handler,[]},{\"/join/:name\",join_handler,[]},{\"/play/:table_pid/:name/:auth/:team/:action/:x/:y\",play_handler,[]}]}]],[]},{tunnel,start,2,[{file,\"/Users/quantum/apps/tunnel/_build/default/lib/tunnel/src/tunnel.erl\"},{line,8}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,tunnel,{bad_return,{{tunnel,start,[normal,[]]},{'EXIT',{undef,[{cowboy_router,compile,[[{'_',[{"/info",lobby_handler,[]},{"/j

Crash dump is being written

Why is this crashing?

解决方案

If this is your first experience with rebar3, I suggest starting with an OTP application, not an OTP release:

rebar3 new app tunnel

and then do not blindly copy over the source files because you risk overwriting the files that have been created for you below src. Have a look at the contents of that directory beforehand.

I also suggest to take the time to read the rebar3 https://www.rebar3.org/docs/basic-usage page.

You will also have to read about what an OTP application is. I know, quite a lot to understand and sometimes confusing. A free source is http://learnyousomeerlang.com/building-applications-with-otp. It is also worthwhile to buy a book about Erlang. There are a few, I suggest https://www.manning.com/books/erlang-and-otp-in-action.

There is also an online course, free, that starts in a few days (20th Feb 2017) https://www.mooc-list.com/course/functional-programming-erlang-futurelearn

这篇关于Rebar3 + Cowboy内核PID终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆