balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.82k stars 1.95k forks source link

"sails debug" on node v0.12.0 throwing error EADDRINUSE #2670

Closed MikeCostello closed 9 years ago

MikeCostello commented 9 years ago

Running Sails v0.11.0 and Node v0.12.0

When I run

sails new app; cd app
sails debug

Console logs...

error: Grunt :: Error: listen EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at Agent.Server._listen2 (net.js:1129:14)
    at listen (net.js:1155:10)
    at Agent.Server.listen (net.js:1240:5)
    at Object.start (_debugger_agent.js:20:9)
    at startup (node.js:86:9)
    at node.js:814:3

No conflicting ports were listening prior to running sails. Looking at travis.yml is only node v0.10.x supported currently?

SlowburnAZ commented 9 years ago

@tjwebb If I can find the time, I will attempt it.

denishgandhi-innoplexus commented 9 years ago

Hi,

I am getting same error.

info: Server lifted in /var/www/Sails info: To see your app, visit http://localhost:1337 info: To shut down Sails, press + C at any time.

debug: -------------------------------------------------------- debug: :: Tue May 26 2015 03:30:23 GMT+0530 (IST)

debug: Environment : development debug: Port : 1337 debug: --------------------------------------------------------

events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at errnoException (net.js:901:11) at Server._listen2 (net.js:1039:14) at listen (net.js:1061:10) at Server.listen (net.js:1135:5) at Array.async.auto.start as 0 at /var/www/Sails/node_modules/sails/node_modules/async/lib/async.js:484:38 at _each (/var/www/Sails/node_modules/sails/node_modules/async/lib/async.js:46:13) at Object.async.auto (/var/www/Sails/node_modules/sails/node_modules/async/lib/async.js:455:9) at Sails.startServer (/var/www/Sails/node_modules/sails/lib/hooks/http/start.js:16:11) at Sails.EventEmitter.emit (events.js:92:17) at Sails.emitter.emit (/var/www/Sails/node_modules/sails/lib/app/private/after.js:50:11) at afterBootstrap (/var/www/Sails/node_modules/sails/lib/app/private/initialize.js:56:11) at bootstrapDone (/var/www/Sails/node_modules/sails/lib/app/private/bootstrap.js:51:14) at Object.module.exports.bootstrap (/var/www/Sails/config/bootstrap.js:16:3) at Sails.runBootstrap (/var/www/Sails/node_modules/sails/lib/app/private/bootstrap.js:44:25) at Sails.bound as runBootstrap

node -v v0.10.25 sails -v 0.11.0

Please provide the solution.

denishgandhi-innoplexus commented 9 years ago

Got it worked by killing process which runs 1337/tcp

sudo fuser -k 1337/tcp sudo kill 3501

Andrew-Max commented 9 years ago

+1

shaunc commented 9 years ago

+1 for fix!

node 0.12.4 ... tried hacking fork per @dbuentello's suggestion ... "works a little" -- ie now I get the error, but if I just wait the debugger somehow limps along, but it acts strangely (e.g. no access to local context in repl).

FreCap commented 9 years ago

+1 for fix

sgress454 commented 9 years ago

Any chance this fixes it? It just got merged: https://github.com/balderdashy/sails/pull/2888

Someone mind pulling down the latest master branch of Sails and testing?

sgress454 commented 9 years ago

Confirmed working on Node v0.12.7 with the latest Sails patches applied. Post back here if anyone sees different.

dapriett commented 9 years ago

@sgress454 I upgraded to node 0.12.7 - so do we need to wait for sails 0.12.0 release before we see the fix? Looks like it still does it with sails 0.11.0.

sgress454 commented 9 years ago

@dapriett right--the fix was merged in to the master branch in 88ffc0e, but hasn't been published yet. We were hoping to get v0.12 out this month but got sidetracked by some non-Sails matters. Definitely want to get it out ASAP. In the meantime installing from Github should fix it.

ksylvan commented 9 years ago

+1 same issue for me.

Sails 0.11.0 and node 0.12.7 with node-inspector 0.12.2.

wassimsalib commented 9 years ago

+1 Same issue Sails 0.11.0, Node 0.12.7 and node-inspector 0.11.1

misterch0c commented 9 years ago

+1 but for me it happened with "sails lift", this is how I solved it

unkn0wn@archie{~/web/betsails}:lsof -i:1337
COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    5961 unkn0wn   27u  IPv6 234934      0t0  TCP *:menandmice-dns (LISTEN)
node    5961 unkn0wn   28u  IPv6 234938      0t0  TCP localhost.localdomain:menandmice-dns->localhost.localdomain:47931 (CLOSE_WAIT)
node    5961 unkn0wn   30u  IPv4 234946      0t0  TCP localhost.localdomain:34789->localhost.localdomain:menandmice-dns (ESTABLISHED)
node    5961 unkn0wn   33u  IPv6 234949      0t0  TCP localhost.localdomain:menandmice-dns->localhost.localdomain:34789 (ESTABLISHED)
unkn0wn@archie{~/web/betsails}:kill -9 5961
unkn0wn@archie{~/web/betsails}:lsof -i:1337
[1]+  Killed                  sails lift
unkn0wn@archie{~/web/betsails}:sails lift

info: Starting app...

info: 
info:                .-..-.
info: 
info:    Sails              <|    .-..-.
info:    v0.11.0             |\
info:                       /|.\
info:                      / || \
info:                    ,'  |'  \
info:                 .-'.-==|/_--'
info:                 `--'-------' 
info:    __---___--___---___--___---___--___
info:  ____---___--___---___--___---___--___-__
info: 
info: Server lifted in `/home/unkn0wn/web/betsails`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
sgress454 commented 9 years ago

Ladies and gentlemen, I'm locking this issue. It's been solved. We'll push out v0.12 as soon as we can, but putting +1 here just obscures the fact that a patch has been made. You can apply it yourself by replacing your Sails' /lib/hooks/grunt/index.js file with the contents of https://raw.githubusercontent.com/balderdashy/sails/88ffc0ed9949f8c74ea390efb5610b0e378fa02c/lib/hooks/grunt/index.js; this is the file that will be in the next release, so it's safe to use now.