tags:

views:

463

answers:

3

I'm trying to start a named Erlang node using the -sname option in Windows XP Home, but when I run erl, it prints out a long error message, which I don't understand, and quits:

>erl -sname allyourcode
{error_logger,{{2009,5,25},{16,20,57}},"Protocol: ~p: register error: ~p~n",["in
et_tcp",{{badmatch,{error,econnrefused}},[{inet_tcp_dist,listen,1},{net_kernel,s
tart_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,
init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}]}
{error_logger,{{2009,5,25},{16,20,57}},crash_report,[[{initial_call,{net_kernel,
init,['Argument__1']}},{pid,},{registered_name,[]},{error_info,{exit,{er
ror,badarg},[{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{ancestors,[
net_sup,kernel_sup,]},{messages,[]},{links,[#Port,]},{dicti
onary,[{longnames,false}]},{trap_exit,true},{status,running},{heap_size,610},{st
ack_size,24},{reductions,490}],[]]}
{error_logger,{{2009,5,25},{16,20,57}},supervisor_report,[{supervisor,{local,net
_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{p
id,undefined},{name,net_kernel},{mfa,{net_kernel,start_link,[[allyourcode,shortn
ames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2009,5,25},{16,20,57}},supervisor_report,[{supervisor,{local,ker
nel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined
},{name,net_sup},{mfa,{erl_distribution,start_link,[]}},{restart_type,permanent}
,{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2009,5,25},{16,20,57}},std_info,[{application,kernel},{exited,{s
hutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kern
el,{shutdown,{kernel,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kerne
l,{shutdown,{kernel,start,[normal,[]]}}})

I'd like to include the erl_crash.dump file, but I don't know a good way to do that, because it's pretty long.

At first, I thought I was having a firewall issue, because the first time I tried to do this, my firewall asked if I would grant permission to different programs, which I did; however, even after disabling my firewall, I'm still having the same problem.

Using -name instead doesn't seem to help either.

+2  A: 

I think that you will find that you have started a node by that name already. Try shutting down all your Erlang console windows and try again.

Stephen Bailey
+2  A: 

Yes, you may even have to restart your OS - to check whether this is true, you could also simply start a node with a different name, also it is generally better to use a fully qualified name, such as:

erl -name [email protected] -setcookie KILLER

Then, start another one using:

erl -name [email protected] -setcookie KILLER

and try to ping the other node:

net_adm:ping('[email protected]').

You should get a 'pong' message.

Next use

nodes().

to see all visible nodes.

none
I tried closing all my cmd windows before starting erl, but that didn't work. After restarting Windows, as you suggested, I was able to run erl -sname foo. Does that mean I had erl processes running and didn't even know it?
allyourcode
Yes, don't forget that an erlang shell may have an arbitrary number of processes running, without using the advanced facilities provided by the shell, it may not be obvious what else is/was already running, or if any one of those processes wasn't terminated properly, so that there are process information leftovers.
none
+2  A: 

1) You need to make sure you are not using an already registered name (of course): this include any name already claimed by Erlang already

2) If you are starting on the same machine but under different user, make sure your cookies are the same

jldupont