Error starting in Production mode on Test machines

49 views
Skip to first unread message

Graeme Defty

unread,
Jun 9, 2014, 12:18:09 PM6/9/14
to chica...@googlegroups.com
I have a rather puzzling issue.

On my production server I can start my application in production or dev mode, but on the dev machine it will only start in dev mode. If I try and start it in prod mode I get the following in the log:

- - - - -
2014-06-09 23:07:09.512 [info] <0.6.0> Application lager started on node egolf@testhost
2014-06-09 23:07:09.518 [info] <0.59.0> Starting Boss in production mode....

2014-06-09 23:07:09.693 [info] <0.6.0> Application mnesia started on node egolf@testhost
2014-06-09 23:07:09.712 [info] <0.59.0> Starting master services on egolf@testhost

2014-06-09 23:07:09.717 [info] <0.6.0> Application tinymq started on node egolf@testhost
2014-06-09 23:07:09.728 [info] <0.59.0> SSL:[]

2014-06-09 23:07:09.734 [info] <0.6.0> Application boss started on node egolf@testhost
2014-06-09 23:07:09.739 [error] <0.268.0> CRASH REPORT Process <0.268.0> with 0 neighbours exited with reason: no function clause matching filename:join({error,bad_name}, "egolf.routes") line 406 in gen_server:init_it/6 line 328
2014-06-09 23:07:09.830 [error] <0.267.0> Supervisor boss_router_sup had child router_controller started with boss_router_controller:start_link([{application,egolf},{controllers,[]}]) at undefined exit with reason no function clause matching filename:join({error,bad_name}, "egolf.routes") line 406 in context start_error
2014-06-09 23:07:09.919 [error] <0.58.0> Supervisor boss_sup had child boss_web_controller started with boss_web_controller:start_link([{ip,"0.0.0.0"},{port,8001}]) at <0.59.0> exit with reason shutdown in context child_terminated
2014-06-09 23:07:10.008 [error] <0.214.0> Supervisor poolboy_sup had child boss_session_controller started with boss_session_controller:start_link([{size,20},{max_overflow,40},{adapter,boss_session_adapter_mock},{session_exp_time,525600},{session_key,...}]) at undefined exit with reason shutdown in context shutdown_error
- - - - -

Then the app tries to restart with the same result, eventually giving up.

This app has been around a LONG time (>3 years) and to upgrade to new versions of CB I just point my boss.config file to the directory where the new version lives (at elast with the more recent versions of CB. I am conscious of the fact that this is not upgrading  the various pieces that live in MY directory (rebar et al) and I have a suspicion that this could be part of the issue, but replacing those with a new set from a newly generated app does no good. Also, there is still the fact that this runs fine on the production server.

I have compared the directory structures between dev and prod several times before but to no avail.

Any thoughts anyone?

Thanks

g


chan sisowath

unread,
Jun 10, 2014, 2:11:46 AM6/10/14
to chica...@googlegroups.com
hi,
maybe related to the new rebar version ?


--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/CAKF5fiBb3868HzuJ1RWNb2Bd150tEd20qHQ-SB_GfiqnaiRkvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Graeme Defty

unread,
Jun 10, 2014, 11:39:57 AM6/10/14
to chica...@googlegroups.com
Hi Chan,

It could be, but it seems to happen with the original version of rebar (and the config) and also if I replace them with the latest.

Also, recall that I do not have this issue in the production server, only dev.  :-(

But thank you anyway for your thoughts,

g




Jesse Gumm

unread,
Jun 10, 2014, 9:07:46 PM6/10/14
to chica...@googlegroups.com
Hi Graeme,

My guess is that there's something with the priv_dir. the
filename:join({error, bad_name}, "egolf.routes") indicates that
there's some reason that the priv_dir is not being found.

priv_dir is a fragile beast because the containing directory of the
app needs to be exactly the same as the app itself. So if your app is
called myapp, but the directory is called "myapp.com" (something I
tend to do), code:priv_dir(myapp) will fail and return {error,
bad_name}.

It looks like the culprit causing this crash is likely here:
https://github.com/ChicagoBoss/ChicagoBoss/blob/master/src/boss/boss_files.erl#L177

Which seems to be getting {error, bad_name} from this file:
https://github.com/ChicagoBoss/ChicagoBoss/blob/master/src/boss/boss_files.erl#L54

Hopefully this will point you in the right direction.

-Jesse
> https://groups.google.com/d/msgid/chicagoboss/CAKF5fiBddu1Jd30x9ts2SSQ7cp8JH2gwa3Wa7%2Be8daQ2WZ3qnQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Graeme Defty

unread,
Jun 11, 2014, 8:26:32 PM6/11/14
to chica...@googlegroups.com
Jesse your guess was absolutely spot on! I can't thank you enough - this has been bugging me for a L O o o o n g  time.

My issue now is what to do about it. My MO is to work on multiple threads of development at once, each in a separate directory, each with a different name.

Since the name of the application directory is in the boss.config file I have to believe that it can be picked up from there so that the name of the app and the name of the application directory can be un-linked.

I will take a look and see if I can find a suitable mod.

Thanks again

graeme





Jesse Gumm

unread,
Jun 11, 2014, 8:53:28 PM6/11/14
to chica...@googlegroups.com
There are a few places in the CB code that try to account for the lack
of an "Erlang-proper" priv_dir (something that bit me a few months ago
as well), but mysteriously, the cause of this particular error with
trying to load the routes file is eluding me.
> https://groups.google.com/d/msgid/chicagoboss/CAKF5fiAoL6aNFJXzPE%2BUhjG8XPJFMgqPdsbCX%3DOxPCsABsjQ5g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages