binance-trading-bot
binance-trading-bot copied to clipboard
Binance trading bot is kept loading after logging in with password
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.
Hello @hiraobayed329
Please take a screenshot of your browser console log and paste it here.
@habibalkhabbaz
Hello @hiraobayed329
Sorry, I meant the console log of your browser.
@habibalkhabbaz did you mean that?
Yes exactly. It seems there is no issue in the frontend. Could you please check your Docker container logs?
@habibalkhabbaz I am checking the log and its looks good

Don't understand what to do!!!
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
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
Still the bot not working. I am not getting any help. There is not even any tutorial available. Please help me fixing the issue.
@habibalkhabbaz
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 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
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 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 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.
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.
replace const accountInfo = JSON.parse(cacheTrailingTradeCommon['account-info']); to const accountInfo = {}
and reload docker compose
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?
accountInfo
I have the same problem
I changed it to const accountInfo = {}; and i had the same error
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.