synrc / mad

⚡ MAD: Managing Application Dependencies LING/UNIX
https://mad.n2o.dev
Other
173 stars 53 forks source link

can compile with mad, but when loading the new n2o_sample, got an error from http cowboy #17

Closed henry-hz closed 9 years ago

henry-hz commented 9 years ago

=ERROR REPORT==== 2-Nov-2014::15:56:29 === Error in process <0.95.0> on node 'sample@127.0.0.1' with exit value: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.935>,ranch_tcp,keepalive,<0.95.0>,<<3 bytes>>,'HTTP/1.1',{{127,0,0,1},64817},<<9 bytes>>,un defined,8000,<<1 byte>>,undefined,<<0 bytes>>,...

=ERROR REPORT==== 2-Nov-2014::15:56:29 === Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.95.0> exit with reason: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.935>,ranchtcp,keepalive,<0.95.0>,<<"GET">>,'H TTP/1.1',{{127,0,0,1},64817},<<"localhost">>,undefined,8000,<<"/">>,undefined,<<>>,[],[],[{<<"host">>,<<"localhost:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/_;q=0.8">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10 _10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"__ngDebug=true; XSRF-TOKEN=AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user% 22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22AGDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V67skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2dc62e0f7bb3205950140260092a24b46056f283df1937e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh 4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g55fca0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2*Vw7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}],[{<<"content-length">>,0},{<<"expect">>,undefined},{<<"content-length">>,0},{<<"transf er-encoding">>,[<<"identity">>]},{<<"connection">>,[<<"keep-alive">>]}],undefined,[],done,undefined,<<>>,false,waiting,[],<<>>,undefined},index,[],{{<<"sMMRqoBML/IlKwKIltjAzA==">>,<<"auth">>},<<"/">>,{1414,936589,583645},{86400,{{2014,11,3},{13,56,29}}},new},[],[],[]}],[]},{wf_context,'-fold/3-fun-0-',3,[{file,"/User s/henry/code/temp/test-mad/test/deps/n2o/src/wf_context.erl"},{line,31}]},{lists,foldl,3,[{file,"lists.erl"},{line,1261}]},{n2o_document,run,1,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/endpoints/n2o_document.erl"},{line,13}]},{n2o_cowboy,handle,2,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/s rc/endpoints/cowboy/n2o_cowboy.erl"},{line,13}]},{cowboy_handler,handler_handle,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_handler.erl"},{line,118}]},{cowboy_protocol,execute,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]},{req,[{socket,#P ort<0.935>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.95.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},64817}},{host,<<"localhost">>},{host_info,undefined},{port,8000},{path,<<"/">>},{path_info,undefined},{qs,<<>>},{qs_vals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"localhost:8000">

},{<<"connection">>,<<"keep-alive">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,defla te,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"__ngDebug=true; XSRF-TOKEN=AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user%22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22AGDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V6 7skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2dc62e0f7bb3205950140260092a24b46056f283df1937e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g55fca0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2*V w7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}]},{p_headers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,undefined},{buffer,<<>>},{resp_compress,false},{resp_state,waiting},{respheaders,[]},{resp body,<<>>},{onresponse,undefined}]},{state,{state,undefined,undefined}}],[{cowboy_protocol,execute,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]}

=ERROR REPORT==== 2-Nov-2014::15:56:30 === Error in process <0.97.0> on node 'sample@127.0.0.1' with exit value: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.1167>,ranch_tcp,keepalive,<0.97.0>,<<3 bytes>>,'HTTP/1.1',{{127,0,0,1},64820},<<9 bytes>>,u ndefined,8000,<<12 bytes>>,undefined,<<0 bytes>>,...

=ERROR REPORT==== 2-Nov-2014::15:56:30 === Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.97.0> exit with reason: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.1167>,ranchtcp,keepalive,<0.97.0>,<<"GET">>,' HTTP/1.1',{{127,0,0,1},64820},<<"localhost">>,undefined,8000,<<"/favicon.ico">>,undefined,<<>>,[],[],[{<<"host">>,<<"localhost:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"accept">>,<<"/_">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2 125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"ngDebug=true; XSRF-TOKEN=AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user%22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22A GDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V67skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2dc62e0f7bb3205950140260092a24b46056f283df1937e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g55fc a0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2_Vw7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}],[{<<"content-length">>,0},{<<"expect">>,undefined},{<<"content-length">>,0},{<<"transfer-encoding">>,[<<"identity">>]},{<<"connection">>,[<<"keep -alive">>]}],undefined,[],done,undefined,<<>>,false,waiting,[],<<>>,undefined},index,[],{{<<"SL6iLWZN0eDCFpDXC+qRfA==">>,<<"auth">>},<<"/">>,{1414,936590,81838},{86400,{{2014,11,3},{13,56,30}}},new},[],[],[]}],[]},{wf_context,'-fold/3-fun-0-',3,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/wf_context.erl" },{line,31}]},{lists,foldl,3,[{file,"lists.erl"},{line,1261}]},{n2o_document,run,1,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/endpoints/n2o_document.erl"},{line,13}]},{n2o_cowboy,handle,2,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/endpoints/cowboy/n2o_cowboy.erl"},{line,13}]},{cowboy_han dler,handler_handle,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_handler.erl"},{line,118}]},{cowboy_protocol,execute,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]},{req,[{socket,#Port<0.1167>},{transport,ranch_tcp},{connection,keepalive},{p id,<0.97.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},64820}},{host,<<"localhost">>},{host_info,undefined},{port,8000},{path,<<"/favicon.ico">>},{path_info,undefined},{qs,<<>>},{qsvals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"localhost:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"accep t">>,<<"/_">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"ngDebug=true; XSRF-TOKEN= AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user%22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22AGDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V67skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2__dc62e0f7bb3205950140260092a24b46056f283df19 37e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g__55fca0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2_Vw7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}]},{p_head ers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,undefined},{buffer,<<>>},{resp_compress,false},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]},{state,{state,undefined,undefined}}],[{cowboy_protocol,execute,4,[{file,"/Users/hen ry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]}

5HT commented 9 years ago

You don't need span with ERROR_REPORTs

Seems like you haven't build some BEAM files {reason,undef}.

Show in n2o/samples me your bash-3.2$ ls {apps,deps}/*/ebin | wc -l 290

henry-hz commented 9 years ago

thought it was the new priv search of cowboy 0.9, you are right, routes.erl is not compiling, i thought it's a warning, but it's an error... the output could be with capital letters... screen shot 2014-11-03 at 3 19 36 pm

about the other tools, it's okay, i do prefer to run observer, etc... specially on dev mode, and also in _rel

5HT commented 9 years ago

Be careful about reporting on overdue code. There is no n2o_sample in n2o sample. Now it is called review application.

5HT commented 9 years ago

Just use the appropriate dependency version in your code.

henry-hz commented 9 years ago

it's ok, I will take care on that, the issue is on "mad app sample", in the formula below, it comes with 0.9 and should be okay.

mad app sample

cd sample

mad deps compile plan bundle web_app

5HT commented 9 years ago

oh that is really my fail.

henry-hz commented 9 years ago

Hi Maxim, we are almost there, mad is fantastic, the "mad repl" and "mad rel" are running well, but "mad bundle my_app" still needs some fix: [henry@apple geo-message-sim ]$ mad bundle web Tool Params: ["web"] [henry@apple geo-message-sim ]$ ls apps deps rebar.config relx.config sys.config web [henry@apple geo-message-sim ]$ ./web escript: exception error: undefined function web:main/1 in function escript:run/2 (escript.erl, line 752) in call from escript:start/1 (escript.erl, line 276) in call from init:start_it/1 in call from init:start_em/1

5HT commented 9 years ago

you should always specify the name of module where function main/1 is defined. rename wep_app.erl to web.erl would fix it :-) I know this is not was expected I will try to fix it in more convenient way.