Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Web UI causes an error #1574

Closed
theposs101 opened this issue May 1, 2018 · 6 comments
Closed

Web UI causes an error #1574

theposs101 opened this issue May 1, 2018 · 6 comments

Comments

@theposs101
Copy link

theposs101 commented May 1, 2018

System information

  • Have I written custom code (as opposed to using zenbot vanilla): No

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04

  • Zenbot version (commit ref, or version): 4.1.0

  • Zenbot branch: unstable

  • NodeJS version: 10.0.0

  • Python version (when using a python script): N/A

  • Exact command to reproduce (include everything): ./zenbot.sh trade --paper --order_type="taker" --conf /root/configs/zenbot/btc-usdt-conf.js --period=55m --trend_ema=34 --neutral_rate=auto --currency_capital 100 --asset_capital 0.08

  • Did I make any changes to conf-sample.js?: Yes, https://pastebin.com/iUqvQ7x9

Describe the problem

Zenbot throws an error when trying to access the Web UI. It does not crash the bot, but freezes for about 15 seconds and then throws an error when you load the Web UI, and in the bot log.

Source code / Error logs

RangeError: Invalid string length
    at JSON.stringify (<anonymous>)
    at /root/zenbot/extensions/output/api.js:37:35
    at Layer.handle [as handle_request] (/root/zenbot/node_modules/express/lib/router/layer.js:95:5)
    at next (/root/zenbot/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/root/zenbot/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/root/zenbot/node_modules/express/lib/router/layer.js:95:5)
    at /root/zenbot/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/root/zenbot/node_modules/express/lib/router/index.js:335:12)
    at next (/root/zenbot/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/root/zenbot/node_modules/express/lib/middleware/init.js:40:5)
@theposs101
Copy link
Author

theposs101 commented May 1, 2018

Also get this error about 30 seconds after the first error

RangeError: Invalid string length
    at JSON.stringify (<anonymous>)
    at /root/zenbot/extensions/output/api.js:37:35
    at Layer.handle [as handle_request] (/root/zenbot/node_modules/express/lib/router/layer.js:95:5)
    at next (/root/zenbot/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/root/zenbot/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/root/zenbot/node_modules/express/lib/router/layer.js:95:5)
    at /root/zenbot/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/root/zenbot/node_modules/express/lib/router/index.js:335:12)
    at next (/root/zenbot/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/root/zenbot/node_modules/express/lib/middleware/init.js:40:5)
An error occurred { Error: binance GET https://api.binance.com/api/v1/aggTrades?symbol=BTCUSDT&startTime=1525197724466&endTime=1525201324466 request timed out (10000 ms)
    at timeout.catch.e (/root/zenbot/node_modules/ccxt/js/base/Exchange.js:326:27)
    at process._tickCallback (internal/process/next_tick.js:178:7) constructor: [Function: RequestTimeout] }

@defkev
Copy link
Contributor

defkev commented May 1, 2018

Just a wild guess but RangeError: Invalid string length could be the system running out of memory will deep cloning the config object.

@theposs101
Copy link
Author

Tried adding --max-old-space-size=8192 to the script, made no difference. Still getting the same error when I try to access the web UI,

@theposs101
Copy link
Author

Weird, removing —period from the startup script lets the web ui open...

I’m gonna close for now.

@defkev
Copy link
Contributor

defkev commented May 2, 2018

Just tried this on my dev box using current unstable and i am not able to reproduce it, even after upgrading to node 10

So unless you got anything fancy in your btc-usdt-conf.js overrides i still suspect you are running OOM, especially since the selector returns quite a number of trades, around 190k 😮

@theposs101
Copy link
Author

Yeah, --period=55m was causing my error. Once I removed that from my startup script, I had no issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants