1

I am developing an application based on MEAN.IO, it works fine on my local Windows 7 machine, so I want to publish the app.

I have a remote Redhat 6.5 virtual machine (VM) server which can be used to host my application for public access. After uploading and run the app with grunt, it stops with an error:


$ grunt

Running "hook" task

Starting hooked tasks.

Running "clean:0" (clean) task

0 paths cleaned.

Running "jshint:all" (jshint) task

42 files lint free.

Running "csslint:src" (csslint) task

5 files lint free.

Running "concurrent:tasks" (concurrent) task Running "watch" task Waiting...

Running "nodemon:dev" (nodemon) task

[nodemon] v1.2.1

[nodemon] to restart at any time, enter rs

[nodemon] watching: .

[nodemon] starting node --debug server.js

debugger listening on port 5858

events.js:72

    throw er; // Unhandled 'error' event

          ^

Error: getaddrinfo ENOTFOUND

at errnoException (dns.js:37:11)

at Object.onanswer [as oncomplete] (dns.js:124:16)

[nodemon] app crashed - waiting for file changes before starting...



I also tried to clone the code into the server directly from https://github.com/linnovate/mean.git, without ANY changes and run the app, but I got the same error as above.

I tried run node server.js instead of grunt, I got similar errors as below:



[jking@server eclipse_test]$ node server.js

for real!

forking 0

forking 1

forking 2

forking 3

events.js:72

    throw er; // Unhandled 'error' event

          ^

Error: getaddrinfo ENOTFOUND

at errnoException (dns.js:37:11)

at Object.onanswer [as oncomplete] (dns.js:124:16)

Worker 3 died :(

events.js:72

    throw er; // Unhandled 'error' event

          ^

Error: getaddrinfo ENOTFOUND

at errnoException (dns.js:37:11)

at Object.onanswer [as oncomplete] (dns.js:124:16)

Worker 2 died :(

...

__________________________________________________________

I don't know if it is due to the virtual machine or the mean.io stack.

Can someone give me any clue or answer to resolve it?

thanks

-John

King John
  • 11
  • 2
  • Can you just run the node server alone? Outside of the grunt task? – Tony Mar 11 '15 at 22:50
  • The fact that `dns.js` is throwing the error leads me to believe that the issue is with the VM. I can't really be of more help. Sorry. – Tony Mar 12 '15 at 16:33

1 Answers1

0

I had the same problem and struggled all day with it until I found this: https://forums.aws.amazon.com/thread.jspa?messageID=622248

Basically in my instance Amazon's linux image did not have the computer name associated with 127.0.0.1.

My instance was named ip-10-0-0-117 so I changed /etc/hosts from: 127.0.0.1 localhost localhost.localdomain

into

127.0.0.1 localhost localhost.localdomain ip-10-0-0-117

and everything works!

Aron23
  • 23
  • 6