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

PoloniexApiError: Unknown error. Requesting returnLoanOrders #206

Closed laxdog closed 7 years ago

laxdog commented 7 years ago

This could be (and probably is) a duplicate of https://github.com/Mikadily/poloniexlendingbot/issues/205 just manifesting itself differently.

I saw these two errors today on head of master:

(notifications) :( Tue Jan 31 13:38:30 dog@virtualpoo:~/poloniexlendingbot (10 files, 82k total)(0)
> python /home/dog/poloniexlendingbot/lendingbot.py
Welcome to Poloniex Lending Bot
Started WebServer, lendingbot status available at http://localhost:33221/lendingbot.html
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/dog/poloniexlendingbot/modules/MarketAnalysis.py", line 57, in update_market_loop
    update_markets()
  File "/home/dog/poloniexlendingbot/modules/MarketAnalysis.py", line 66, in update_markets
    raw_data = api.return_loan_orders(cur, 5)['offers'][0]
  File "/home/dog/poloniexlendingbot/modules/Poloniex.py", line 226, in return_loan_orders
    return self.api_query('returnLoanOrders', {"currency": currency, "limit": limit})
  File "/home/dog/poloniexlendingbot/modules/Poloniex.py", line 92, in api_query
    return _read_response(ret)
  File "/home/dog/poloniexlendingbot/modules/Poloniex.py", line 71, in _read_response
    raise PoloniexApiError(data['error'])
PoloniexApiError: Unknown error. Requesting returnLoanOrders

Have Polo made some changes recently maybe?

I'm running inside pdb now to try and catch it for a look.

rnevet commented 7 years ago

Couldn't be an API change as that function is a basic requirement for the bot to work, mine is working. I did get some timeouts from the server, but "Unknown error." is a server side error in this case, so you did get a response.

Could be related to #205 both indicate some weird unexpected server side issue.

laxdog commented 7 years ago

I forgot to post the other error I got

> python /home/dog/poloniexlendingbot/lendingbot.py
Error: You entered an incorrect currency: 'DOGE' to analyse the market of, please check your settings. Error message: Unknown error. Requesting returnLoanOrders

Bot worked fine after a restart, no code / config changes.

rnevet commented 7 years ago

@Evanito - Misleading error handling.

@laxdog same error "Unknown error. Requesting returnLoanOrders"

Evanito commented 7 years ago

Yeah I agree, that is supposed to check for errors when requesting coins but didn't take into account that Poloniex's API may not always be perfect.

laxdog commented 7 years ago

I think this can be closed too as part of https://github.com/Mikadily/poloniexlendingbot/pull/233