pmaji / crypto-whale-watching-app

Python Dash app that tracks whale activity in cryptocurrency markets.
MIT License
605 stars 137 forks source link

app.py cannot work and got the error 'message': 'Failed to subscribe', 'reason': 'No channels provided' #112

Closed chuanyinhuang closed 4 years ago

chuanyinhuang commented 4 years ago

Hi @pmaji,

When I try to launch app.py then I got some exception as below,

127.0.0.1 - - [16/Oct/2019 01:16:10] "POST /_dash-update-component HTTP/1.1" 200 -
Exception in thread Thread-65:
Traceback (most recent call last):
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python37-32\lib\site-packages\cbpro\websocket_client.py", line 41, in _go
    self._listen()
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python37-32\lib\site-packages\cbpro\websocket_client.py", line 91, in _listen
    self.on_message(msg)
  File "C:\Users\Alex\Desktop\crypto-whale-watching-app-master\gdax_book.py", line 21, in on_message
    sequence = message['sequence']
**KeyError: 'sequence'**

Then I set a break point at

    def on_message(self, message):
        sequence = message['sequence']

to figure out what happens, then I got the error as below, <class 'dict'>: {'type': 'error', 'message': 'Failed to subscribe', 'reason': '**No channels provided**'}

Could you give me guidance on how to solve this problem? Thank you.

pmaji commented 4 years ago

Hmmm @chuanyinhuang I'm not entirely sure about this one. So getting errors about failure to subscribe is actually quite normally. Sadly, the APIs we're using aren't that great from a tps perspective, and we use a couple third-party packages for the data pulls that can be less than 100% reliable. That said, this shouldn't be breaking (it isn't for me and many others), so that makes me suspect there's something fishy with either your environment or package versions, etc.

My advice would be to start up a new virtual environment (conda or otherwise) and then install packages only based on the requirements.txt. Then once that is working without a problem, run the app out of the virtual environment and give it maybe 2ish minutes total (that's the absolute LONGEST it should probably take to get all the connections set), and then go to your local host to be sure it's running. Aside from that, I don't have any sage advice I'm afraid. Hope this helps som!

pmaji commented 4 years ago

Closing this for now. If you feel the need to re-open later on feel free.