Closed mysticaltech closed 5 years ago
And this problem too, before the error was a 404, and now a 503, in both cases it crashed. It needs to be more robust man! Please.
2018-12-07 12:23:19,363 DEBUG: [12:23:19][0x00007fbe99d9e780][info] net | x16r | Share #770 accepted
2018-12-07 12:23:26,665 WARNING: NiceHash stats: HTTP Error 503: Service Unavailable
2018-12-07 12:23:26,714 DEBUG: [12:23:26][0x00007fbe957b7700][info] net | x16r | Share #771 accepted
2018-12-07 12:23:26,918 DEBUG: [12:23:26][0x00007fbe99d9e780][info] net | x16r | Share #772 accepted
2018-12-07 12:23:33,959 DEBUG: [12:23:33][0x00007fbe957b7700][info] net | x16r | New job '00000136b2a6cfbf', diff=0.0625
2018-12-07 12:23:38,210 DEBUG: [12:23:38][0x00007fbe99d9e780][info] net | x16r | Share #773 accepted
2018-12-07 12:23:45,701 DEBUG: [12:23:45][0x00007fbe957b7700][info] net | x16r | Share #774 accepted
2018-12-07 12:24:01,329 DEBUG: [12:24:01][0x00007fbe99d9e780][info] net | x16r | Share #775 accepted
2018-12-07 12:24:05,110 DEBUG: [12:24:05][0x00007fbe957b7700][info] net | x16r | Share #776 accepted
2018-12-07 12:24:06,723 DEBUG: [12:24:06][0x00007fbe99d9e780][info] net | x16r | Share #777 accepted
2018-12-07 12:24:17,171 DEBUG: [12:24:17][0x00007fbe957b7700][info] net | x16r | Share #778 accepted
2018-12-07 12:24:19,970 DEBUG: [12:24:19][0x00007fbe99d9e780][info] net | x16r | New job '00000136b2a7180c', diff=0.0625
Traceback (most recent call last):
File "/usr/bin/nuxhashd", line 11, in <module>
load_entry_point('nuxhash==1.0.0b2', 'console_scripts', 'nuxhashd')()
File "/usr/lib/python3.6/site-packages/nuxhash/__init__.py", line 3, in nuxhashd
main()
File "/usr/lib/python3.6/site-packages/nuxhash/daemon.py", line 108, in main
session.run()
File "/usr/lib/python3.6/site-packages/nuxhash/daemon.py", line 266, in run
self._scheduler.run()
File "/usr/lib64/python3.6/sched.py", line 154, in run
action(*argument, **kwargs)
File "/usr/lib/python3.6/site-packages/nuxhash/daemon.py", line 275, in _switch_algos
ret_payrates, stratums = nicehash.simplemultialgo_info(self._settings)
File "/usr/lib/python3.6/site-packages/nuxhash/nicehash.py", line 45, in simplemultialgo_info
response = api_call('simplemultialgo.info', [])
File "/usr/lib/python3.6/site-packages/nuxhash/nicehash.py", line 33, in api_call
raise NicehashAPIError(result)
nuxhash.nicehash.NicehashAPIError: {'error': 'Not ready yet.'}
2018-12-07 12:24:26,960 CRITICAL: Crash! Killing all miners.
Killed
Here's a great article about retrying in Python https://julien.danjou.info/python-retrying/
Hey, sorry for the delay. This fix should cover the last few cases I missed.
To clarify, the code is designed to retry on network or API failure. The daemon polls NiceHash every 60 (exact number is configurable) seconds, and if there's an error condition, it maintains the current algorithm selections and leaves excavator to its own devices. Then it polls NiceHash again after the next 60-second interval.
The reason we keep getting these crashes is because I'm forgetting about some of the more obscure Python error classes - including, apparently, the ones I made myself.
Do let me know if this happens again!
Awesome man! Thanks and keep up the good work. Will keep you posted if I see any other errors popping out.
Hey Ryan, with the latest version from master, it still crashes but this time when the nicehash api is not available. If you could implement a retry with an exponential backoff, it would become more robust, and keep on mining when the api comes back online. Most online services have downtimes, it's normal. I really do not code python, otherwise I would have tried implementing it myself. Thanks!