Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binance trading bot is kept loading after logging in with password #529

Open
hiraobayed329 opened this issue Oct 20, 2022 · 22 comments
Open
Labels
question Further information is requested

Comments

@hiraobayed329
Copy link

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 hiraobayed329 added the question Further information is requested label Oct 20, 2022
@habibalkhabbaz
Copy link
Contributor

Hello @hiraobayed329

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

@hiraobayed329
Copy link
Author

hiraobayed329 commented Oct 20, 2022

@habibalkhabbaz
image

@habibalkhabbaz
Copy link
Contributor

Hello @hiraobayed329

Sorry, I meant the console log of your browser.

@hiraobayed329
Copy link
Author

@habibalkhabbaz did you mean that?
image

@habibalkhabbaz
Copy link
Contributor

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

@hiraobayed329
Copy link
Author

@habibalkhabbaz I am checking the log and its looks good

@hiraobayed329
Copy link
Author

image

@hiraobayed329
Copy link
Author

Don't understand what to do!!!

@habibalkhabbaz
Copy link
Contributor

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.

@hiraobayed329
Copy link
Author

hiraobayed329 commented Oct 21, 2022

@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
Copy link
Author

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
Copy link
Author

@habibalkhabbaz

@habibalkhabbaz
Copy link
Contributor

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.

@hiraobayed329
Copy link
Author

hiraobayed329 commented Oct 27, 2022

@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 #529 (comment)

@habibalkhabbaz
Copy link
Contributor

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:

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

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.

@hiraobayed329
Copy link
Author

@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.

@chrisleekr
Copy link
Owner

@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.

@ViniciusReno
Copy link

ViniciusReno commented Nov 16, 2022

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.

@RealAyyo
Copy link

RealAyyo commented Dec 4, 2022

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

and reload docker compose

@COLOC-BOB
Copy link

COLOC-BOB commented Dec 17, 2022

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?

@alexmdcampo
Copy link

accountInfo

I have the same problem

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

@dasbts
Copy link

dasbts commented May 9, 2023

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 #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants