chrisleekr / binance-trading-bot

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis
MIT License
5.01k stars 1.1k forks source link

Mutliple TypeErrors #389

Closed salimj6 closed 2 years ago

salimj6 commented 2 years ago

Hello Chris,

i am getting all these errors after i restarted my machine, i tried building and pulling, same thing. Any idea?

image

chrisleekr commented 2 years ago

Hey @salimj6

Some people experienced this issue, but I haven't figured out why. A simple fix is following these steps.

The step is for RPi uses, if you are using RPi, that is good. If not, change docker-compose.rpi.yml to docker-compose.server.yml.

https://github.com/chrisleekr/binance-trading-bot/releases/tag/v0.0.83

If it fixes, please close the issue.

salimj6 commented 2 years ago

Hello again,

I upgraded and rebooted, now before i FLUSHALL the screen is stuck at loading.

image

After i FLUSHALL and restart, i lose the connection to 8080 completely. In addition when i run "docker logs binance-bot -f --tail=1000 | bunyan" i get dumps in Gigabytes, so I changed the tail to 1 and i still get huge amounts of data.

I tried to build the docker file locally to check if the problem might be resolved, but it still is the same.

chrisleekr commented 2 years ago

@salimj6

Click "Network" -> "WS" and refresh the browser. Then you will see Web socket connection. Click "Messages" and then give me the data starting with {result:....}

salimj6 commented 2 years ago

After the FLUSHALL, everything is empty. before the flushall i can get the messages:

{"result":true,"type":"connection_success","message":"You are successfully connected to WebSocket."} {"command":"latest","authToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoZW50aWNhdGVkQXQiOiIyMDIxLTEwLTIyVDA3OjE2OjU3LjAyMFoiLCJpYXQiOjE2MzQ4ODcwMTcsImV4cCI6MTYzNDg5NDIxN30.dGCiAo8lHNUtWX2Ix3-maRCDlz_VmBNFPHOWX0wX-m4","data":{}}

btw i have the same setup on a second machine, i usually am keeping it running without updates until i test the new release first. It also stopped refreshing and now it is stuck on the same issue. Might it be related to some info from tradingView or binance? one common thing i did today to both is i setup a cron to keep updating time because on wsl we are having a lot of drifting.

chrisleekr commented 2 years ago

After the FLUSHALL, everything is empty. before the flushall i can get the messages:

Doesn't matter about before flushall.

Try to refresh the browser and see the WS -> Message as I mentioned earlier.

Are you saying after {"command":"latest"...} you don't see further messages?

What version were you using previously?

Please provide the docker log as well.

salimj6 commented 2 years ago

I was running on .83 now .85

{result: true, type: "connection_success", message: "You are successfully connected to WebSocket."} message: "You are successfully connected to WebSocket." result: true type: "connection_success" { "command": "latest", "authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoZW50aWNhdGVkQXQiOiIyMDIxLTEwLTIyVDA3OjE2OjU3LjAyMFoiLCJpYXQiOjE2MzQ4ODcwMTcsImV4cCI6MTYzNDg5NDIxN30.dGCiAo8lHNUtWX2Ix3-maRCDlz_VmBNFPHOWX0wX-m4", "data": {} }

i was able to find this error in the logs..

(node:46) UnhandledPromiseRejectionWarning: Error: Request failed with status code 429 at createError (/srv/node_modules/axios/lib/core/createError.js:16:15) at settle (/srv/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/srv/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (events.js:412:35) at endReadableNT (internal/streams/readable.js:1334:12) at processTicksAndRejections (internal/process/task_queues.js:82:21) (node:46) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 96) {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"binance","level":30,"candle":{"eventType":"kline","eventTime":1636465486062,"symbol":"RVNUSDT","startTime":1636465440000,"closeTime":1636465499999,"firstTradeId":30840266,"lastTradeId":30840301,"open":"0.14071000","high":"0.14077000","low":"0.14060000","close":"0.14072000","volume":"26754.30000000","trades":36,"interval":"1m","isFinal":false,"quoteVolume":"3763.74096600","buyVolume":"16948.90000000","quoteBuyVolume":"2384.59059200"},"msg":"Received new candle","time":"2021-11-09T13:44:38.762Z","v":0} (node:46) UnhandledPromiseRejectionWarning: Error: Request failed with status code 429 at createError (/srv/node_modules/axios/lib/core/createError.js:16:15) at settle (/srv/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/srv/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (events.js:412:35) at endReadableNT (internal/streams/readable.js:1334:12) at processTicksAndRejections (internal/process/task_queues.js:82:21) (node:46) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 98) {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"binance","level":30,"candle":{"eventType":"kline","eventTime":1636465486081,"symbol":"BTCUSDT","startTime":1636465440000,"closeTime":1636465499999,"firstTradeId":1137080545,"lastTradeId":1137081506,"open":"67743.84000000","high":"67800.00000000","low":"67738.66000000","close":"67799.99000000","volume":"14.23779000","trades":962,"interval":"1m","isFinal":false,"quoteVolume":"964840.60269590","buyVolume":"6.87863000","quoteBuyVolume":"466142.45598630"},"msg":"Received new candle","time":"2021-11-09T13:44:38.780Z","v":0} {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"cronjob","job":"trailingTradeIndicator","uuid":"4fb936b9-bc45-4dcb-8bb6-a2715984353e","level":30,"apiInfo":{"spot":{"usedWeight1m":"1754"},"futures":{}},"msg":"API info","time":"2021-11-09T13:44:39.000Z","v":0} {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"cronjob","job":"trailingTradeIndicator","uuid":"4fb936b9-bc45-4dcb-8bb6-a2715984353e","helper":"mongo","funcName":"findOne","level":30,"collectionName":"trailing-trade-common","query":{"key":"configuration"},"msg":"Finding document from MongoDB","time":"2021-11-09T13:44:39.000Z","v":0} {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"cronjob","job":"trailingTrade","uuid":"4b89e995-5b29-4600-bf05-b4554c3981bb","helper":"mongo","funcName":"findOne","level":30,"collectionName":"trailing-trade-common","query":{"key":"configuration"},"msg":"Finding document from MongoDB","time":"2021-11-09T13:44:39.001Z","v":0}

salimj6 commented 2 years ago

i am getting this error now: {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"cronjob","job":"trailingTrade","uuid":"113ce99f-62dc-463e-a936-d9cd97f49a3a","level":50,"err":{"message":"Way too much request weight used; IP banned until 1636468559118. Please use the websocket for live updates to avoid bans.","name":"Error","stack":"Error: Way too much request weight used; IP banned until 1636468559118. Please use the websocket for live updates to avoid bans.\n at /srv/node_modules/binance-api-node/dist/http-client.js:93:17\n at runMicrotasks ()\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at async cacheExchangeSymbols (/srv/dist/server.js:1:51774)\n at async execute (/srv/dist/server.js:1:1663)\n at async /srv/dist/server.js:1:111689\n at async CronJob. (/srv/dist/server.js:1:111527)","code":-1003},"errorCode":-1003,"msg":"⚠ Execution failed.","time":"2021-11-09T14:06:02.410Z","v":0} {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"cronjob","job":"trailingTrade","uuid":"113ce99f-62dc-463e-a936-d9cd97f49a3a","level":30,"apiInfo":{"spot":{"usedWeight1m":"469"},"futures":{}},"msg":"API info","time":"2021-11-09T14:06:02.411Z","v":0} {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"level":30,"tag":"slack-send-message","text":"Execution failed (14:06:02.411)\nJob: Trailing Trade\nCode: -1003\nMessage:Way too much request weight used; IP banned until 1636468559118. Please use the websocket for live updates to avoid bans.\n- Current API Usage: 469","msg":"Send slack message","time":"2021-11-09T14:06:02.411Z","v":0} {"name":"binance-api","version":"0.0.85","hostname":"e925e3a6fbaa","pid":46,"gitHash":"55d7027","server":"binance","level":30,"candle":{"eventType":"kline","eventTime":1636466769783,"symbol":"SOLUSDT","startTime":1636466760000,"closeTime":1636466819999,"firstTradeId":178501389,"lastTradeId":178501445,"open":"245.67000000","high":"245.68000000","low":"245.60000000","close":"245.63000000","volume":"121.05000000","trades":57,"interval":"1m","isFinal":false,"quoteVolume":"29734.85070000","buyVolume":"40.00000000","quoteBuyVolume":"9825.70180000"},"msg":"Received new candle","time":"2021-11-09T14:06:02.463Z","v":0} ^C

chrisleekr commented 2 years ago

i have the same setup on a second machine,

You mentioned you have a second machine. Your API/IP got restricted by Binance. You will need to turn off one machine or use different IP.

Please close the issue if your issue is resolved.

salimj6 commented 2 years ago

the second machine works on a different account with a different API.

on a second note, now the error is image

chrisleekr commented 2 years ago

@salimj6

https://www.binance.com/en/support/faq/360004492232 For the hard-limits, exceeding the total request weight per minute limit (currently 1,200) will result in an IP ban. The order limits (currently it is 50 times/10 seconds and 160,000 times/24 hours) will be dependent on the account. If the order limit has been exceeded, users will also be restricted from creating new orders on the website (or our other applications).

For the error, follow the steps again.

salimj6 commented 2 years ago

Hi @chrisleekr

the bot is back online, but the typeErrors are still there. Different on each machine errors.txt

chrisleekr commented 2 years ago

@salimj6

Have you followed the steps?

https://github.com/chrisleekr/binance-trading-bot/releases/tag/v0.0.83

If you followed and still get the error, then for some reason your configuration messed up.

I suggest starting with a fresh installation

$ docker-compose -f docker-compose.server.yml down -v
$ docker-compose -f docker-compose.server.yml up -d

Note that the above is deleting all data.