handout icon indicating copy to clipboard operation
handout copied to clipboard

EADDRINUSE and EADDRNOTAVAIL

Open Nanashi-B opened this issue 3 years ago • 9 comments

hello i create certificate and add record dns to my domain name but i don't know why i have this error when running lib/handout.js

root@raspberrypi:/opt/handout# node lib/handout.js [debug] (webserver) Webserver opened at host myipaddress [debug] (authns) Authoritative Nameserver opened for domain cloud.dyfault. (node:2844) UnhandledPromiseRejectionWarning: Error: listen EADDRINUSE: address already in use 0.0.0.0:80 at Server.setupListenHandle [as _listen2] (net.js:1280:14) at listenInCluster (net.js:1328:12) at doListen (net.js:1461:7) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:834:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) (node:2844) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:2844) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:2844) UnhandledPromiseRejectionWarning: Error: listen EADDRNOTAVAIL: address not available 82.65.165.5:53 at Server.setupListenHandle [as _listen2] (net.js:1263:19) at listenInCluster (net.js:1328:12) at doListen (net.js:1461:7) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:834:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) (node:2844) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

Nanashi-B avatar Aug 31 '22 15:08 Nanashi-B

address already in use 0.0.0.0:80

do you have some other web server running already on port 80?

pinheadmz avatar Aug 31 '22 15:08 pinheadmz

nope only this one i have my domain on namebase with A record on namebase nameserver and NS, DS record on blockchain record

Nanashi-B avatar Aug 31 '22 16:08 Nanashi-B

well your operating system is telling you that port 80 is occupied.

also: [debug] (webserver) Webserver opened at host myipaddress -- that should be an IP address not a string:

--> node lib/handout.js 
[debug] (webserver) Webserver opened at host 123.201.32.45
[debug] (authns) Authoritative Nameserver opened for domain cool-domain.

pinheadmz avatar Aug 31 '22 16:08 pinheadmz

i put my public ip address but i don't know why my port 80 is occupied i only have apache2 web server

Nanashi-B avatar Aug 31 '22 16:08 Nanashi-B

node lib/handout.js

[debug] (webserver) Webserver opened at host 82.65.165.5
[debug] (authns) Authoritative Nameserver opened for domain cloud.dyfault.
(node:3188) UnhandledPromiseRejectionWarning: Error: listen EADDRINUSE: address already in use 0.0.0.0:80
    at Server.setupListenHandle [as _listen2] (net.js:1280:14)
    at listenInCluster (net.js:1328:12)
    at doListen (net.js:1461:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:3188) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3188) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:3188) UnhandledPromiseRejectionWarning: Error: listen EADDRNOTAVAIL: address not available 82.65.165.5:53
    at Server.setupListenHandle [as _listen2] (net.js:1263:19)
    at listenInCluster (net.js:1328:12)
    at doListen (net.js:1461:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:3188) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

Nanashi-B avatar Aug 31 '22 16:08 Nanashi-B

apache is probably running on port 80, you'll need to shut that down to use handout, which runs its own web server.

pinheadmz avatar Sep 01 '22 14:09 pinheadmz

hello i am retrying and i stop apache it's now okay for the ip address but i still have the error

root@raspberrypi:/opt/handout# node lib/handout.js

[debug] (webserver) Webserver opened at host 82.65.165.5
[debug] (authns) Authoritative Nameserver opened for domain cloud.dyfault.
(node:1564) UnhandledPromiseRejectionWarning: Error: listen EADDRNOTAVAIL: address not available 82.65.165.5:53
    at Server.setupListenHandle [as _listen2] (net.js:1263:19)
    at listenInCluster (net.js:1328:12)
    at doListen (net.js:1461:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:1564) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1564) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Nanashi-B avatar Sep 13 '22 17:09 Nanashi-B

Ok good. You're next issue is port 53 is protected so you may need to use sudo or setcap to allow handout (nodejs) to bind to that port

pinheadmz avatar Sep 14 '22 12:09 pinheadmz

Same here , EADDRNOTAVAIL: address not available :53 on public ip in Oracle and same on my home lan . only worked for 0.0.0.0. Thanks

wordfocus avatar Jan 05 '23 01:01 wordfocus