Node js Error: listen EADDRNOTAVAIL 52.**.**.***:1122












0














Node js application in local it works fine. When tried running in server it shows error.



ubuntu@ip-172-*-*-*:~/sample_nodejs$ node main.js
events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EADDRNOTAVAIL 52.34.48.146:1122
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1350:19)
at listenInCluster (net.js:1408:12)
at doListen (net.js:1517:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3


And here is my port running status. Used command netstat -tulpn



(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
-
tcp6 0 0 :::22 :::* LISTEN
-
tcp6 0 0 :::80 :::* LISTEN
-
udp 0 0 127.0.0.53:53 0.0.0.0:*
-
udp 0 0 172.*.*.*:68 0.0.0.0:* -


Tried changing iptables



sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000


still it shows the error. Is this server fault or i need ask permission for server side?
Any help much appreciated please!!










share|improve this question







New contributor




PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • EADDRNOTAVAIL Error mostly comes when our port is not available for use, can you just change the port for your code and re-run the application, also check that server is already runing or not by the command of ps aux | grep node iptables will not solve your problem,
    – radhey shyam
    2 days ago
















0














Node js application in local it works fine. When tried running in server it shows error.



ubuntu@ip-172-*-*-*:~/sample_nodejs$ node main.js
events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EADDRNOTAVAIL 52.34.48.146:1122
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1350:19)
at listenInCluster (net.js:1408:12)
at doListen (net.js:1517:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3


And here is my port running status. Used command netstat -tulpn



(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
-
tcp6 0 0 :::22 :::* LISTEN
-
tcp6 0 0 :::80 :::* LISTEN
-
udp 0 0 127.0.0.53:53 0.0.0.0:*
-
udp 0 0 172.*.*.*:68 0.0.0.0:* -


Tried changing iptables



sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000


still it shows the error. Is this server fault or i need ask permission for server side?
Any help much appreciated please!!










share|improve this question







New contributor




PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • EADDRNOTAVAIL Error mostly comes when our port is not available for use, can you just change the port for your code and re-run the application, also check that server is already runing or not by the command of ps aux | grep node iptables will not solve your problem,
    – radhey shyam
    2 days ago














0












0








0







Node js application in local it works fine. When tried running in server it shows error.



ubuntu@ip-172-*-*-*:~/sample_nodejs$ node main.js
events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EADDRNOTAVAIL 52.34.48.146:1122
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1350:19)
at listenInCluster (net.js:1408:12)
at doListen (net.js:1517:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3


And here is my port running status. Used command netstat -tulpn



(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
-
tcp6 0 0 :::22 :::* LISTEN
-
tcp6 0 0 :::80 :::* LISTEN
-
udp 0 0 127.0.0.53:53 0.0.0.0:*
-
udp 0 0 172.*.*.*:68 0.0.0.0:* -


Tried changing iptables



sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000


still it shows the error. Is this server fault or i need ask permission for server side?
Any help much appreciated please!!










share|improve this question







New contributor




PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Node js application in local it works fine. When tried running in server it shows error.



ubuntu@ip-172-*-*-*:~/sample_nodejs$ node main.js
events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EADDRNOTAVAIL 52.34.48.146:1122
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1350:19)
at listenInCluster (net.js:1408:12)
at doListen (net.js:1517:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3


And here is my port running status. Used command netstat -tulpn



(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
-
tcp6 0 0 :::22 :::* LISTEN
-
tcp6 0 0 :::80 :::* LISTEN
-
udp 0 0 127.0.0.53:53 0.0.0.0:*
-
udp 0 0 172.*.*.*:68 0.0.0.0:* -


Tried changing iptables



sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000


still it shows the error. Is this server fault or i need ask permission for server side?
Any help much appreciated please!!







networking server 18.04 nodejs aws






share|improve this question







New contributor




PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Dec 28 '18 at 5:14









PvDev

11




11




New contributor




PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






PvDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • EADDRNOTAVAIL Error mostly comes when our port is not available for use, can you just change the port for your code and re-run the application, also check that server is already runing or not by the command of ps aux | grep node iptables will not solve your problem,
    – radhey shyam
    2 days ago


















  • EADDRNOTAVAIL Error mostly comes when our port is not available for use, can you just change the port for your code and re-run the application, also check that server is already runing or not by the command of ps aux | grep node iptables will not solve your problem,
    – radhey shyam
    2 days ago
















EADDRNOTAVAIL Error mostly comes when our port is not available for use, can you just change the port for your code and re-run the application, also check that server is already runing or not by the command of ps aux | grep node iptables will not solve your problem,
– radhey shyam
2 days ago




EADDRNOTAVAIL Error mostly comes when our port is not available for use, can you just change the port for your code and re-run the application, also check that server is already runing or not by the command of ps aux | grep node iptables will not solve your problem,
– radhey shyam
2 days ago















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






PvDev is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1105060%2fnode-js-error-listen-eaddrnotavail-52-1122%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








PvDev is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















PvDev is a new contributor. Be nice, and check out our Code of Conduct.













PvDev is a new contributor. Be nice, and check out our Code of Conduct.












PvDev is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1105060%2fnode-js-error-listen-eaddrnotavail-52-1122%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

張江高科駅