EADDRINUSE problem

81 views
Skip to first unread message

Chris Etheridge

unread,
Feb 14, 2014, 3:05:25 PM2/14/14
to clou...@googlegroups.com
Hi

No matter what I change the port to, I always get an 'EADDRINUSE' error when running my node app. 

Here is a copy of my code: http://pastebin.com/i1Ny5N9m

I have currently hard coded the port, but that doesn't seem to do the trick either.

Chris

Hans J. Schroeder

unread,
Feb 15, 2014, 3:31:51 AM2/15/14
to clou...@googlegroups.com
Hi Chris,

The listening port you should use is determined by the platform and stored in the environment.
Please change the following line:

  1. var server = app.listen(9662);
to
  1. var server = app.listen(process.env.app_port || 8080);

That way your app uses the right port on Cloudnode and 8080 elsewhere.
 


--
You received this message because you are subscribed to the Google Groups "Cloudnode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudnode+...@googlegroups.com.
To post to this group, send email to clou...@googlegroups.com.
Visit this group at http://groups.google.com/group/cloudnode.
For more options, visit https://groups.google.com/groups/opt_out.

Facundo Farias

unread,
Feb 15, 2014, 6:39:57 PM2/15/14
to clou...@googlegroups.com
Hi Hans.
I've done the PORT trick, but it doesnt work for me -> process.env.app_port || 8080
I mean, I did not receive any failure message, instead I receive a log that says: 

Application Log


16 Feb 00:32:12 - Inside Node Virtual Machine
16 Feb 00:32:12 - Version: v0.10.21
16 Feb 00:32:12 - Owning user: 501
16 Feb 00:32:12 - User Changed: 501
16 Feb 00:32:12 - Checking for /etc
16 Feb 00:32:12 - Update /etc/resolve.conf with Googles DNS servers..
16 Feb 00:32:12 - Checking for /tmp
16 Feb 00:32:12 - Checking for /mnt
16 Feb 00:32:12 - Setting up sandbox..
16 Feb 00:32:12 - Munging require paths..
16 Feb 00:32:12 - Globalizing Buffer
16 Feb 00:32:12 - Reading startup file server.js...
16 Feb 00:32:12 - Final user check: 501
16 Feb 00:32:12 - Cloudnode wrapped script starting (20865) at Sun Feb 16 2014 00:32:12 GMT+0100 (UTC)
Server started at http://h1854779:16336
I cant find where my app is deployed. When I go to: http://markeysurvey.cloudno.de/ it says 

Application is offline

Thanks!

Chris Etheridge

unread,
Feb 16, 2014, 12:42:15 PM2/16/14
to clou...@googlegroups.com
Hi Hans,

I made those changes but still get the same error.

Hans J. Schroeder

unread,
Feb 23, 2014, 3:58:10 AM2/23/14
to clou...@googlegroups.com
Please add the app names, so that I can have a look. One app seems to be markeysurvey, that one is stopped now.


On Sun, Feb 16, 2014 at 6:42 PM, Chris Etheridge <krizz...@gmail.com> wrote:
Hi Hans,

I made those changes but still get the same error.

--

Facundo Farias

unread,
Feb 23, 2014, 9:05:35 AM2/23/14
to clou...@googlegroups.com
http://markeysurvey.cloudno.de/ this one it should be up and running (at least, that says the clounode console), but if I go to the URL doesn't work. Same app log than before.

Hans J. Schroeder

unread,
Feb 23, 2014, 9:38:07 AM2/23/14
to clou...@googlegroups.com
It seems to be a side effect from the framework you are using. The app is assigned to port 9664. Are you sure, that you are using the framework correctly? I don't see a listening loop with that port. 

Facundo Farias

unread,
Feb 23, 2014, 9:40:47 AM2/23/14
to clou...@googlegroups.com
You mean that I should use the port 9664?
I am running the same app locally and works perfect. Also, I've tried Heroku and Nodejitsu, and are working. Is that enough? 


--
You received this message because you are subscribed to a topic in the Google Groups "Cloudnode" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cloudnode/lfEQLgEUVFM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cloudnode+...@googlegroups.com.

Hans J. Schroeder

unread,
Feb 23, 2014, 10:12:44 AM2/23/14
to clou...@googlegroups.com
Yes, give it a try. But env.app_port should also be set to 9664.

Hans J. Schroeder

unread,
Feb 23, 2014, 10:24:16 AM2/23/14
to clou...@googlegroups.com
There is obviously something wrong with listening command. Your app's output is:

Server started at http://h1854779:16336

 That is not the configured port. Can you also set the host, just to be sure:


var Hapi = require('hapi');
var server = new Hapi.Server(process.env.app_host, process.env.app_port | 8000);
- Hans

Facundo Farias

unread,
Feb 23, 2014, 10:46:32 AM2/23/14
to clou...@googlegroups.com

Thanks for you support Hans. It's up and running now.
I had to use the port configuration explicitly, otherwise it doesn't work, in this way: var PORT = 9664;

Thanks a lot :)
Reply all
Reply to author
Forward
0 new messages