[erlang-questions] noproc gen_server cowboy

Loïc Hoguin essen@REDACTED
Mon May 12 07:32:50 CEST 2014


You didn't start the cowboy dependencies, I'm not sure how it could have 
worked on your Mac. Cowboy requires crypto, cowlib and ranch to be 
started to run. Try application:ensure_all_started(cowboy) instead and 
it'll do that for you.

On 05/12/2014 02:20 AM, Ahmad Baitalmal wrote:
> Hi,
> Im going crazy trying to solve this.
>
> Works on my Mac, but when I copy to a linux router (OpenWRT, R17, cowboy
> 0.9.0) it give me the error below.
> Is this a cowboy or erlang gen_server issue?
> I tried http, same result. So it's not an ssl issue. I can't tell what
> the error is...
>
>
> % --------------------- This is my app code that starts cowboy
> -module(onion_app).
> -behavior(application).
> -export([start/2]).
> -export([stop/0]).
> -export([stop/1]).
> -include("common.hrl").
>
> start(_Type, _Args) ->
>    application:start(cowboy),
>    Dispatch = cowboy_router:compile([
>      {'_', [
>        {"/",       cowboy_static,   {priv_file, onion ,"index.html"}},
>        {"/[...]",  cowboy_static,   {priv_dir, onion , ""}}
>      ]}
>    ]),
>    RootDir = code:root_dir(),
>    Port = 443,
>    cowboy:start_https(my_https_listener, 10,[
>        {port, Port},
>        {certfile, RootDir ++ "/ssl/onion.crt"},
>        {keyfile, RootDir ++ "/ssl/onion.key"}
>      ],
>      [
>        {env, [{dispatch, Dispatch}]}
>      ]
>    )
>    onion_sup:start_link().
> stop(_State) ->
>    ok.
>
>
> % --------------------- I'm getting this error :(
> Exec: /mnt/sda1/onion/erts-6.0/bin/erlexec -boot
> /mnt/sda1/onion/releases/1/onion -env ERL_LIBS
> /mnt/sda1/onion/releases/1/lib -config
> /mnt/sda1/onion/releases/1/sys.config -args_file
> /mnt/sda1/onion/releases/1/vm.args -- console
>
> =INFO REPORT==== 11-May-2014::03:45:55 ===
>      application: onion
>      exited: {bad_return,
>               {{onion_app,start,[normal,[]]},
>                {'EXIT',
>                 {noproc,
>                  {gen_server,call,
>                   [ranch_sup,
>                    {start_child,
>                     {{ranch_listener_sup,my_https_listener},
>                      {ranch_listener_sup,start_link,
>                       [my_https_listener,10,ranch_ssl,
>                        [{port,443},
>                         {certfile,"/mnt/sda1/onion/ssl/onion.crt"},
>                         {keyfile,"/mnt/sda1/onion/ssl/onion.key"}],
>                        cowboy_protocol,
>                        [{env,
>                          [{dispatch,
>                            [{'_',[],
>                              [{[],[],cowboy_static,
>                                {priv_file,onion,"index.html"}},
>                               {[<<"tomato">>,'...'],[],tomato,[tomato]},
>                               {['...'],
>                                [],cowboy_static,
>                                {priv_dir,onion,[]}}]}]}]}]]},
>                      permanent,5000,supervisor,
>                      [ranch_listener_sup]}},
>                    infinity]}}}}}
>      type: permanent
> Eshell V6.0  (abort with ^G)
> (onion@REDACTED)1> {"Kernel pid
> terminated",application_controller,"{application_start_failure,onion,{bad_return,{{onion_app,start,[normal,[]]},{'EXIT',{noproc,{gen_server,call,[ranch_sup,{start_child,{{ranch_listener_sup,my_https_listener},{ranch_listener_sup,start_link,[my_https_listener,10,ranch_ssl,[{port,443},{certfile,\"/mnt/sda1/onion/ssl/onion.crt\"},{keyfile,\"/mnt/sda1/onion/ssl/onion.key\"}],cowboy_protocol,[{env,[{dispatch,[{'_',[],[{[],[],cowboy_static,{priv_file,onion,\"index.html\"}},{['...'],[],cowboy_static,{priv_dir,onion,[]}}]}]}]}]]},permanent,5000,supervisor,[ranch_listener_sup]}},infinity]}}}}}}"}
>
>
> Thanks,
>
> --
> Ahmad
> ___________
> 650.539.9395
>
> Sent from my iPhon
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-questions mailing list