ninenines / erlang.mk

A build tool for Erlang that just works.
https://erlang.mk
ISC License
579 stars 240 forks source link

Problem using qdate on EC2 #509

Closed jhw closed 8 years ago

jhw commented 8 years ago

Hi,

Have a problem with the above. Makefile is as follows


PROJECT = XXX

DEPS = amqp_client cowboy eredis erlcloud erlport jsx qdate syslog uuid yamerl

dep_erlport = git git@github.com:hdima/erlport.git master dep_syslog = git git@github.com:schlagert/syslog.git master dep_uuid = git git@github.com:avtobiff/erlang-uuid.git master

include erlang.mk


Now qdate seems to rely on a couple of other packages - I notice it pulls erlang_localtime and erlware_commons into deps

Everything works fine on my local machine, but when I try on EC2 I get the following qdate errors

Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.855.0> - {qdate,extract_timezone,1,[{file,"src/qdate.erl"},{line,481}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.855.0> - {qdate,to_date,3,[{file,"src/qdate.erl"},{line,234}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.858.0> - {qdate,to_date,3,[{file,"src/qdate.erl"},{line,234}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.855.0> - {qdate,to_date,3,[{file,"src/qdate.erl"},{line,234}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.855.0> - {qdate,extract_timezone,1, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.858.0> - {qdate,extract_timezone,1,[{file,"src/qdate.erl"},{line,481}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.855.0> - [{file,"src/qdate.erl"},{line,481}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.858.0> - {qdate,to_date,3,[{file,"src/qdate.erl"},{line,234}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.858.0> - {qdate,extract_timezone,1, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.858.0> - [{file,"src/qdate.erl"},{line,481}]}, Feb 06 07:51:54 algo-trader-EC2 algo_trader: <0.852.0> - {qdate,extract_timezone,1,[{file,"src/qdate.erl"},{line,481}]},

If I look at line 481 in src/qdate.erl we have the following

AllTimezones = localtime:list_timezones(),

Now localtime seems to be part of the erlang_localtime app; so it seems it's not being found within the release (which I find a bit odd as it's working locally release- wise)

Probably I don't have the Makefile specified quite right; or maybe there's something slightly unusual in the qdate deps structure (esp the mismatch between the erlang_localtime package name and the localtime app name ?)

Anyway all help gratefully received

Thx!

essen commented 8 years ago

Is that the full error? Looks like the stacktrace of an error but it's missing the beginning.

Try adding that localtime dependency to BUILDDEPS (define dep* if needed). It'll override the one in qdate.

jhw commented 8 years ago

Full stack trace for single process below (obfuscated slightly); will try the BUILD_DEPS solution, thx


* Generic server xxx_event_feed_AAA terminating <<"event_router">>,6,600}, undefined, * Reason for termination == {qdate,to_date,3,[{file,"src/qdate.erl"},{line,234}]}, <<"zzz">>,<<"BBB">>,0.03, [{file,"src/parsers/xxx_event_parser.erl"},{line,20}]}, undefined}, [{file,"src/feeds/xxx_event_feed.erl"},{line,23}]}, [{localtime,list_timezones,[],[]}, * Last message in was {timeout,#Ref<0.0.3.1549>,ping} {account,<<"Xxx">>,<<"yyy">>, [{file,"src/parsers/xxx_event_parser.erl"},{line,37}]}, [{file,"src/feeds/xxx_event_feed.erl"},{line,55}]}, {comp,<<"AAA">>,37,1958,204,undefined, [{file,"src/feeds/gen_comp_feed.erl"},{line,47}]}]} * {'module could not be loaded', {xxx_event_parser,handle_event,3, {feed,<<"event">>,<<"comp">>,<<"Xxx">>, {xxx_event_feed,fetch_events,3, []}, {gen_comp_feed,handle_info,2,

Fun,undefined}

     {qdate,extract_timezone,1,[{file,"src/qdate.erl"},{line,481}]},
     {xxx_event_parser,handle_events,2,
     {xxx_event_feed,ping,1,
 pid: <0.851.0>
                      {qdate,extract_timezone,1,
                          [{file,"src/parsers/xxx_event_parser.erl"},

crasher: {line,20}]}, exception exit: {undef, {xxx_event_feed,ping,1, {qdate,to_date,3,[{file,"src/qdate.erl"},{line,234}]}, [{file,"src/feeds/gen_comp_feed.erl"}, {xxx_event_parser,handle_events,2, =CRASH REPORT==== 6-Feb-2016::07:50:15 === messages: [] [{file,"src/feeds/xxx_event_feed.erl"}, registered_name: xxx_event_feed_AAA status: running {line,23}]}, [{file,"src/qdate.erl"},{line,481}]}, neighbours: {line,37}]}, in function gen_server:terminate/7 (gen_server.erl, line 826) dictionary: [{comp_name,<<"AAA">>}] {xxx_event_feed,fetch_events,3, initial call: gen_comp_feed:init/1 stack_size: 27 [{file,"src/feeds/xxx_event_feed.erl"}, [{localtime,list_timezones,[],[]}, {line,47}]}]} {xxx_event_parser,handle_event,3, links: [<0.842.0>] [{file,"src/parsers/xxx_event_parser.erl"}, heap_size: 4185 {line,55}]}, {gen_comp_feed,handle_info,2, ancestors: [feed_sup,algo_trader_sup,<0.113.0>] trap_exit: false reductions: 12738 * Last message in was {timeout,#Ref<0.0.2.2014>,ping} {account,<<"Xxx">>,<<"yyy">>, {comp,<<"AAA">>,37,1958,204,undefined, * {'module could not be loaded', {feed,<<"event">>,<<"comp">>,<<"Xxx">>, {xxx_event_parser,handle_event,3, []}, {xxx_event_feed,fetch_events,3,

Fun,undefined}

     {gen_comp_feed,handle_info,2,

* When Server state == {feed_state, {qdate,extract_timezone,1,[{file,"src/qdate.erl"},{line,481}]}, <<"zzz">>,<<"BBB">>,0.03, {xxx_event_parser,handle_events,2, initial call: gen_comp_feed:init/1 undefined}, {xxx_event_feed,ping,1, [{localtime,list_timezones,[],[]}, * Generic server xxx_event_feed_AAA terminating [{localtime,list_timezones,[],[]}, <<"event_router">>,6,600}, =CRASH REPORT==== 6-Feb-2016::07:51:12 === [{file,"src/parsers/xxx_event_parser.erl"},{line,37}]}, [{file,"src/feeds/xxx_event_feed.erl"},{line,55}]}, undefined, registered_name: xxx_event_feed_AAA [{file,"src/feeds/gen_comp_feed.erl"},{line,47}]}]} \ Reason for termination == {xxx_event_parser,handle_event,3, {qdate,to_date,3,[{file,"src/qdate.erl"},{line,234}]}, pid: <0.851.0> [{file,"src/parsers/xxx_event_parser.erl"},{line,20}]}, [{file,"src/parsers/xxx_event_parser.erl"}, [{file,"src/feeds/xxx_event_feed.erl"},{line,23}]}, [{file,"src/qdate.erl"},{line,481}]}, {line,55}]}, {qdate,extract_timezone,1, {line,37}]}, {gen_comp_feed,handle_info,2, crasher: ancestors: [feed_sup,algo_trader_sup,<0.113.0>] trap_exit: false exception exit: {undef, [{file,"src/parsers/xxx_event_parser.erl"}, reductions: 12746 {line,47}]}]} {line,20}]}, links: [<0.842.0>] {xxx_event_feed,ping,1, heap_size: 4185 [{file,"src/feeds/gen_comp_feed.erl"}, {xxx_event_parser,handle_events,2, messages: [] status: running [{file,"src/feeds/xxx_event_feed.erl"}, neighbours: {line,23}]}, in function gen_server:terminate/7 (gen_server.erl, line 826) dictionary: [{comp_name,<<"AAA">>}] stack_size: 27

jhw commented 8 years ago

Seems like I need to declare erlang_localtime in DEPS rather than BUILD_DEPS to get it included in the release (along with dep_erlang_localtime); does this sound likely/sensible/problematic ? Thx

essen commented 8 years ago

Right. Shouldn't be a problem for this particular application.

jhw commented 8 years ago

Thank you