binance-trading-bot icon indicating copy to clipboard operation
binance-trading-bot copied to clipboard

Binance trading bot is kept loading after logging in with password

Open hiraobayed329 opened this issue 2 years ago • 22 comments

Experts please help me. I have run the trading bot interface in the localhost but the binance trading bot is kept loading for hours but no interface is coming. I have created .env file and added my testnet api key and secret. Please help me.

hiraobayed329 avatar Oct 20 '22 15:10 hiraobayed329

Hello @hiraobayed329

Please take a screenshot of your browser console log and paste it here.

habibalkhabbaz avatar Oct 20 '22 15:10 habibalkhabbaz

@habibalkhabbaz image

hiraobayed329 avatar Oct 20 '22 15:10 hiraobayed329

Hello @hiraobayed329

Sorry, I meant the console log of your browser.

habibalkhabbaz avatar Oct 20 '22 15:10 habibalkhabbaz

@habibalkhabbaz did you mean that? image

hiraobayed329 avatar Oct 20 '22 16:10 hiraobayed329

Yes exactly. It seems there is no issue in the frontend. Could you please check your Docker container logs?

habibalkhabbaz avatar Oct 20 '22 16:10 habibalkhabbaz

@habibalkhabbaz I am checking the log and its looks good

hiraobayed329 avatar Oct 20 '22 16:10 hiraobayed329

image

hiraobayed329 avatar Oct 20 '22 16:10 hiraobayed329

Don't understand what to do!!!

hiraobayed329 avatar Oct 20 '22 16:10 hiraobayed329

Hello @hiraobayed329

I could not see an issue. You may have to restart your Docker container and after that copy the whole log and attach it here.

habibalkhabbaz avatar Oct 20 '22 20:10 habibalkhabbaz

@habibalkhabbaz

The logs are too long to paste in there. Please find the log in the attachment. Do I have to make any change to any file to get the interface showing in the browser? Logs.docx

hiraobayed329 avatar Oct 21 '22 05:10 hiraobayed329

Still the bot not working. I am not getting any help. There is not even any tutorial available. Please help me fixing the issue.

hiraobayed329 avatar Oct 26 '22 10:10 hiraobayed329

@habibalkhabbaz

hiraobayed329 avatar Oct 26 '22 10:10 hiraobayed329

Hello @hiraobayed329

Sorry for late reply.

It will be helpful if you can attach the log as file here so I can scan it because I couldn't see any issues from the screenshots.

habibalkhabbaz avatar Oct 27 '22 07:10 habibalkhabbaz

@habibalkhabbaz Hello brother, Please check the word document above "Logs.docx". There i have included the logs. The log history was too large to paste in here so i have attached a word file for that above. This is the link https://github.com/chrisleekr/binance-trading-bot/issues/529#issuecomment-1286477208

hiraobayed329 avatar Oct 27 '22 22:10 hiraobayed329

Hello @hiraobayed329

Sorry, I just see the log file and I think I found the issue.

{
  "name": "binance-api",
  "version": "0.0.93",
  "hostname": "ede4ce74817c",
  "pid": 45,
  "gitHash": "26a1edc",
  "server": "websocket",
  "payload": {
    "command": "latest",
    "authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoZW50aWNhdGVkQXQiOiIyMDIyLTEwLTIxVDA1OjEwOjEzLjkwNVoiLCJpYXQiOjE2NjYzMjkwMTMsImV4cCI6MTY2NjMzNjIxM30.wLYTTUby8VS_CePDamuU--ctP65f1ct3t2LVNCkF6DI",
    "data": {
      "page": 1,
      "searchKeyword": "",
      "sortBy": "default",
      "sortByDesc": false
    },
    "isAuthenticated": true
  },
  "level": 50,
  "err": {
    "message": "Unexpected token u in JSON at position 0",
    "name": "SyntaxError",
    "stack": "SyntaxError: Unexpected token u in JSON at position 0\n    at JSON.parse (<anonymous>)\n    at Object.handleLatest [as latest] (/srv/dist/server.js:1:119233)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at async WebSocket.<anonymous> (/srv/dist/server.js:1:114883)"
  },
  "msg": "Something wrong with trailing-trade-common cache",
  "time": "2022-10-21T05:15:11.952Z",
  "v": 0
}

For some reason, your account info was not retrieved and it's throwing an error as it is an invalid JSON format.

Here is the code for reference:

https://github.com/chrisleekr/binance-trading-bot/blob/49271ef5993a2c9c579d54bff1d9d81780b99a2f/app/frontend/websocket/handlers/latest.js#L117

I can submit a PR to solve this but still, maybe your frontend will not be updated because no data to retrieve. We have to find the source of the issue first.

Please check your test API keys if they are correct or not.

habibalkhabbaz avatar Oct 28 '22 00:10 habibalkhabbaz

@habibalkhabbaz sorry for my late reply. I have generated new binance test API key and secret. Still the bot is loading but no interface is showing up.

hiraobayed329 avatar Oct 28 '22 09:10 hiraobayed329

@hiraobayed329 I think most likely invalid configuration with your API key.

Are you sure you set the correct mode?

https://github.com/chrisleekr/binance-trading-bot/blob/master/docker-compose.server.yml#L14

If you are using test API key, BINANCE_MODE must be test, not live. If you are using live API key, BINANCE_MODE must be live.

chrisleekr avatar Nov 04 '22 11:11 chrisleekr

I'm having the same problem with the same error log. Perhaps something has changed on Binance's return? The keys are configured correctly and the environment as well.

ViniciusReno avatar Nov 16 '22 18:11 ViniciusReno

replace const accountInfo = JSON.parse(cacheTrailingTradeCommon['account-info']); to const accountInfo = {}

and reload docker compose

RealAyyo avatar Dec 04 '22 03:12 RealAyyo

Bonjour, j'ai le même problème!

remplacer const accountInfo = JSON.parse(cacheTrailingTradeCommon['account-info']); pour const accountInfo = {}

et recharger docker composer

cela ne résoud pas le problème, comment pouvons -nous avancer?

mimich25 avatar Dec 17 '22 14:12 mimich25

accountInfo

I have the same problem

I changed it to const accountInfo = {}; and i had the same error

alexmdcampo avatar Jan 02 '23 14:01 alexmdcampo

I solved this by updating redlock in package.json to latest, migrating the required steps in /binance-trading-bot/app/helpers/cache.js as I described in the last post of https://github.com/chrisleekr/binance-trading-bot/issues/618 and then building a new version with docker-compose, as well as adding a "while True" loop of about 30 retries with a second in between each and breaking the loop if the lock is released. Haven't had anything freeze at all since then.

I could make a PR about it, but not sure how that works with the build of docker-compose since I am building local images, and the non-dev bot is using publically uploaded images.

dasbts avatar May 09 '23 15:05 dasbts