strongloop-community / loopback-example-pubsub

Example of using strong-pubsub with LoopBack
Other
23 stars 13 forks source link

Running this project crashes the server when opening the page #2

Closed beeman closed 9 years ago

beeman commented 9 years ago

As the title says running this project crashes the server with the error message below:

$ node server/server.js
Browse your REST API at http://0.0.0.0:3000/explorer
Web server listening at: http://0.0.0.0:3000/
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: connect ECONNREFUSED
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
kennethlynne commented 9 years ago

+1

danielfbm commented 9 years ago

+1

vizo commented 9 years ago

+1 When you open http://0.0.0.0:3000 ....

superkhau commented 9 years ago

The instructions were missing a few steps. Please clone again and let me know if you run into any issues.

  1. Browserify was missing.
  2. No instructions for running gulp was present in the readme file
beeman commented 9 years ago

@superkhau thanks for looking into this issue.

It still fails with the same error in my shell. The complete output of all the steps I took can be found here https://gist.github.com/beeman/394626bd9cbefff740c1

Below is what I see when I open the project in my browser:

screen shot 2015-08-19 at 10 18 29
vizo commented 9 years ago

@superkhau i did that all by my self before ... but it was still the same ... If i add to server.js:

process.on('uncaughtException', function (err) {
});

Everything works ....

I am guessing the problem is that primus is trying to connect to ws://null, but ofcourse server doesn't exist (it throws error), and it starts polling ...

I couldn't find where this null comes from.

superkhau commented 9 years ago

@beeman @vizo I tried it again, I'm also running into the two issues you guys stated. Escalating.

@ritch This example is failing. We also need better instructions in the README.md. Do you know what's going on?

beeman commented 9 years ago

Confirmed that the instructions that @ritch added about installing mosquitto helped me to get a working system.

On OS X it takes a bit more to start mosquitto, the package installed with homebrew does not seem to add the binary to the path. I thus followed the instructions after installing the package:

$ brew install mosquitto
    <snip>

$ mosquitto
zsh: command not found: mosquitto

$ mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
zsh: command not found: mosquitto

$ ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents
/Users/beeman/Library/LaunchAgents/homebrew.mxcl.mosquitto.plist -> /usr/local/opt/mosquitto/homebrew.mxcl.mosquitto.plist

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mosquitto.plist
superkhau commented 9 years ago

This has been fixed in #6. Please let me know if any of you guys still run into issues and thanks @ritch.

vizo commented 9 years ago

Seems all ok ...