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

Bot stuck with 'Cannot read property 'minNotional' of undefined' after every reboot #622

Closed
0xQuartizer opened this issue Apr 12, 2023 · 16 comments · Fixed by #623
Closed
Labels
bug Something isn't working

Comments

@0xQuartizer
Copy link

Version

v0.0.97 (53a3def)

Description

  • Slackbot give the following error:
(10:08:51.003) Uncaught Exception:
If you see this, kindly report it to: https://github.com/chrisleekr/binance-trading-bot/issues/new?assignees=&labels=bug&template=bug_report.md&title=
Code: undefined
Message:
Cannot read property 'minNotional' of undefined
- Current API Usage: 20
  • In the bot UI pairs seem stuck
  • After reboot there's no value update on both pairs (displays the stuck values as before)
  • Closed Trades panel on infinite loop

To Reproduce

Not sure how to reproduce

Expected Behaviours

  • In the bot UI pairs seem stuck.
  • Closed Trades panel on infinite loop

Screenshots

IMG_1494
Screenshot 2023-04-12 at 12 18 57

Additional context

  • Two pairs only atm: BTC-TUSD / ETH-TUSD
  • Running on rasberry pi without issues for a few months;
  • Had to run mongod repair due to power going down last night. Done this several times in the past and never had this issue;
@0xQuartizer 0xQuartizer added the bug Something isn't working label Apr 12, 2023
@rando128
Copy link
Contributor

It seems Binance API got updated today. Not restarting the bot is the best option currently.

If you run the dev version on your server, you can get around it by changing line 72 of app/cronjob/trailingTradeHelper/common.js to:

minNotional: minNotionalFilter !== undefined ? parseFloat(minNotionalFilter.minNotional) : symbol.minNotional

Otherwise you have to wait for @chrisleekr to issue a patch release.

@chrisleekr
Copy link
Owner

Patch is on the way

@rando128
Copy link
Contributor

rando128 commented Apr 12, 2023

Hold on @chrisleekr. There is more ramifications to this on the trailing jobs. Binance change is quite impactful actually. That's weird.

@chrisleekr
Copy link
Owner

Yeah, now there is no MIN_NOTIONAL filter. It has NOTIONAL.

{
          "filterType": "NOTIONAL",
          "minNotional": "0.10000000",
          "applyMinToMarket": true,
          "maxNotional": "10000.00000000",
          "applyMaxToMarket": false,
          "avgPriceMins": 1
        }

@rando128
Copy link
Contributor

rando128 commented Apr 12, 2023

Even with patch on line 72, I've got additional issues:

    TypeError: Cannot read property 'minNotional' of undefined
        at /srv/app/cronjob/trailingTradeHelper/configuration.js:582:34

I can't figure out why though. Maybe related to something cached already.

@chrisleekr
Copy link
Owner

chrisleekr commented Apr 12, 2023

Because symbol does not have minNotional. Wait for my patch. :)
I just need a test.

@chrisleekr chrisleekr linked a pull request Apr 12, 2023 that will close this issue
@chrisleekr chrisleekr reopened this Apr 12, 2023
@chrisleekr
Copy link
Owner

@rando128 The patch is merged. You can test it with the master branch.
If it's working, let me know. I will release a new version.

@rando128
Copy link
Contributor

It's strange for Binance to make such a change without an official release (no mention of it in their changelog). Are they purposely trying to break bots in the current market state? 😅

I'll test the patch on one of my installs. Smart from you @chrisleekr for checking both MIN_NOTIONAL and NOTIONAL as they could rollback to the previous behaviour at any time.

@rando128
Copy link
Contributor

@chrisleekr, I'm getting the following error both on an install with existing transactions and a fresh install:

[2023-04-12T15:00:54.008Z] ERROR: binance-api/87 on 1e139057a5d2: Cannot read property 'minNotional' of undefined (version=0.0.97, gitHash=unspecified)
    TypeError: Cannot read property 'minNotional' of undefined
        at /srv/app/cronjob/trailingTradeHelper/configuration.js:582:34
        at Array.forEach (<anonymous>)
        at /srv/app/cronjob/trailingTradeHelper/configuration.js:570:7
        at Array.map (<anonymous>)
        at getGridTradeBuy (/srv/app/cronjob/trailingTradeHelper/configuration.js:557:34)
        at /srv/app/cronjob/trailingTradeHelper/configuration.js:918:9
        at Array.forEach (<anonymous>)
        at getConfiguration (/srv/app/cronjob/trailingTradeHelper/configuration.js:913:7)
        at async setupCandlesWebsocket (/srv/app/binance/candles.js:30:33)
        at async Promise.all (index 1)
        at async setupWebsockets (/srv/app/server-binance.js:42:3)
        at async syncAll (/srv/app/server-binance.js:112:3)
        at async setupBinance (/srv/app/server-binance.js:183:3)
        at async runBinance (/srv/app/server-binance.js:199:3)
        at async Promise.all (index 0)
        at async /srv/app/server.js:19:3
[2023-04-12T15:01:13.985Z] ERROR: binance-api/87 on 1e139057a5d2: Failed to run the job within 20000ms. (version=0.0.97, gitHash=unspecified, server=cronjob, job=trailingTradeIndicator, uuid=c86909f5-1aaf-4a92-8463-5524e3b2af87, tag=job-timeout)

@chrisleekr
Copy link
Owner

chrisleekr commented Apr 12, 2023

@rando128 I just pushed to clear the cache on migration.
Please rebuild the docker image and restart the bot.

Ok, it looks like something else is going on. Let me dig.

@rando128
Copy link
Contributor

Yeah, still having the problem. Probably because of the remaining reference to MIN_NOTIONAL :

f => f.filterType === 'MIN_NOTIONAL'

@chrisleekr
Copy link
Owner

Yap, I found it. Another patch on the way.

@chrisleekr
Copy link
Owner

chrisleekr commented Apr 12, 2023

@rando128 The fix has been pushed directly to the master branch.

You were right. The issue was the remaining reference.

Fixed with the changes as below
52146c5

@rando128
Copy link
Contributor

Working fine now! What a ride 😅

@chrisleekr
Copy link
Owner

Good, let me release. 😥

@chrisleekr
Copy link
Owner

Released the fix. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants