<div dir="ltr"><div>Hi, </div><div>Im going crazy trying to solve this. </div><div><br></div><div>Works on my Mac, but when I copy to a linux router (OpenWRT, R17, cowboy 0.9.0) it give me the error below.</div><div>Is this a cowboy or erlang gen_server issue?</div>
<div>I tried http, same result. So it's not an ssl issue. I can't tell what the error is...</div><div><br></div><div><br></div><div><font face="courier new, monospace">% --------------------- This is my app code that starts cowboy</font></div>
<div><font face="courier new, monospace">-module(onion_app).</font></div><div><font face="courier new, monospace">-behavior(application).</font></div><div><font face="courier new, monospace">-export([start/2]).</font></div>
<div><font face="courier new, monospace">-export([stop/0]).</font></div><div><font face="courier new, monospace">-export([stop/1]).</font></div><div><font face="courier new, monospace">-include("common.hrl").</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">start(_Type, _Args) -></font></div><div><font face="courier new, monospace"> application:start(cowboy),</font></div><div>
<font face="courier new, monospace"> Dispatch = cowboy_router:compile([</font></div><div><font face="courier new, monospace"> {'_', [</font></div><div><font face="courier new, monospace"> {"/", cowboy_static, {priv_file, onion ,"index.html"}},</font></div>
<div><font face="courier new, monospace"> {"/[...]", cowboy_static, {priv_dir, onion , ""}}</font></div><div><font face="courier new, monospace"> ]}</font></div><div><font face="courier new, monospace"> ]),</font></div>
<div><font face="courier new, monospace"> RootDir = code:root_dir(),</font></div><div><font face="courier new, monospace"> Port = 443,</font></div><div><font face="courier new, monospace"> cowboy:start_https(my_https_listener, 10,[</font></div>
<div><font face="courier new, monospace"> {port, Port},</font></div><div><font face="courier new, monospace"> {certfile, RootDir ++ "/ssl/onion.crt"},</font></div><div><font face="courier new, monospace"> {keyfile, RootDir ++ "/ssl/onion.key"}</font></div>
<div><font face="courier new, monospace"> ],</font></div><div><font face="courier new, monospace"> [</font></div><div><font face="courier new, monospace"> {env, [{dispatch, Dispatch}]}</font></div><div><font face="courier new, monospace"> ]</font></div>
<div><font face="courier new, monospace"> )</font></div><div><font face="courier new, monospace"> onion_sup:start_link().</font></div><div><font face="courier new, monospace">stop(_State) -></font></div><div><font face="courier new, monospace"> ok.</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">% --------------------- I'm getting this error :(</font></div>
<div><font face="courier new, monospace">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</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">=INFO REPORT==== 11-May-2014::03:45:55 ===</font></div><div><font face="courier new, monospace"> application: onion</font></div>
<div><font face="courier new, monospace"> exited: {bad_return,</font></div><div><font face="courier new, monospace"> {{onion_app,start,[normal,[]]},</font></div><div><font face="courier new, monospace"> {'EXIT',</font></div>
<div><font face="courier new, monospace"> {noproc,</font></div><div><font face="courier new, monospace"> {gen_server,call,</font></div><div><font face="courier new, monospace"> [ranch_sup,</font></div>
<div><font face="courier new, monospace"> {start_child,</font></div><div><font face="courier new, monospace"> {{ranch_listener_sup,my_https_listener},</font></div><div><font face="courier new, monospace"> {ranch_listener_sup,start_link,</font></div>
<div><font face="courier new, monospace"> [my_https_listener,10,ranch_ssl,</font></div><div><font face="courier new, monospace"> [{port,443},</font></div><div><font face="courier new, monospace"> {certfile,"/mnt/sda1/onion/ssl/onion.crt"},</font></div>
<div><font face="courier new, monospace"> {keyfile,"/mnt/sda1/onion/ssl/onion.key"}],</font></div><div><font face="courier new, monospace"> cowboy_protocol,</font></div>
<div><font face="courier new, monospace"> [{env,</font></div><div><font face="courier new, monospace"> [{dispatch,</font></div><div><font face="courier new, monospace"> [{'_',[],</font></div>
<div><font face="courier new, monospace"> [{[],[],cowboy_static,</font></div><div><font face="courier new, monospace"> {priv_file,onion,"index.html"}},</font></div>
<div><font face="courier new, monospace"> {[<<"tomato">>,'...'],[],tomato,[tomato]},</font></div><div><font face="courier new, monospace"> {['...'],</font></div>
<div><font face="courier new, monospace"> [],cowboy_static,</font></div><div><font face="courier new, monospace"> {priv_dir,onion,[]}}]}]}]}]]},</font></div><div><font face="courier new, monospace"> permanent,5000,supervisor,</font></div>
<div><font face="courier new, monospace"> [ranch_listener_sup]}},</font></div><div><font face="courier new, monospace"> infinity]}}}}}</font></div><div><font face="courier new, monospace"> type: permanent</font></div>
<div><font face="courier new, monospace">Eshell V6.0 (abort with ^G)</font></div><div><font face="courier new, monospace">(onion@ROC)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]}}}}}}"}</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">Thanks,</font></div><div><br></div>-- <br><div dir="ltr"><div>Ahmad</div>
<div>___________</div><div>650.539.9395</div><div><br></div>Sent from my iPhon</div>
</div>