Chicagoboss not starting up properly when the computer name changes

22 views
Skip to first unread message

Rana Aich

unread,
Mar 3, 2015, 12:35:45 PM3/3/15
to chica...@googlegroups.com
Hi All,

I'm having a strange problem when I work with Chicagoboss at my home. Once a week I work from home, as I'm doing today. When I start Chicagoboss in the office it's perfectly alright. When I'm working at office my boss.config configuration looks as follows:

    {session_adapter, mnesia},
    {session_key, "_boss_session"},
    {session_exp_time, 525600},
    {session_enable, true},
%    {session_mnesia_nodes, [node()]}, % <- replace "node()" with a node name
    {session_mnesia_nodes, ['myapp@abc-cn123456-wifi']}, % <- replace "node()" with a node name
%    {session_domain, ".domain.com"},

But when I work from home the computer name changes as I connect to my home wifi. The Computer name shows ABC-CN123456
and I change my boss.config accordingly.

At home my boss.config is as follows. And I delete the Mnesia directory to start the development phase from the scratch.

    {session_adapter, mnesia},
    {session_key, "_boss_session"},
    {session_exp_time, 525600},
    {session_enable, true},
%    {session_mnesia_nodes, [node()]}, % <- replace "node()" with a node name
    {session_mnesia_nodes, ['myapp@ABC-CN123456']}, % <- replace "node()" with a node name
%    {session_domain, ".domain.com"},

But I'm having difficulty in starting Chicagoboss with init-dev.sh.

It seems the cowboy is restarting always after 7-8 secs interval.

I'm sure there is a solution to it. What would be correct boss.config values for session_mnesia_nodes so that I don't have to reconfigure again when the computer name changes. Any help will be really appreciated. 



Rana Aich

unread,
Mar 3, 2015, 1:15:28 PM3/3/15
to chica...@googlegroups.com
I think I've sloved the problem. It is something to do with my VPN connection. 

Evgeny M

unread,
Mar 5, 2015, 5:05:43 PM3/5/15
to chica...@googlegroups.com
Mnesia can't work with a database after node name got changed. You need to export old database, create new one then import old one - http://erlang.org/doc/apps/mnesia/Mnesia_chap7.html#id78870

вторник, 3 марта 2015 г., 20:35:45 UTC+3 пользователь Rana Aich написал:

Graeme Defty

unread,
Mar 5, 2015, 9:07:06 PM3/5/15
to chica...@googlegroups.com
This was my first thought too, since I have been caught out by this in the past. For some reason the Mnesia database has the node name embedded in it and needs a translation step as described at the referenced web page to 'adjust' that embedded name.

However, you said that you delete the Mnesia directory and start from scratch. That should eliminate this as a source of the problem.

graeme

PS
If this IS the problem - i.e. you are trying to move the Mnesia database between nodes, then you would be better off using mnesia:dump_to_textfile/1 and mnesia:restore_textfile/1.  The documentation says they are not recommended for production use, but I have found that for development purposes they are fine and a lot simpler to use.




--
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/33d00807-e6a2-42c8-810e-638d0aeddd68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages