SouthbankSoftware / dbkoda

State of the art MongoDB IDE
https://www.dbkoda.com
GNU Affero General Public License v3.0
870 stars 42 forks source link

Controller crash - unable to listen on port #70

Open mohag opened 3 years ago

mohag commented 3 years ago
2020-10-28T15:17:59+02:00 - error: Unhandled-exception:  { Error: listen EACCES 127.0.0.1:7001
    at Object.exports._errnoException (util.js:1024:11)
    at exports._exceptionWithHostPort (util.js:1047:20)
    at Server.setupListenHandle [as _listen2] (net.js:1302:19)
    at listenInCluster (net.js:1367:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1493:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
  code: 'EACCES',
  errno: 'EACCES',
  syscall: 'listen',
  address: '127.0.0.1',
  port: 7001 }

Netstat does not show anything listening on the port.

On my Windows 10 2004,

netsh interface ipv4 show excludedportrange protocol=tcp

includes this line in its output:

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      6953        7052

I'm not sure what those entries are for or whether they are the same on all PCs...

Ideally, a different port should be used if the error is encountered.

mohag commented 3 years ago

It seems like the code runs the portscanner module to check for a port that does not have something listening, however, this fails to detect the excluded port ranges, since they are reserved for some reason, without something listening on it.