Re: [chicagoboss] Routes not found in production mode

375 views
Skip to first unread message

Alexander Sánchez

unread,
May 3, 2013, 10:59:55 AM5/3/13
to chica...@googlegroups.com

Hi, are you already compile your application?

El 03/05/2013 08:35, "Derek Chiang" <derekc...@gmail.com> escribió:
I'm not sure why this happens, but when I try to deploy my application on a remote server and start in production mode ("./init.sh start"), the routes file is not found.  However if I start it in development mode, then everything is good.

It's worth noting that both development mode and production mode run normally on my local machine.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Derek Chiang

unread,
May 3, 2013, 3:53:13 PM5/3/13
to chica...@googlegroups.com
Yeah I did "./rebar compile"

Derek Chiang

unread,
May 5, 2013, 3:28:48 PM5/5/13
to chica...@googlegroups.com
Can someone please look into this?  I need to get this working in production mode...

Evan Miller

unread,
May 5, 2013, 6:33:40 PM5/5/13
to ChicagoBoss
Is your "path" correct for your application config?

{myapp,
   {path, "../myapp"}
   ...

Evan


--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Derek Chiang

unread,
May 5, 2013, 10:26:21 PM5/5/13
to chica...@googlegroups.com
Hello Evan,

Were you talking about the app file under ebin/?  If so then it didn't contain a "path" tuple.  I added one but it still doesn't work.  When I go to the homepage it just says:

No routes matched the requested URL. Additionally, no handler was found for processing 404 errors. You probably want to modify ../idgaf/priv/idgaf.routes to prevent errors like this one.

idgaf is my application's name.

Evan Miller

unread,
May 5, 2013, 10:29:17 PM5/5/13
to ChicagoBoss
No, I mean in your boss.config.

Derek Chiang

unread,
May 5, 2013, 10:34:30 PM5/5/13
to chica...@googlegroups.com
Oh I see what you mean.  So the problem was I renamed my folder lol.  Thank you Evan!  I enjoyed reading your latest post on developing software for Mac.

Evan Miller

unread,
May 5, 2013, 10:52:53 PM5/5/13
to ChicagoBoss
Glad that resolved it -- there should probably be better diagnostic info about this, since renaming a folder is a pretty common situation.

And glad you liked the post!

Evan

Graeme Defty

unread,
May 5, 2013, 11:14:31 PM5/5/13
to chica...@googlegroups.com

It still seems to me that the underlying problem is that our config file contains an entry that names the directory it is sitting in!  That has always seemed a bit goofy to me.  Cant the code that reads the config file figure that out for itself?

I do this copy-to-a-new-directory all the time, and now I ALMOST always remember to change boss.config but it still trips me up now and then.

Is this an underlying Erlang VM requirement or something in CB (at the risk of appearing too lazy to do the research myself)

Or is there really a use case where the config file sits in a different directory from the app?

g


Evan Miller

unread,
May 6, 2013, 12:00:17 AM5/6/13
to ChicagoBoss
Yeah it's some weird requirement with code:priv_dir() if I recall correctly. I don't like it either but Erlang can't find the priv directory unless the application directory is explicitly declared (which is why it uses the relative path "../myapp").

Evan

Graeme Defty

unread,
May 6, 2013, 3:40:03 AM5/6/13
to chica...@googlegroups.com

And I am sure that i previously tried using "." and it is not happy about that.

But the wierdest thing is, if it does not know where it is, how can relative path work???  :-o

Oh Well . . . "..these things are sent to try us.. "

g

orl...@gamblingq.net

unread,
Feb 8, 2014, 3:39:30 PM2/8/14
to chica...@googlegroups.com
i have the same problem, but, the path is correctly.... I don't know what to do....
can anyone help me?

Peter Yuen

unread,
Mar 25, 2014, 6:36:50 AM3/25/14
to chica...@googlegroups.com
i have the same problem, but, the path is correctly.... I don't know what to do.

please help

Jesse Gumm

unread,
Mar 28, 2014, 4:22:01 PM3/28/14
to chica...@googlegroups.com
To be clear, before running "./init.sh start", are you running "./rebar compile"? It may be that your modules are not yet compiled.  While dev mode automatically compiles and loads the .erl files, production mode must be compiled ahead of time, and have the .beam files placed into the ebin directory.

Have you done this step?

-Jesse


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



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

emacstheviking

unread,
Jan 11, 2015, 5:17:22 AM1/11/15
to chica...@googlegroups.com
I am still stuck with this same problem. To be sure, I did this:

rm -fr deps
./rebar g-d
./rebar compile
./init.sh


...and it *still* insists it has issues finding the routes...

terminated with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 172

If I type this into the browser address bar:

    http://localhost:31415/web/index

I get this  message back:

No routes matched the requested URL. Additionally, no handler was found for processing 404 errors. You probably want to modify ../smsengine/priv/smsengine.routes to prevent errors like this one.

Which is a nonsense of course because the route is configured, in fact here is the default "/" route from my routes file that it apparently cannot use!

% Front page
{"/", [{controller, "web"}, {action, "index"}]}.

In "dev" mode both work as expected... I am goig to pur some "printf" statements in so that I can at least see what comes out in dev mode and deploy mode, it might shed some light on the problem. I will post my findings...


On 9 January 2015 at 14:58, ENTR0PY <egos...@gmail.com> wrote:
I tried this as wll , i compiled the project before and nada, ebin had all the beams

Graeme Defty

unread,
Jan 11, 2015, 5:31:00 AM1/11/15
to chica...@googlegroups.com
I seem to recall seeing this before.

Is your boss.config specifying your application directory correctly?

g

emacstheviking

unread,
Jan 11, 2015, 5:44:22 AM1/11/15
to chica...@googlegroups.com
So... boss_router_controller.erl:171 correctly displays both parts of my route "web" and "index" so it knows at this point what it wants to find a handler for, that's a good start.

I put in some extra lager calls and see this:

2015-01-11 10:25:20.332 [info] <0.273.0>@boss_router_controller:route:173 *!!* State.controllers: smsengine_inbound_controller

2015-01-11 10:25:20.332 [info] <0.273.0>@boss_router_controller:route:174 *!!* web_controller: undefined

Interesting... I have *two* controllers, "smsengine" and "web"...have I been silly he says? No, I thought I had named then wrong but they are:
    * smsengine_inbound_controller.erl
    * smsengine_web_controller.erl

Phew.... the bottom line though is that it has only the one controller listed and hence the failure to find a handler. Why should that be the case? Out of the two controllers it is the one actually listed in the routes file that is failing! If I put the URL for the SMS route in the browser

...LATER...

I modified my routes file to be this:

{"/", [{controller, "web"}, {action, "index"}]}.
{"/web/index", [{controller, "web"}, {action, "index"}]}.
{"/inbound/send", [{controller, "inbound"}, {action, "send"}]}.

i.e. 100% explicit and it still fails to load the "/" route or http://localhost:31415/web/index, the latter provides this in the log window...

2015-01-11 10:35:28.683 [info] <0.274.0>@boss_router_controller:route:171 Boss Route smsengine "web" "index" []

2015-01-11 10:35:28.683 [info] <0.274.0>@boss_router_controller:route:173 *!!* State.controllers: smsengine_inbound_controller

2015-01-11 10:35:28.683 [info] <0.274.0>@boss_router_controller:route:174 *!!* web_controller: undefined

2015-01-11 10:35:28.683 [error] <0.274.0> gen_server <0.274.0> terminated with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 176

i.e. no change at all... so why does it only have the one controller in the list it matches against at this point in deployment mode I wonder?

Posted this much. Raising another post...

chan sisowath

unread,
Jan 12, 2015, 5:36:16 AM1/12/15
to chica...@googlegroups.com

hi,

in ligne  https://github.com/ChicagoBoss/ChicagoBoss/blob/master/src/boss/boss_router_controller.erl#L172

            ControllerModule = list_to_atom(boss_files:web_controller(App, C, State#state.controllers)),


can you print the value App, C and State#state.controllers,

add this ligne before 172

lager:info("App ~p",[App]),
lager:info("C ~p",[C]),
lager:info("Controllers ~p",[State#state.controllers]),

could be interesting to see in your case what s going on.

cheers.






emacstheviking

unread,
Jan 12, 2015, 9:54:19 AM1/12/15
to chica...@googlegroups.com
Chan,

I did this already but removed it...I am in work right now but I wil do it and post it back tonight. IIRC it showed all controllers in dev mode but only one in deploy mode. We will see...


Emacs the Viking

unread,
Jan 12, 2015, 10:14:04 AM1/12/15
to chica...@googlegroups.com
Here is the output from the result of the logging code you gave:
 
DEV MODE (./init-dev.sh)

15:10:05.848 [info] Loading routes from "/Users/seancharles/Documents/bitbucket/smsengine/priv/smsengine.routes" ....
15:10:05.921 [info] Boss Route smsengine "web" "index" []
15:10:05.921 [info] ???>>> App smsengine
15:10:05.921 [info] ???>>> C "web"
15:10:05.921 [info] ???>>> Controllers ["smsengine_inbound_controller","smsengine_web_controller"]
15:10:06.002 [notice] Request Method 'GET'
15:10:06.002 [notice] Tokens []
15:10:06.093 [info] GET / [smsengine] 200 0ms
15:10:06.493 [notice] ApplicationForPath smsengine


DEPLY MOD (./init.sh start)

2015-01-12 15:11:55.850 [notice] <0.268.0>@boss_web_controller_handle_request:handle_request:23 ApplicationForPath smsengine
2015-01-12 15:11:55.853 [info] <0.255.0>@boss_router_controller:route:171 Boss Route smsengine "web" "index" []
2015-01-12 15:11:55.853 [info] <0.255.0>@boss_router_controller:route:172 ???>>> App smsengine
2015-01-12 15:11:55.853 [info] <0.255.0>@boss_router_controller:route:173 ???>>> C "web"
2015-01-12 15:11:55.853 [info] <0.255.0>@boss_router_controller:route:174 ???>>> Controllers []
2015-01-12 15:11:55.869 [warning] <0.6.0> lager_error_logger_h dropped 30 messages in the last second that exceeded the limit of 50 messages/sec
2015-01-12 15:11:55.869 [error] <0.255.0> gen_server <0.255.0> terminated with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 176
2015-01-12 15:11:55.869 [error] <0.255.0> CRASH REPORT Process <0.255.0> with 0 neighbours exited with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 176 in gen_server:terminate/7 line 804
2015-01-12 15:11:55.869 [error] <0.268.0>@boss_web_controller_handle_request:handle_request:30 Unhandled Error: exit:{{badarg,[{erlang,list_to_atom,[undefined],[]},{boss_router_controller,route,2,[{file,"src/boss/boss_router_controller.erl"},{line,176}]},{boss_router_controller,handle_call,3,[{file,"src/boss/boss_router_controller.erl"},{line,64}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,639}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]},{gen_server,call,[<0.255.0>,{route,"/"}]}}. Stacktrace: [{gen_server,call,2,[{file,"gen_server.erl"},{line,182}]},{boss_web_controller_handle_request,process_dynamic_request,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,237}]},{boss_web_controller_handle_request,process_request,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,232}]},{boss_web_controller_handle_request,set_timer,7,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,148}]},{boss_web_controller_handle_request,build_dynamic_response,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,122}]},{boss_web_controller_handle_request,handle_request,3,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,26}]},{mochicow_upgrade,upgrade,4,[{file,"src/mochicow_upgrade.erl"},{line,72}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,529}]}]
2015-01-12 15:11:55.870 [error] <0.254.0> Supervisor {<0.254.0>,boss_router_sup} had child router_controller started with boss_router_controller:start_link([{application,smsengine},{controllers,[]}]) at <0.255.0> exit with reason bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 176 in context child_terminated
2015-01-12 15:11:55.871 [info] <0.269.0> Loading routes from "../smsengine/priv/smsengine.routes" ....

chan sisowath

unread,
Jan 12, 2015, 11:24:00 AM1/12/15
to chica...@googlegroups.com
in your boss.config can you put this and try again ?

{smsengine, [

   ...
   {controller_modules,
           [
            smsengine_inbound_controller,
            smsengine_web_controller
           ]},

  ...

}

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

Emacs the Viking

unread,
Jan 12, 2015, 12:29:41 PM1/12/15
to chica...@googlegroups.com
Did, that, made no difference whatsoever, the list of controller still appears to be empty, here is the console output:

2015-01-12 17:28:40.219 [notice] <0.267.0>@boss_web_controller_handle_request:handle_request:23 ApplicationForPath smsengine
2015-01-12 17:28:40.222 [info] <0.255.0>@boss_router_controller:route:171 Boss Route smsengine "web" "index" []
2015-01-12 17:28:40.222 [info] <0.255.0>@boss_router_controller:route:172 ???>>> App smsengine
2015-01-12 17:28:40.222 [info] <0.255.0>@boss_router_controller:route:173 ???>>> C "web"
2015-01-12 17:28:40.222 [info] <0.255.0>@boss_router_controller:route:174 ???>>> Controllers []
2015-01-12 17:28:40.237 [warning] <0.6.0> lager_error_logger_h dropped 30 messages in the last second that exceeded the limit of 50 messages/sec
2015-01-12 17:28:40.237 [error] <0.255.0> gen_server <0.255.0> terminated with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 176
2015-01-12 17:28:40.237 [error] <0.255.0> CRASH REPORT Process <0.255.0> with 0 neighbours exited with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 176 in gen_server:terminate/7 line 804
2015-01-12 17:28:40.238 [error] <0.254.0> Supervisor {<0.254.0>,boss_router_sup} had child router_controller started with boss_router_controller:start_link([{application,smsengine},{controllers,[]}]) at <0.255.0> exit with reason bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 176 in context child_terminated
2015-01-12 17:28:40.238 [error] <0.267.0>@boss_web_controller_handle_request:handle_request:30 Unhandled Error: exit:{{badarg,[{erlang,list_to_atom,[undefined],[]},{boss_router_controller,route,2,[{file,"src/boss/boss_router_controller.erl"},{line,176}]},{boss_router_controller,handle_call,3,[{file,"src/boss/boss_router_controller.erl"},{line,64}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,639}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]},{gen_server,call,[<0.255.0>,{route,"/"}]}}. Stacktrace: [{gen_server,call,2,[{file,"gen_server.erl"},{line,182}]},{boss_web_controller_handle_request,process_dynamic_request,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,237}]},{boss_web_controller_handle_request,process_request,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,232}]},{boss_web_controller_handle_request,set_timer,7,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,148}]},{boss_web_controller_handle_request,build_dynamic_response,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,122}]},{boss_web_controller_handle_request,handle_request,3,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,26}]},{mochicow_upgrade,upgrade,4,[{file,"src/mochicow_upgrade.erl"},{line,72}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,529}]}]
2015-01-12 17:28:40.248 [info] <0.269.0> Loading routes from "../smsengine/priv/smsengine.routes" ....
 

chan sisowath

unread,
Jan 12, 2015, 9:20:52 PM1/12/15
to chica...@googlegroups.com
lager:info("App ~p, Controllers ~p",[AppName, ControllerList]),




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

Emacs the Viking

unread,
Jan 13, 2015, 3:55:19 AM1/13/15
to chica...@googlegroups.com
DEV MODE
08:45:12.990 [error] App smsengine, Controllers ["smsengine_inbound_controller","smsengine_web_controller"]

[error] App cb_admin, Controllers ["cb_admin_upgrade_controller","cb_admin_routes_controller","cb_admin_model_controller","cb_admin_lang_controller","cb_admin_admin_controller"]

DEPLY MODE
2015-01-13 08:45:51.107 [error] <0.55.0>@boss_web_controller_util:unpack_application_env:46 App smsengine, Controllers []
2015-01-13 08:45:51.201 [error] <0.55.0>@boss_web_controller_util:unpack_application_env:46 App cb_admin, Controllers ["cb_admin_upgrade_controller","cb_admin_routes_controller","cb_admin_model_controller","cb_admin_lang_controller","cb_admin_admin_controller"]

["cb_admin_upgrade_controller","cb_admin_routes_controller","cb_admin_model_controller","cb_admin_lang_controller","cb_admin_admin_controller"]

Ignore the [error], I used coloured logs and it was easier to spot them!  It does seem that it does not find my BEAM files... are they even present I wonder? In deploy mode, my ./ebin folder is empty so where should I be looking? 

Here is the complete contents of code:get_path()...near the bottom I highlighted the fact it has "../smsengine/abin" in the list so it *knows* to look in the write place, it's just the fact that the ebinfolder is empty! So why isn't "./rebar compile" putting *my* application code in the ./ebin folder like I expected?

It is *just* missing configuration that I didn't mention because I didn't know about!?

---here is the path output:

(smsengine@iMac)6> lists:foreach(fun(E)->io:fwrite("~s~n",[E]) end, code:get_path()).
deps/uuid/ebin
deps/tinymq/ebin
deps/tiny_pq/ebin
deps/simple_bridge/ebin
deps/riakc/ebin
deps/riak_pb/ebin
deps/redo/ebin
deps/ranch/ebin
deps/protobuffs/ebin
deps/proper/ebin
deps/poolboy/ebin
deps/pmod_transform/ebin
deps/mysql/ebin
deps/mongodb/ebin
deps/mochiweb/ebin
deps/mochicow/ebin
deps/mimetypes/ebin
deps/merl/ebin
deps/medici/ebin
deps/meck/ebin
deps/lfe/ebin
deps/lager/ebin
deps/jsx/ebin
deps/jaderl/ebin
deps/ibrowse/ebin
deps/goldrush/ebin
deps/gen_smtp/ebin
deps/gen_server2/ebin
deps/eunit_formatters/ebin
deps/ets_cache/ebin
deps/erlydtl/ebin
deps/erlmc/ebin
deps/erlando/ebin
deps/epgsql/ebin
deps/dynamic_compile/ebin
deps/dh_date/ebin
deps/ddb/ebin
deps/cowlib/ebin
deps/cowboy/ebin
deps/cb_admin/ebin
deps/bson/ebin
deps/boss_test/ebin
deps/boss_db/ebin
deps/boss/ebin
deps/bcrypt/ebin
deps/aleppo/ebin
./deps/uuid/ebin
./deps/tinymq/ebin
./deps/tiny_pq/ebin
./deps/simple_bridge/ebin
./deps/riakc/ebin
./deps/riak_pb/ebin
./deps/redo/ebin
./deps/ranch/ebin
./deps/protobuffs/ebin
./deps/proper/ebin
./deps/poolboy/ebin
./deps/pmod_transform/ebin
./deps/mysql/ebin
./deps/mongodb/ebin
./deps/mochiweb/ebin
./deps/mochicow/ebin
./deps/mimetypes/ebin
./deps/merl/ebin
./deps/medici/ebin
./deps/meck/ebin
./deps/lfe/ebin
./deps/lager/ebin
./deps/jsx/ebin
./deps/jaderl/ebin
./deps/ibrowse/ebin
./deps/goldrush/ebin
./deps/gen_smtp/ebin
./deps/gen_server2/ebin
./deps/eunit_formatters/ebin
./deps/ets_cache/ebin
./deps/erlydtl/ebin
./deps/erlmc/ebin
./deps/erlando/ebin
./deps/epgsql/ebin
./deps/dynamic_compile/ebin
./deps/dh_date/ebin
./deps/ddb/ebin
./deps/cowlib/ebin
./deps/cowboy/ebin
./deps/cb_admin/ebin
./deps/bson/ebin
./deps/boss_test/ebin
./deps/boss_db/ebin
./deps/boss/ebin
./deps/bcrypt/ebin
./deps/aleppo/ebin
../smsengine/ebin
.
/opt/local/lib/erlang/lib/kernel-3.1/ebin
/opt/local/lib/erlang/lib/stdlib-2.3/ebin
/opt/local/lib/erlang/lib/sasl-2.4.1/ebin
/opt/local/lib/erlang/lib/xmerl-1.3.7/ebin
/opt/local/lib/erlang/lib/wx-1.3.2/ebin
/opt/local/lib/erlang/lib/webtool-0.8.10/ebin
/opt/local/lib/erlang/lib/typer-0.9.8/ebin
/opt/local/lib/erlang/lib/tools-2.7.1/ebin
/opt/local/lib/erlang/lib/test_server-3.7.2/ebin
/opt/local/lib/erlang/lib/syntax_tools-1.6.17/ebin
/opt/local/lib/erlang/lib/ssl-5.3.8/ebin
/opt/local/lib/erlang/lib/ssh-3.1/ebin
/opt/local/lib/erlang/lib/snmp-5.1.1/ebin
/opt/local/lib/erlang/lib/runtime_tools-1.8.15/ebin
/opt/local/lib/erlang/lib/reltool-0.6.6/ebin
/opt/local/lib/erlang/lib/public_key-0.22.1/ebin
/opt/local/lib/erlang/lib/percept-0.8.10/ebin
/opt/local/lib/erlang/lib/parsetools-2.0.12/ebin
/opt/local/lib/erlang/lib/otp_mibs-1.0.10/ebin
/opt/local/lib/erlang/lib/ose-1.0.2/ebin
/opt/local/lib/erlang/lib/os_mon-2.3/ebin
/opt/local/lib/erlang/lib/orber-3.7.1/ebin
/opt/local/lib/erlang/lib/odbc-2.10.22
/opt/local/lib/erlang/lib/observer-2.0.3/ebin
/opt/local/lib/erlang/lib/mnesia-4.12.4/ebin
/opt/local/lib/erlang/lib/megaco-3.17.3/ebin
/opt/local/lib/erlang/lib/jinterface-1.5.12/ebin
/opt/local/lib/erlang/lib/inets-5.10.4/ebin
/opt/local/lib/erlang/lib/ic-4.3.6/ebin
/opt/local/lib/erlang/lib/hipe-3.11.2/ebin
/opt/local/lib/erlang/lib/gs-1.5.16/ebin
/opt/local/lib/erlang/lib/eunit-2.2.9/ebin
/opt/local/lib/erlang/lib/et-1.5/ebin
/opt/local/lib/erlang/lib/erts-6.3/ebin
/opt/local/lib/erlang/lib/erl_interface-3.7.20/ebin
/opt/local/lib/erlang/lib/erl_docgen-0.3.7/ebin
/opt/local/lib/erlang/lib/eldap-1.1/ebin
/opt/local/lib/erlang/lib/edoc-0.7.16/ebin
/opt/local/lib/erlang/lib/diameter-1.8/ebin
/opt/local/lib/erlang/lib/dialyzer-2.7.3/ebin
/opt/local/lib/erlang/lib/debugger-4.0.2/ebin
/opt/local/lib/erlang/lib/crypto-3.4.2/ebin
/opt/local/lib/erlang/lib/cosTransactions-1.2.14/ebin
/opt/local/lib/erlang/lib/cosTime-1.1.14/ebin
/opt/local/lib/erlang/lib/cosProperty-1.1.17/ebin
/opt/local/lib/erlang/lib/cosNotification-1.1.21/ebin
/opt/local/lib/erlang/lib/cosFileTransfer-1.1.16/ebin
/opt/local/lib/erlang/lib/cosEventDomain-1.1.14/ebin
/opt/local/lib/erlang/lib/cosEvent-2.1.15/ebin
/opt/local/lib/erlang/lib/compiler-5.0.3/ebin
/opt/local/lib/erlang/lib/common_test-1.9/ebin
/opt/local/lib/erlang/lib/asn1-3.0.3/ebin
ok



Emacs the Viking

unread,
Jan 13, 2015, 3:56:14 AM1/13/15
to chica...@googlegroups.com
Damn. Ignore the cut-and-paste error on the deply mode;;;; the list *IS* empty!
Message has been deleted

emacstheviking

unread,
Jan 28, 2015, 4:11:19 AM1/28/15
to chica...@googlegroups.com
I have gone back to raw OTP I am afraid for my current project.
I didn't find a resolution to it, I code code tired wading through it all.
Shame though CB is really really good.
Sean


On 28 January 2015 at 01:56, Robert Swirsky <rswi...@thrillscience.com> wrote:

I'm having the EXACT SAME problem!

In production mode, a route isn't found (not all routes, just some of them). The error is always a "list_to_atom(undefined)" in boss_router_controller:route/2 line 172

2015-01-28 01:50:14.119 [error] <0.265.0> gen_server <0.265.0> terminated with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 172

2015-01-28 01:50:14.119 [error] <0.265.0> CRASH REPORT Process <0.265.0> with 0 neighbours exited with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 172 in gen_server:terminate/7 line 804

2015-01-28 01:50:14.120 [error] <0.264.0> Supervisor {<0.264.0>,boss_router_sup} had child router_controller started with boss_router_controller:start_link([{application,beakconsole},{controllers,["beakconsole_main_controller","beakconsole_channel_mast...",...]}]) at <0.265.0> exit with reason bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:route/2 line 172 in context child_terminated

2015-01-28 01:50:14.120 [error] <0.287.0>@boss_web_controller_handle_request:handle_request:30 Unhandled Error: exit:{{badarg,[{erlang,list_to_atom,[undefined],[]},{boss_router_controller,route,2,[{file,"src/boss/boss_router_controller.erl"},{line,172}]},{boss_router_controller,handle_call,3,[{file,"src/boss/boss_router_controller.erl"},{line,64}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,639}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]},{gen_server,call,[<0.265.0>,{route,"/server/servers"}]}}. Stacktrace: [{gen_server,call,2,[{file,"gen_server.erl"},{line,182}]},{boss_web_controller_handle_request,process_dynamic_request,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,237}]},{boss_web_controller_handle_request,process_request,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,232}]},{boss_web_controller_handle_request,set_timer,7,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,148}]},{boss_web_controller_handle_request,build_dynamic_response,4,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,122}]},{boss_web_controller_handle_request,handle_request,3,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,26}]},{mochicow_upgrade,upgrade,4,[{file,"src/mochicow_upgrade.erl"},{line,72}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,529}]}]

but in develop mode, it works fine:

(beakconsole@master1)1> 01:54:06.924 [notice] ApplicationForPath beakconsole

01:54:06.930 [info] Loading routes from "/home/famserve/cb/erlang/beakconsole/priv/beakconsole.routes" ....

01:54:06.931 [info] Boss Route beakconsole "server" "servers" []

01:54:06.945 [info] Query SELECT * FROM channel_masters WHERE id = 1

01:54:06.958 [notice] Request Method 'GET'

01:54:06.958 [notice] Tokens []

01:54:06.972 [info] GET /server/servers [beakconsole] 200 0ms

01:54:07.948 [notice] ApplicationForPath beakconsole

01:54:07.949 [info] Loading routes from "/home/famserve/cb/erlang/beakconsole/priv/beakconsole.routes" ....

01:54:07.954 [info] Query SELECT * FROM channel_masters WHERE id = 1

01:54:07.955 [notice] Request Method 'GET'

01:54:07.955 [notice] Tokens []

01:54:08.865 [info] GET /salt/ping [beakconsole] 200 0ms

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

Dmitry Polyanovsky

unread,
Jan 28, 2015, 5:03:14 PM1/28/15
to chica...@googlegroups.com
I seen problems with routes in dev mode against production mode only in two cases:
* app directory renamed
* compilation stopped at some point and actually new routing is not compiled (but yet working in dev mode)

Miguel Benitez

unread,
Jan 29, 2015, 4:22:19 PM1/29/15
to chica...@googlegroups.com
I'm having the EXACT SAME problem too, is this a bug?

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

emacstheviking

unread,
Jan 29, 2015, 4:30:01 PM1/29/15
to chica...@googlegroups.com
Let's get together and start a support group:

    CB ATE MY ROUTES

:)


kotedo

unread,
Jan 29, 2015, 4:30:35 PM1/29/15
to chica...@googlegroups.com

chan sisowath

unread,
Jan 29, 2015, 7:38:43 PM1/29/15
to chica...@googlegroups.com
hi,
here an example of a config in production: you need to declare controller/view/mode/websocket into your boss.config or sys.config (release).

here a config when i develop draw app with cb_admin as a sub app.

https://github.com/mihawk/draw/blob/master/apps/draw/boss.config
[{boss, [
    {path, "../../deps/boss"},
    {applications, [draw,cb_admin]},
    {db_host, "192.168.188.81"},
    {db_port, 1978},
    {db_adapter, mock},
    {log_dir, "log"},
    {server, cowboy},
    {port, 8001},
    {session_adapter, mock},
    {session_key, "_boss_session"},
    {session_exp_time, 525600}
]},
{ draw, [
    {path, "../draw"},
    {base_url, "/"}
]},
{cb_admin, [
    {path, "../cb_admin"},
    {allow_ip_blocks, ["127.0.0.1"]},
    {base_url, "/admin"},
    {model_modules, []},
    {websocket_modules, []},
    {controller_modules,[
                         cb_admin_admin_controller,      
                         cb_admin_incoming_mail_controller,
                         cb_admin_lang_controller,
                         cb_admin_model_controller,
                         cb_admin_outgoing_mail_controller,
                         cb_admin_routes_controller,
                         cb_admin_upgrade_controller
                        ]},
    {view_modules,[
                   cb_admin_view_admin_access_denied_html,
                   cb_admin_view_admin_index_html,
                   cb_admin_view_admin_layouts_admin_html,
                   cb_admin_view_admin_layouts_shared__alerts_html,
                   cb_admin_view_admin_layouts_shared__main_menu_html,
                   cb_admin_view_admin_layouts_shared__sidebar_html,
                   cb_admin_view_admin_splash_html,
                   cb_admin_view_lang_big_red_button_html,
                   cb_admin_view_lang_create_html,
                   cb_admin_view_lang_delete_html,
                   cb_admin_view_lang_shared__lang_left_submenu_html,
                   cb_admin_view_lang_shared__lang_right_submenu_html,
                   cb_admin_view_lang_show_html,
                   cb_admin_view_lib_tags,
                   cb_admin_view_model_create_html,
                   cb_admin_view_model_delete_html,
                   cb_admin_view_model_edit_html,
                   cb_admin_view_model_model_html,
                   cb_admin_view_model_show_html,
                   cb_admin_view_model_upload_html,
                   cb_admin_view_routes_index_html,
                   cb_admin_view_upgrade_upgrade_html
                  ]}
]}
].

here draw config in production mode:
https://github.com/mihawk/draw/blob/master/rel/files/sys.config
[{boss, [
    {path, "../../deps/boss"},       
    {applications, [draw,cb_admin]},
    %{db_host, "192.168.188.81"},
    %{db_port, 1978},
    %{db_adapter, mock},
    {log_dir, "log"},
    {server, cowboy},
    {port, 8001},
    {session_adapter, mock},
    {session_key, "_boss_session"},
    {session_exp_time, 525600}
    %,{websocket_timeout, 5000}
]},
{ draw, [
    {path, "../draw"},
    {base_url, "/"},

%%draw_custom_filters
%%draw_custom_tags
%%draw_view_lib_tags

    {model_modules, []},
    {websocket_modules, [
                         draw_draw_protocol_websocket,
                         draw_websocket_test_websocket
                         ]},
    {controller_modules,[
                         draw_draw_controller,
                         draw_incoming_mail_controller,
                         draw_outgoing_mail_controller
                         ]},                      
    {view_modules,[draw_view_draw_index_html]}
]},
{cb_admin, [
    {path, "../cb_admin"},
    {allow_ip_blocks, ["127.0.0.1"]},
    {base_url, "/admin"},
    {model_modules, []},
    {websocket_modules, []},
    {controller_modules,[
                        cb_admin_admin_controller,      
                        cb_admin_incoming_mail_controller,
                        cb_admin_lang_controller,
                        cb_admin_model_controller,
                        cb_admin_outgoing_mail_controller,
                        cb_admin_routes_controller,
                        cb_admin_upgrade_controller]},
    {view_modules,[
                        cb_admin_view_admin_access_denied_html,
                        cb_admin_view_admin_index_html,
                        cb_admin_view_admin_layouts_admin_html,
                        cb_admin_view_admin_layouts_shared__alerts_html,
                        cb_admin_view_admin_layouts_shared__main_menu_html,
                        cb_admin_view_admin_layouts_shared__sidebar_html,
                        cb_admin_view_admin_splash_html,
                        cb_admin_view_lang_big_red_button_html,
                        cb_admin_view_lang_create_html,
                        cb_admin_view_lang_delete_html,
                        cb_admin_view_lang_shared__lang_left_submenu_html,
                        cb_admin_view_lang_shared__lang_right_submenu_html,
                        cb_admin_view_lang_show_html,
                        cb_admin_view_lib_tags,
                        cb_admin_view_model_create_html,
                        cb_admin_view_model_delete_html,
                        cb_admin_view_model_edit_html,
                        cb_admin_view_model_model_html,
                        cb_admin_view_model_show_html,
                        cb_admin_view_model_upload_html,
                        cb_admin_view_routes_index_html,
                        cb_admin_view_upgrade_upgrade_html
                        ]}
]}
].

you should look at the Makefile also
why this makefile
i have noticed when you develop with multiple cbapp in the deps folder the compilation stop within the first cbapp.




Miguel Benitez

unread,
Jan 30, 2015, 5:03:03 PM1/30/15
to chica...@googlegroups.com
Chan is right; in my case, I needed to force compilation with the command ./rebar boss c=compile and then it compiled and recognized the routes successfully.

Thanks Chan and community.

Reply all
Reply to author
Forward
0 new messages