Migrating app to Google Cloud getting Error: listen EADDRNOTAVAIL

498 views
Skip to first unread message

Diandra Adikusuma

unread,
Jul 1, 2016, 2:03:51 PM7/1/16
to gce-discussion

I said on title "migrating", so this is full working production Node.js app on other VM.


I'm trying to deploy my app to Google Cloud with the same working bundle and the same server spec and configuration on other VM. When I start my app, I've got following error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRNOTAVAIL
    at errnoException (net.js:905:11)
    at Server._listen2 (net.js:1024:19)
    at listen (net.js:1065:10)
    at net.js:1147:9
    at dns.js:72:18
    at process._tickCallback (node.js:448:13)


This is environment variable on current VM:

export MONGO_URL="mongodb://db-user:db-password@db-ip-address:27017/db-name"
export ROOT_URL="https://myapp.com"
export BIND_IP="server-ip-address"
export PORT="80"


This is environment variable on Google Cloud:

export MONGO_URL="mongodb://db-user:db-password@db-ip-address:27017/db-name"
export ROOT_URL="https://myapp.com"
export BIND_IP="external-ip-address"
export PORT="80"


Any help would be appreciated


Using internal ip address get rid the error, but now the app cannot be accessed.

export BIND_IP="internal-ip-address"


ADDITIONAL NOTE

Instance configuration:

gcloud compute instances create "my-app" --machine-type "f1-micro" --image-family "centos-7" --image-project "centos-cloud" --address "assigned-static-external-ip-address" --can-ip-forward

Kamran (Google Cloud Support)

unread,
Jul 1, 2016, 6:48:11 PM7/1/16
to gce-discussion
Hello Diandra,

Use the following configuration and this should resolve the issue:

export BIND_IP="0.0.0.0"

Please let me know if you have any further questions.

Sincerely,
Reply all
Reply to author
Forward
0 new messages