[erlang-questions] noproc gen_server cowboy

Ahmad Baitalmal ahmad@REDACTED
Tue May 13 01:10:22 CEST 2014


Thanks Loïc,

It now runs and I can connect. I thought I read somewhere that relx
automatically started the related apps. I guess it doesn't always.

There is something wrong still, I'm getting this error for all files in the
browser.
net::ERR_CONTENT_LENGTH_MISMATCH

I checked the headers and cowboy is reporting the header "*Content-Length:*
458453399216374" for a file that is only 104K.

Could this be a problem with cowboy running on a little-endian machine
(mipsel)?

Thanks,


On Sun, May 11, 2014 at 10:32 PM, Loïc Hoguin <essen@REDACTED> wrote:

> 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
>



-- 
Ahmad
___________
650.539.9395

Sent from my iPhone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140512/b16f9286/attachment.htm>


More information about the erlang-questions mailing list