rdavydov / Twitch-Channel-Points-Miner-v2

[NEW] A simple script that will watch a stream for you and earn the channel points. A successor of Tkd-Alex's original repo.
GNU General Public License v3.0
1.21k stars 352 forks source link

Analytics page index out of range #328

Closed Psuedoo closed 1 year ago

Psuedoo commented 1 year ago

Describe the bug

When trying to access the analytics page I'm receiving:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/TwitchChannelPointsMiner/classes/AnalyticsServer.py", line 111, in read_json
    filter_datas(
  File "/usr/src/app/TwitchChannelPointsMiner/classes/AnalyticsServer.py", line 81, in filter_datas
    last_balance = df.drop(columns="datetime").sort_values(by=["x", "y"], ascending=True).to_dict("records")[-1]['y']
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range

Steps to reproduce

  1. Clone repo
  2. Create run.py
  3. Use example docker-compose data
  4. Access fresh analytics page

Expected behavior

It to display data on analytics page and not error

Operating system

Ubuntu 22.04

Python version

3.10

Miner version

1.8.4

Other relevant software versions

No response

Logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/TwitchChannelPointsMiner/classes/AnalyticsServer.py", line 111, in read_json
    filter_datas(
  File "/usr/src/app/TwitchChannelPointsMiner/classes/AnalyticsServer.py", line 81, in filter_datas
    last_balance = df.drop(columns="datetime").sort_values(by=["x", "y"], ascending=True).to_dict("records")[-1]['y']
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range

Additional context

No response

rdavydov commented 1 year ago

Those are not logs, that is your console output.

rdavydov commented 1 year ago

Most likely your analytics *.json file is broken. Make a backup of your analytics folder and remove the folder, then start the miner again.

Psuedoo commented 1 year ago

Removed the analytics folder and now the dashboard works. Thanks.