Skip to content
This repository

node.js v0.10.0 Issues (CentOS 6.3) #400

Closed
elronalds opened this Issue March 17, 2013 · 34 comments
elronalds

Does forever work with node.js v0.10.0? I am trying to use forever with node.js v0.10.0 on CentOS 6.3 however when I run the server via the CLI and then check forever list it seems to hang and never return a response to the console. My setup is explained below:

I see the read me states "Remark: As of forever@0.6.0 processes will not automatically be available in forever.list(). In order to get your processes into forever.list() or forever list you must instantiate the forever socket server:" but does this apply when using forever via. the CLI? If so how would the example script below be modified?

Cent OS 6.3 Install node.js Rackspace Cloud Server

yum install openssl-devel gcc-c++ make
cd /usr/local/src
wget http://nodejs.org/dist/node-latest.tar.gz
tar zxvf node-latest.tar.gz
cd node-v0.10.0
make
make install

Check Node.js version

node --version

Open default iptables firewall port 80

vi /etc/sysconfig/iptables
Open Port 80
/sbin/service iptables restart
/sbin/service iptables save

Install node.js forever

npm install forever -g

Create Example node.js server

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(80);
console.log('Server running on port 80');

Run server using forever

forever start example.js

List forever instances

forever list
Seems to hang at this step

Colton Baker

This is related to flatiron/flatiron#99.

Jesse

Same issue in OSX 10.7.5. Also hangs on forever stopall

Bent Cardan

"LATENCY AND IDLE GARBAGE COLLECTION

One of the toughest things to get right in a garbage collected language is garbage collection. In order to try to avoid excessive memory usage, Node used to try to tell V8 to collect some garbage whenever the event loop was idle.

However, knowing exactly when to do this is extremely difficult. There are different degrees of "idleness", and if you get it wrong, you can easily end up spending massive amounts of time collecting garbage when you'd least expect. In practice, disabling the IdleNotification call yields better performance without any excessive memory usage, because V8 is pretty good at knowing when it's the best time to run GC.

So, in v0.10, we just ripped that feature out. (According to another point of view, we fixed the bug that it was ever there in the first place.) As a result, latency is much more predictable and stable. You won't see a difference in the benchmarks as a result of this, but you'll probably find that your app's response times are more reliable." -Isaac Schlueter

Matthew Gao

same here, forever list/stop seems not working anymore, need an update since the last one was 8 month ago:{

Bent Cardan

v0.10 on ubuntu 12.04 gives us this stack trace below before hanging. I mentioned Isaac's quote above because both Isaac and my machine are kinda saying the same thing in different words, am I wrong?

$ forever list
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at EventEmitter.Lazy.self.once (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:14:14)
at EventEmitter.Lazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:27:14)
at EventEmitter.Lazy.self.bucket (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:150:20)
at EventEmitter.lines (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:176:21)
at NsSocket._setup (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:369:7)
at new exports.NsSocket (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:80:8)
at getProcess (/usr/lib/node_modules/forever/lib/forever.js:97:18)
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:185:13
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:86:13
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at EventEmitter.Lazy.self.once (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:14:14)
at EventEmitter.Lazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:28:14)
at newLazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:44:20)
at EventEmitter.Lazy.self.map (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:68:16)
at NsSocket._setup (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:370:8)
at new exports.NsSocket (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:80:8)
at getProcess (/usr/lib/node_modules/forever/lib/forever.js:97:18)
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:185:13
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:86:13
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at newLazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:45:14)
at EventEmitter.Lazy.self.map (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:68:16)
at NsSocket._setup (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:370:8)
at new exports.NsSocket (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:80:8)
at getProcess (/usr/lib/node_modules/forever/lib/forever.js:97:18)
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:185:13
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:86:13
at Array.forEach (native)
at _forEach (/usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:26:24)

Elido Ruiz
Elido commented March 18, 2013

v10 on ubuntu 12.10 gives me the same issue as above:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at EventEmitter.Lazy.self.once (/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:14:14)
at EventEmitter.Lazy (/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:27:14)
at EventEmitter.Lazy.self.bucket (/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:150:20)
at EventEmitter.lines (/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:176:21)
at NsSocket._setup (/usr/local/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:369:7)
at new exports.NsSocket (/usr/local/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:80:8)
at getProcess (/usr/local/lib/node_modules/forever/lib/forever.js:97:18)
at /usr/local/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:185:13
at /usr/local/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:86:13

Mike Wills

Same issue on my Ubuntu 12.04 server

forever list
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at EventEmitter.Lazy.self.once (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:14:14)
at EventEmitter.Lazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:27:14)
at EventEmitter.Lazy.self.bucket (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:150:20)
at EventEmitter.lines (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:176:21)
at NsSocket._setup (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:369:7)
at new exports.NsSocket (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:80:8)
at getProcess (/usr/lib/node_modules/forever/lib/forever.js:97:18)
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:185:13
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:86:13
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at EventEmitter.Lazy.self.once (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:14:14)
at EventEmitter.Lazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:28:14)
at newLazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:44:20)
at EventEmitter.Lazy.self.map (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:68:16)
at NsSocket._setup (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:370:8)
at new exports.NsSocket (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:80:8)
at getProcess (/usr/lib/node_modules/forever/lib/forever.js:97:18)
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:185:13
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:86:13

osher
osher commented March 19, 2013

Ubuntu 12, node 0.10.0 - DIFFERENT errors

First - during install, got a warning re forever wants 0.8, but has 0.10

When trying to forever list I get:

osg@br1:~$ forever list

module.js:340
    throw err;
          ^
Error: Cannot find module './daemon.v0.10.0'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/forever/node_modules/daemon/lib/daemon.js:12:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
osg@br1:~$

Im upgrading from node 0.6

looking inside I could see `daemon.v0.6.19.node', but not 0.8.x or 0.10.x

anybody?

UPDATED:

I had a bad installation problem, I'm back with everybody now...
I now have the same errors as everybody else

Piotr Yordanov

+1 I also have the problem on a ubuntu 12.04 machine.

legomind

+1 ubuntu 12.04 server

zweifisch

+1 ubuntu 12.10 server

Ruslan

It looks like the project is gone :-1:

legomind
Will Glaub

same here on ubuntu 12.04 desktop and server, worked one day, broken the next (after the 0.10.0 automatic update), frustrating!

following error given twice, and process doesn't return to command line for any command other than start or help, requiring me to kill it by pid:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at EventEmitter.Lazy.self.once (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:14:14)
at EventEmitter.Lazy (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:27:14)
at EventEmitter.Lazy.self.bucket (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:150:20)
at EventEmitter.lines (/usr/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:176:21)
at NsSocket._setup (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:369:7)
at new exports.NsSocket (/usr/lib/node_modules/forever/node_modules/nssocket/lib/nssocket.js:80:8)
at getProcess (/usr/lib/node_modules/forever/lib/forever.js:97:18)
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:185:13
at /usr/lib/node_modules/forever/node_modules/utile/node_modules/async/lib/async.js:86:13

Piotr Yordanov

@legomind this happens because node is v0.10, so use nvm and install node v0.8. It's the temporary solution I found till this issue gets fixed :)

Charlie Robbins
Owner

We haven't upgraded to 0.10 yet. Sorry. Big update coming in the next month or so. A PR would be very welcomed. The underlying issue appears to be in Lazy through nssocket

otium
otium commented March 20, 2013

There is a pull request for lazy that fixes the problem at https://github.com/Nathanaela/node-lazy/tree/Cleanup

Mike Wills

So... I got sick of waiting. I started tracking down the source of the problems. Implemented the changes from Lazy. While it suppressed the error messages, that alone doesn't fix it. It still hangs like it did before.

Nathanael Anderson

@MikeWills - Hmm, I just did a "npm install forever", copied my fixed version of "lazy.js" manually into the forever/node_module/nssocket/node_module/lazy folder (overritting the broken copy) and forever appears to be now working correctly. I did a forever start myscript, then in another console connected to my linux box did a forever list and forever stop 0. You might try deleting your entire npm cache; & forever, then doing a re-install of forever and then grabbing the lazy.js from my repository and manually sticking it into the nssockets/node_module/lazy folder...

Evan You

@Nathanaela it works! Thank you man. I tried to pin down the problem as well but gave up after getting to nssocket. FYI I didn't even reinstall anything, simply replaced lazy.js. Hope your pull request gets accepted soon... this fragile dependency hierarchy kinda troubles me.

Mike Wills

I still can't get it to work, but maybe I need to shut down my forever processes first before uninstalling and reinstalling. I'll test that when I have time. My problem is that forever list and both stop commands hang.

Evan You

@MikeWills yep - you need to manually kill all the currently running forever processes before using forever again

Mike Wills

I got it working. After changing that file. I just rebooted :-P

jirotoh

@Nathanaela Worked for me ! Thank you :)

Brandon Frohs

Update: The issue in lazy was fixed in 1.0.9 (see pkrumins/node-lazy@7bf31b8 and pkrumins/node-lazy#33 (comment)).

Adam Brod

For the record, I'm seeing this issue on node v0.10.1 on CentOS 5.8. Even after patching lazy I haven't been able to get everything to work properly, so I'm not 100% sure the lazy patch will fix forever for me.

Evan You

@adambrod lazy recently got updated, supposedly if you do an npm update in your forever folder and get lazy 1.0.9, forever should be running fine on node v0.10.x

legomind
Chris Kimpton

That works for me - thought it hadn't but the old forever version was still running.

Thanks all.

Gabriel Falkenberg

Reinstalling forever got me lazy 1.0.9 and I can use forever again with node 0.10. Time to close the issue or should the engines element in package.json perhaps be updated to reflect that node 0.10 is ok?

Alan Ristić

Reinstalling forever got me lazy 1.0.9 and I can use forever again with node 0.10.3 — works perfect on ubuntu 12.04 LTS

schlowmo

Changes in lazy.js worked for me under debian squeeze with v10.0.3. Thanks a lot!

Adam Brod
Charlie Robbins indexzero referenced this issue in nodejitsu/forever-monitor April 21, 2013
Closed

forever stop #23

Charlie Robbins indexzero closed this in 10fa40f April 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.