typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.98k stars 424 forks source link

A fresh installation throws ERR_CONNECTION_REFUSED #300

Closed THPubs closed 6 years ago

THPubs commented 6 years ago

I just installed hotel in a new machine and from any browser I can't access the tool. It says This site can’t be reached. ERR_CONNECTION_REFUSED. In the daemon.log I can see the following error:

/Users/pubudu/.config/yarn/global/node_modules/eventemitter3/index.js:60
    throw new TypeError('The listener must be a function');
    ^

TypeError: The listener must be a function
    at addListener (/Users/pubudu/.config/yarn/global/node_modules/eventemitter3/index.js:60:11)
    at ProxyServer.on (/Users/pubudu/.config/yarn/global/node_modules/eventemitter3/index.js:228:10)
    at new Group (/Users/pubudu/.config/yarn/global/node_modules/hotel/lib/daemon/group.js:33:17)
    at module.exports (/Users/pubudu/.config/yarn/global/node_modules/hotel/lib/daemon/group.js:23:24)
    at Object.<anonymous> (/Users/pubudu/.config/yarn/global/node_modules/hotel/lib/daemon/index.js:13:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
/Users/pubudu/.config/yarn/global/node_modules/eventemitter3/index.js:60
    throw new TypeError('The listener must be a function');
    ^

Any idea what's happening?

djanowski commented 6 years ago

This seems to be a regression with http-proxy 1.17.

jameswlane commented 6 years ago

Fresh install also:

TypeError: The listener must be a function
    at addListener (/Users/jameswlane/.nvm/versions/node/v8.10.0/lib/node_modules/hotel/node_modules/eventemitter3/index.js:60:11)
    at ProxyServer.on (/Users/jameswlane/.nvm/versions/node/v8.10.0/lib/node_modules/hotel/node_modules/eventemitter3/index.js:228:10)
    at new Group (/Users/jameswlane/.nvm/versions/node/v8.10.0/lib/node_modules/hotel/lib/daemon/group.js:33:17)
    at module.exports (/Users/jameswlane/.nvm/versions/node/v8.10.0/lib/node_modules/hotel/lib/daemon/group.js:23:24)
    at Object.<anonymous> (/Users/jameswlane/.nvm/versions/node/v8.10.0/lib/node_modules/hotel/lib/daemon/index.js:13:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
/Users/jameswlane/.nvm/versions/node/v8.10.0/lib/node_modules/hotel/node_modules/eventemitter3/index.js:60
    throw new TypeError('The listener must be a function');
    ^
typicode commented 6 years ago

Thanks for the heads up, it should be better with Hotel v0.8.6 :)

osman-mohamad commented 5 years ago

I have the same error and I use v0.8.7 on ubuntu

this is the error

Exiting
Stop daemon
Remove pid file
events.js:165
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::2001
    at Server.setupListenHandle [as _listen2] (net.js:1346:14)
    at listenInCluster (net.js:1387:12)
    at Server.listen (net.js:1475:7)
    at ProxyServer.listen (/home/dev/.nvm/versions/node/v9.11.1/lib/node_modules/hotel/node_modules/http-proxy/lib/http-proxy/index.js:136:16)
    at Object.<anonymous> (/home/dev/.nvm/versions/node/v9.11.1/lib/node_modules/hotel/lib/daemon/index.js:46:7)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
Emitted 'error' event at:
    at emitErrorNT (net.js:1366:8)
    at process._tickCallback (internal/process/next_tick.js:178:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:697:11)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
j-f1 commented 5 years ago

Looks like you already have something running on port 2001.

osman-mohamad commented 5 years ago

@j-f1 where the 2001 port is used by hotel ?

j-f1 commented 5 years ago

The proxy server uses port conf.port + 1. If you change the port in ~/.hotel/conf.json, you should be able to get rid of the error, although you’ll need to reconfigure your proxy settings.

osman-mohamad commented 5 years ago

@j-f1 the error is gone in the daemon.log file . but the problem is still here. and I opened a new issue about it .