anselal / antminer-monitor

Cryptocurrency ASIC mining hardware monitor using a simple web interface
GNU General Public License v3.0
230 stars 146 forks source link

KeyError: 'POOLS' #139

Closed red0bear closed 4 years ago

red0bear commented 6 years ago

Well i got error now ....

builtins.IndexError IndexError: list index out of range

anselal commented 6 years ago

@red0bear i must connect to your pc to debug it.

red0bear commented 6 years ago

@anselal this what you want is dangerous. i think we need another way to provide you what you need .

anselal commented 6 years ago

I have done this many times. Sorry if you dont trust me but there is no other way.

red0bear commented 6 years ago

Hehehe .... lets stay with error for while.

anselal commented 6 years ago

As you wish

fcabrera1109 commented 6 years ago

anselal I think the biggest issue is not the fact that there are bugs but the fact that the entire things breaks when something it does not like,. I can't even go back and remove a miner that cause the issue I have to start from scratch. Any idea why you didn't use mysql backend so I could login and delete a trebled miner from the db?

anselal commented 6 years ago

As you say, if you want to delete a miner to fix the error tjan the problem is the miner and not the software. Besides that you can edit the sqlite3 database too. In fact it is more easily as mysql.

And to answer your question, i used sqlite3 because it doesn't need any setup from the users side. You can point the database to a mysql if you want and it will work. It will also create the tables 4 you.

devilz696 commented 5 years ago

Hi! got same error at ~180 miner. Any working solutions? Python 3.6.6

Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2309, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2295, in wsgi_app response = self.handle_exception(e) File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.6/dist-packages/flask_login/utils.py", line 261, in decorated_view return func(*args, **kwargs) File "/var/antminer-monitor/antminermonitor/blueprints/asicminer/views/antminer.py", line 113, in miners for chain in miner_stats['STATS'][1].keys() IndexError: list index out of range

anselal commented 5 years ago

@devilz696 According to your output it crashes while trying to filter the ASIC chips.

It could be due to socket timeout, error on miner API. You could try to increase the socket timeout to a value like 5 or 10 like I describe above at https://github.com/anselal/antminer-monitor/issues/139#issuecomment-435684717

Please let me know if that helped.

@red0bear Any feedback ???

devilz696 commented 5 years ago

@anselal tryed timeout = 10, nothing has changed :(

anselal commented 5 years ago

@devilz696 did the error appear after you added a miner ?

Perhaps the miner's API has some issues

anselal commented 5 years ago

If yes, there is a way to check if the API has indeed some issues. Also, there is a way to remove the miner from the database if you know your way with python. If not I can assist you by connecting to your machine and remote the miner from the database

red0bear commented 5 years ago

@anselal @devilz696 ... here still give error but after did change in code i can recover the error.

anselal commented 5 years ago

@red0bear would you share the change you made in the code to check if I can merge it with my codebase and close this issue ?

red0bear commented 5 years ago

@anselal

the change anselal had me make worked.

in antminer.py make a change

pool for pool in miner_pools['POOLS'] if pool['Stratum Active']

to @pool for pool in miner_pools['POOLS'] #if pool['Stratum Active']

and try again .

This solution still given error ... but you can recover and back to see machines .....

anselal commented 5 years ago

@devilz696 can you try this ?