Deploy option fails with "undefined" in handle/2

32 views
Skip to first unread message

Emacs the Viking

unread,
Jan 3, 2015, 6:49:47 PM1/3/15
to chica...@googlegroups.com
Hi,

I have read a lot around this issue, the only solution seemed to be "clean and compile" which I did to no avail.

The root cause is:

gen_server <0.263.0> terminated with reason: bad argument in call to erlang:list_to_atom(undefined) in boss_router_controller:handle/2 line 146

Why should there be a problem just because I am in "deploy" mode... I am not that familiar with the code yet, I've used Erlang for about 7 years... if i get time I will have a close look myself but I don't need the distraction right now!

The code I have running was created with version 0.8.11, a cursory glance shows that:

handle(StatusCode, State) ->
    _Result = case ets:lookup(State#state.handlers_table_id, StatusCode) of
        [] ->
            not_found;
        [#boss_handler{ application = App, controller = C, action = A, params = P }] ->
            ControllerModule = list_to_atom(boss_files:web_controller(App, C, State#state.controllers)),
            {Tokens, []} = boss_controller_lib:convert_params_to_tokens(P, ControllerModule, list_to_atom(A)),
            {ok, {App, C, A, Tokens}}
    end.

I guess the return value from boss_files:web_controller is "undefined" hence the blow out. It is using the same routes file as in development mode so I am confused right now!

Ultimately it needs addressing so I won't be able to put it off forever!

Thanks.
Sean.

Emacs the Viking

unread,
Jan 3, 2015, 7:01:03 PM1/3/15
to chica...@googlegroups.com
Do I have to explicitly declare all routes then... did some code reading and in boss_files:web_controller() it folds over a list of compiler adapters (WTF!?) and seems to be hunting for a controller, returning "undefined" if unsatisfied... I will experiment with declaring all my routes maybe?

Emacs the Viking

unread,
Jan 3, 2015, 7:02:30 PM1/3/15
to chica...@googlegroups.com
In fact, "undefined" is the initial injection value into the fold which implies zero matching routes/controllers!

Have I overlooked something *painfully obvious* in the documentation about routes... RTFM time...

chan sisowath

unread,
Jan 7, 2015, 10:03:37 PM1/7/15
to chica...@googlegroups.com
hi,

i guess deploy mean production mode?

you may declare your controller/model/websocket/view list in boss.config,

take a look at draw config, which show you how to release a CB apps:

https://github.com/mihawk/draw/blob/master/rel/files/sys.config

hope it could solve your prob.





--
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/bd21bd4b-9bb3-4db4-8e5c-7da083671c31%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages