LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

something is totally broken #15

Closed kof closed 13 years ago

kof commented 13 years ago

doesn't matter what I trying to do, I get always this

events.js:23
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: EINVAL, Invalid argument
    at Server._doListen (net.js:1062:5)
    at net.js:1010:16

now using node v0.4.0, on macos.

I have tried your examples and to run tests, nothing worked, always with the same error.

tj commented 13 years ago

interesting, I am on osx as well, and everything is fine. looking into it

tj commented 13 years ago

which version of node? I will grab the same, currently tested with 0.2.6 and 0.4.0

kof commented 13 years ago

It is in the description, 0.4.0 :)

kof commented 13 years ago

the interesting thing is that even your examples doesn't work, so there is no dependency on my code

tj commented 13 years ago

strannnnge.. looks like the fd passing is possibly failing

kof commented 13 years ago

hmm can this depend on any OS configuration, f.e. ssl etc. ?

kof commented 13 years ago

more info:

it breaks after .listen() call.

tj commented 13 years ago

manpage says you get EINVAL when the socket is already connected

kof commented 13 years ago

wait I restart my mashine ....

tj commented 13 years ago

in node's source looks like its coming from the bind() call not listen()

tj commented 13 years ago

[EINVAL] socket is already bound to an address and the protocol does not support binding to a new address. Alternatively, socket may have been shut down.

kof commented 13 years ago

restart didn't help :)

I mean .listen method from cluster, if I remove listen no error happens

I tried to debug and landed in .start() in // TCP server for IPC this._server.listen(this.options['socket path'], function(){

the callback is never called

tj commented 13 years ago

ohh interesting it's the IPC socket, try .set('socket path', '/tmp/cluster.sock')

kof commented 13 years ago

ok has worked ... it this a permission error for sock file?

tj commented 13 years ago

could be, I was going to default it to /var/run/cluster.sock but that will certainly have permission issues, I wanted to have it useable out of the box without sudo, but your system does not like something

kof commented 13 years ago

node needs a crossplattform tmp dir without permission issues. I have had the same issue in my node-qunit module because of jscoverage

kof commented 13 years ago

I have already started a thread about tmp dir in nodejs-dev for a long time, but nothing changed

tj commented 13 years ago

yeah we do need a path or mktemp() or something. strange though that it would not work in the same directory as your repo, and I would expect something else not EINVAL

kof commented 13 years ago

I can do any tests you neeed to fugure out exactly what wrong

tj commented 13 years ago

can you ls -l the cloned repo? by default it should be trying to create that socket at ./cluster.sock, maybe the path is not setting correctly in Master#resolve()

kof commented 13 years ago

there is no sock file in the same dir, I have done console .log in master#start method

console.log(this.options['socket path']);

the path is correct:

/Users/kof/work/javascript/nodejs/libs/cluster/examples/master.sock

tj commented 13 years ago

ah, yeah that looks correct, I resolve relative to the script instead of the CWD. permissions could be off, I will clone and see if mine is fine out of the box

kof commented 13 years ago

the strange thing is I had the same problem if use it from npm, but I thought this has something todo with my code.

now I have tried basic.js from examples and require cluster from npm - the same shit

tj commented 13 years ago

wtf lol I have to run to the chiropractor right away but I will try and reproduce some more when I get back

tj commented 13 years ago

doing a decent refactor, not sure if it will help with your case though

tj commented 13 years ago

going to close until we have more info, or others report the same issue, then hopefully we can pin-point the cause

ghost commented 13 years ago

I also have this situation. My problem was because I run code on mounted directory (folder from Virtual Box driver). So this file system have not permission for create socket file on it. So i just add as @visionmedia said

cl.set('socket path', '/tmp/')

and all work :)

kof commented 13 years ago

I didn't have mounted dir and I am wondering why not everybody has the same issue

tj commented 13 years ago

seems a bit odd to not have permission in the script's directory. @kof definitely ls -la and check those permission bits