BitBotFactory / MikaLendingBot

Automated lending on Cryptocurrency exchanges Poloniex and Bitfinex
http://poloniexlendingbot.readthedocs.io/en/latest/index.html
MIT License
1.11k stars 344 forks source link

Gets stuck in this error loop: Error: <urlopen error [Errno -5] No address associated with hostname> Requesting returnActiveLoans #251

Closed taw00 closed 7 years ago

taw00 commented 7 years ago

I have not put my finger on this yet, but I have to periodically restart lending bot (I use systemd) because it seems to have a network issue(?) and then never recovers(?).

I am not sure if other people are seeing this. I will continue to troubleshoot and see if I can determine what is going on. Maybe it is me, but it seems like that connectivity and recovery from connectivity issues is not robust.

By the way, love the tool in general.

Mar 08 13:04:17 rh python[27026]: 2017-03-08 13:04:17 Error: <urlopen error [Errno -5] No address associated with hostname> Requesting returnActiveLoans
Mar 08 13:04:17 rh python[27026]: Traceback (most recent call last):
Mar 08 13:04:17 rh python[27026]:   File "/home/taw/Apps/poloniexlendingbot/lendingbot.py", line 69, in <module>
Mar 08 13:04:17 rh python[27026]:     Data.update_conversion_rates(output_currency, json_output_enabled)
Mar 08 13:04:17 rh python[27026]:   File "/home/taw/Apps/poloniexlendingbot/modules/Data.py", line 83, in update_conversion_rates
Mar 08 13:04:17 rh python[27026]:     total_lended = get_total_lended()[0]
Mar 08 13:04:17 rh python[27026]:   File "/home/taw/Apps/poloniexlendingbot/modules/Data.py", line 45, in get_total_lended
Mar 08 13:04:17 rh python[27026]:     crypto_lended = api.return_active_loans()
Mar 08 13:04:17 rh python[27026]:   File "/home/taw/Apps/poloniexlendingbot/modules/Poloniex.py", line 159, in return_active_loans
Mar 08 13:04:17 rh python[27026]:     return self.api_query('returnActiveLoans')
Mar 08 13:04:17 rh python[27026]:   File "/home/taw/Apps/poloniexlendingbot/modules/Poloniex.py", line 104, in api_query
Mar 08 13:04:17 rh python[27026]:     ret = urllib2.urlopen(urllib2.Request('https://poloniex.com/tradingApi', post_data, headers))
Mar 08 13:04:17 rh python[27026]:   File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
Mar 08 13:04:17 rh python[27026]:     return opener.open(url, data, timeout)
Mar 08 13:04:17 rh python[27026]:   File "/usr/lib64/python2.7/urllib2.py", line 429, in open
Mar 08 13:04:17 rh python[27026]:     response = self._open(req, data)
Mar 08 13:04:17 rh python[27026]:   File "/usr/lib64/python2.7/urllib2.py", line 447, in _open
Mar 08 13:04:17 rh python[27026]:     '_open', req)
Mar 08 13:04:17 rh python[27026]:   File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
Mar 08 13:04:17 rh python[27026]:     result = func(*args)
Mar 08 13:04:17 rh python[27026]:   File "/usr/lib64/python2.7/urllib2.py", line 1243, in https_open
Mar 08 13:04:17 rh python[27026]:     context=self._context)
Mar 08 13:04:17 rh python[27026]:   File "/usr/lib64/python2.7/urllib2.py", line 1200, in do_open
Mar 08 13:04:17 rh python[27026]:     raise URLError(err)
Mar 08 13:04:17 rh python[27026]: URLError: <urlopen error [Errno -5] No address associated with hostname>
Mar 08 13:04:17 rh python[27026]: Unhandled error, please open a Github issue so we can fix it!
rnevet commented 7 years ago

Why do you assume it doesn't recover? The bot reports errors than sleeps and continues...

taw00 commented 7 years ago

After watching this for awhile... It does eventually recover. It's just that the error is managed and messaged ungracefully. Tracebacks should only happen when things break, not for normal connection statuses.

Closing. The devs know about this... It works "well enough".

rnevet commented 7 years ago

I agree, we are trying to handle communication​ errors and poloniex errors more gracefully... It's a work in progress.

laxdog commented 7 years ago

@taw00 This is handled in https://github.com/Mikadily/poloniexlendingbot/pull/260