jvantuyl / erlctl

Command Line Interface Framework for Erlang
Other
36 stars 6 forks source link

test_cli: Unable to start networking! #1

Closed dustalov closed 14 years ago

dustalov commented 14 years ago

Hello!

After rake on erlctl and copying lib/erlctl-0.1 into the /usr/lib/erlang/lib directory, I can't run the example application (ctl_ex) of jvantuyl/erlctl repo.

eveel@notazik{~/Work/erlctl}% bin/test_ctl 
Unable to start networking!

Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

What's going on?

jvantuyl commented 14 years ago

First, thanks for trying erlctl. Sorry it has taken so long to get back to you, but I didn't have the version of Erlang that you do, so I had to download and build it to test.

Interestingly, it doesn't seem to be related to the OTP version. There are three places that error can occur. The last two of them should print out a message about weird naming issues, so I'm assuming that means this is the first one.

I've made a patch to erlctl that gives a more helpful error message. Can you pull the latest revision and tell me what it outputs for "bin/test_ctl version" and "bin/test_ctl version remote".

I suspect it has something to do with naming. Can you also give me the output of "hostname", "hostname -f", and "dnsdomainname"? Some of those may not exist/work (and that's okay). Also, which Unix are you running on?

dustalov commented 14 years ago

Thank you for answer.

I'm using the Fedora 12, and have following output of hostname-related commands: eveel@notazik{~/Work/erlctl}% hostname notazik eveel@notazik{~/Work/erlctl}% hostname -f localhost eveel@notazik{~/Work/erlctl}% dnsdomainname eveel@notazik{~/Work/erlctl}% After pulling last revision and rebuilding, bug occurs again: eveel@notazik{~/Work/erlctl}% bin/test_ctl Unable to start networking! ({shutdown, {child,undefined,net_sup_dynamic, {erl_distribution,start_link, [[testctl_2822,longnames]]}, permanent,1000,supervisor, [erl_distribution]}}) Same output I see with keys 'version' and 'version remote'.

jvantuyl commented 14 years ago

Interesting. hostname -f should NOT return localhost. I'm working on a solution. In the meantime, does it work if you run "bin/test_ctl -h localhost"?

dustalov commented 14 years ago

bin/test_ctl -h localhost works same as without -h key.

If it mean: eveel@notazik{~/Work/erlctl}% cat /etc/hosts

hostname notazik added to /etc/hosts by anaconda

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 notazik
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 notazik
jvantuyl commented 14 years ago

Try "bin/test_ctl -s -h localhost". This is helping me track it down, by the way (not just random "I hope it works" suggestions).

dustalov commented 14 years ago
eveel@notazik{~/Work/erlctl}% bin/test_ctl -s -h localhost
Unable to start networking! ({shutdown,
                              {child,undefined,net_sup_dynamic,
                               {erl_distribution,start_link,
                                [[testctl_2459,shortnames]]},
                               permanent,1000,supervisor,
                               [erl_distribution]}})
dustalov commented 14 years ago

I see problem is so difficult :(

Can I help you anything?

jvantuyl commented 14 years ago

I'm still trying to reproduce it. I'm working on a new approach to this, but it may be a day until I get it right.

ErlCtl is based in "Distributed Erlang". When it works, it's awesome. Unfortunately it can be very picky about hostname configurations. :(

dustalov commented 14 years ago

A nood question. Should I run some workers or another otherside tools to make it work?

I see the rake tasks like run:start_workers[N] and run:kill_workers. Yes, I've tried run execute 'em, but nothing changed.

jvantuyl commented 14 years ago

Those are left over from an older project. I borrowed the Rakefiles from there. They don't do anything and I should probably remove them.

Right now, I'm trying to figure out how to get better error messages out of your machine, as I can't seem to get it to do that on any machine I have access to.

jvantuyl commented 14 years ago

This appears to be due to the hostname for the machine not being resolvable. Recommend using /etc/hosts to statically configure the hostname. Does this work?

dustalov commented 14 years ago

/etc/hosts and /etc/hostname solution fixes this issue.

Thanks and good luck for you and your project!