heroku-examples / go-websocket-chat-demo

102 stars 49 forks source link

Used to work but now it doesn't #2

Closed ghost closed 8 years ago

ghost commented 8 years ago

I had this working before with a fork I created and it worked great three months ago. But cloning and deploying to Heroku (existing and new Dynos) results in a application crash after some in-browser WS weirdness when users try to actually chat. Again, this used to work great before.

screen shot 2016-06-13 at 5 40 40 pm

Any ideas what happened?

Here's an example error shown in the logs before the app crashes:

2016-06-13T23:30:31.196804+00:00 app[web.1]: time="2016-06-13T23:30:31Z" level=error msg="Error while subscribed to Redis channel chat" err="dial tcp: missing address" 
freeformz commented 8 years ago

It seems like maybe it's trying to connect to the redis server and failing? If you tell me the app name I can go and check more.

ghost commented 8 years ago

@freeformz thanks for the quick response. blooming-woodland-34351. I backed up history to the head of the upstream repo and used the toolbelt to push the app here: http://lumpen-chat.habd.as/

ghost commented 8 years ago

Going to give this a shot locally and see if I can get it working with dlite this time around.

freeformz commented 8 years ago

So the problem with blooming-woodland-34351 is that there is no redis addon attached. The sample app uses redis to relay messages between instances. To resolve try this:

$ heroku addons:add heroku-redis
$ heroku redis wait
$ heroku restart
$ heroku open

I recently deployed this app to https://limitless-coast-14277.herokuapp.com/ and it worked.

ghost commented 8 years ago

@freeformz thanks. that fixed the problem and helped me continue to appreciate the CLI more 😺

freeformz commented 8 years ago

Great. It's probably all possible via the dashboard as well, but it's harder to script and relay that to others. I should also modify the program to output a better set of errors as well. Btw: how was the app created? With a button? Or via the cli?

On June 14, 2016 at 15:15:45, Josh Habdas (notifications@github.com) wrote:

@freeformz https://github.com/freeformz thanks. that fixed the problem and helped me continue to appreciate the CLI more 😺

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/heroku-examples/go-websocket-chat-demo/issues/2#issuecomment-226032770, or mute the thread https://github.com/notifications/unsubscribe/AAAAZ19o3rsqkej5jcovf-4tN05eBSN_ks5qLygRgaJpZM4I0zo6 .

ghost commented 8 years ago

This one was created via CLI after I wiped the last one after it fell over. Guessing I simply missed creating and attaching Redis this time around. I should probably add the Heroku steps to a related blog post I wrote so I don't forget next time.