edeng23 / binance-trade-bot

Automated cryptocurrency trading bot
GNU General Public License v3.0
7.88k stars 2.19k forks source link

Error while scouting... Traceback (most recent call last) #223

Closed BitcoinerInCanada closed 3 years ago

BitcoinerInCanada commented 3 years ago

I am not sure if this is was reported before but my bot was working fine for several hours then it started glitching out by giving the following feedback:

Error while scouting... Traceback (most recent call last): File "/home/pi/git/binance-trade-bot/binance_trade_bot/scheduler.py", line 25, in _run_job super()._run_job(job) File "/home/pi/.local/lib/python3.7/site-packages/schedule/init.py", line 147, in _run_job ret = job.run() File "/home/pi/.local/lib/python3.7/site-packages/schedule/init.py", line 491, in run ret = self.job_func() File "/home/pi/git/binance-trade-bot/binance_trade_bot/auto_trader.py", line 128, in scout end="\r", OSError: [Errno 5] Input/output error

rel-s commented 3 years ago

Never seen this before - did this issue reproduce?

BitcoinerInCanada commented 3 years ago

It kept repeating the same error over and over again.I even tried to kill the process and restart the bot and it came back immediately.

I've since deleted the bot and downloaded everything again. The error has not come back.

larsvinter commented 3 years ago

This may be because of the wrong python version. Are you on the latest?

fmarzolo commented 3 years ago

Same here. I am running on Raspberry with Pyton version 3.7.3, trying upgrade

`2021-03-22 17:04:43.640498 - CONSOLE - INFO - I am scouting the best trades. Current coin: BEAMUSDT 2021-03-22 17:07:04.509159 - CONSOLE - INFO - I am scouting the best trades. Current coin: BEAMUSDT 2021-03-22 19:42:35,374 - crypto_trading_logger - ERROR - Error while scouting...ent coin: BEAMUSDT Traceback (most recent call last): File "/home/master/TelegramBots/trade/binance-trade-bot/binance_trade_bot/scheduler.py", line 25, in _run_job super()._run_job(job) File "/usr/local/lib/python3.7/dist-packages/schedule/init.py", line 147, in _run_job ret = job.run() File "/usr/local/lib/python3.7/dist-packages/schedule/init.py", line 491, in run ret = self.job_func() File "/home/master/TelegramBots/trade/binance-trade-bot/binance_trade_bot/auto_trader.py", line 156, in scout pair.to_coin, self.config.BRIDGE, False File "/home/master/TelegramBots/trade/binance-trade-bot/binance_trade_bot/binance_api_manager.py", line 42, in get_fee else self._buy_quantity(origin_coin.symbol, target_coin.symbol) File "/home/master/TelegramBots/trade/binance-trade-bot/binance_trade_bot/binance_api_manager.py", line 137, in _buy_quantity target_balance = target_balance or self.get_currency_balance(target_symbol) File "/home/master/TelegramBots/trade/binance-trade-bot/binance_trade_bot/binance_api_manager.py", line 76, in get_currency_balance for currency_balance in self.binance_client.get_account()["balances"]: File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 1767, in get_account return self._get('account', True, data=params) File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 237, in _get return self._request_api('get', path, signed, version, kwargs) File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 202, in _request_api return self._request(method, uri, signed, kwargs) File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 197, in _request return self._handle_response() File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 230, in _handle_response raise BinanceAPIException(self.response) binance.exceptions.BinanceAPIException: APIError(code=-1021): Timestamp for this request is outside of the recvWindow.

2021-03-22 20:32:55,368 - crypto_trading_logger - ERROR - Error while scouting...ent coin: BEAMUSDT `

BitcoinerInCanada commented 3 years ago

I am able to repeat it.

So I normally run the bot by SSHing into my raspberry pi and run the python script in the background by ending the command with &. When I close my SSH connection, I get the following error

Error while scouting... Traceback (most recent call last): File "/home/pi/git/binance-trade-bot/binance_trade_bot/scheduler.py", line 25, in _run_job super()._run_job(job) File "/home/pi/.local/lib/python3.7/site-packages/schedule/init.py", line 147, in _run_job ret = job.run() File "/home/pi/.local/lib/python3.7/site-packages/schedule/init.py", line 491, in run ret = self.job_func() File "/home/pi/git/binance-trade-bot/binance_trade_bot/auto_trader.py", line 128, in scout end="\r", OSError: [Errno 5] Input/output error

The only way for me to stop it is to kill the task and reopen the bot. I have to keep SSH running.

Pekafu commented 3 years ago

you should use screen https://linuxize.com/post/how-to-use-linux-screen/

Pekafu commented 3 years ago

File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 202, in _request_api return self._request(method, uri, signed, **kwargs) File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 197, in _request return self._handle_response() File "/usr/local/lib/python3.7/dist-packages/binance/client.py", line 230, in _handle_response raise BinanceAPIException(self.response) binance.exceptions.BinanceAPIException: APIError(code=-1021): Timestamp for this request is outside of the recvWindow.

2021-03-22 20:32:55,368 - crypto_trading_logger - ERROR - Error while scouting...ent coin: BEAMUSDT `

recvWindow is different issue, syncing time on your device should fix this issue