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

zenbot trade web page url not working #1176

Closed
kbfifi opened this issue Jan 19, 2018 · 9 comments
Closed

zenbot trade web page url not working #1176

kbfifi opened this issue Jan 19, 2018 · 9 comments

Comments

@kbfifi
Copy link

kbfifi commented Jan 19, 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):
    Odroid C2, DietPi
  • Zenbot version:
    4.1.0
  • NodeJS version:
    8.4.0
  • Python version:
    2.7.9
  • Exact command to reproduce:
    **I use binance API
    Run zenbot trade of trade --paper
    Start browser with displayed url. (has random port)

Problem 1:
http://192.168.178.28:20099/
Shows a blank screen without error. What is supposed to be shown?

http://192.168.178.28:20099/trades
Seems to work.

Problem 2:
http://192.168.178.28:20099/stats
Error: ENOENT: no such file or directory, stat '/root/zenbot/extensions/output../stats/index.html'
This can easily be fixed by adapting the path in de source code (Saw this similar issue before)**

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in Zenbot or a feature request.
The default url should show something. Other url shows error.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
Don't know where to find.

@defkev
Copy link
Contributor

defkev commented Jan 19, 2018

/ displays the dashboard, what does the browser console say? 404?

/trades is the API backend

/stats for now is only showing a static html page with old statistics.

@kbfifi
Copy link
Author

kbfifi commented Jan 20, 2018

It says:
GET
http://192.168.178.28:20099/
[HTTP/1.1 200 OK 708ms]
GET
https://pushstream.tradingview.com/message-pipe-ws/public
[HTTP/1.1 101 Switching Protocols 634ms]
Firefox can't establish a connection to the server at wss://pushstream.tradingview.com/message-pipe-ws/public.
63f64022-81a3-45d9-8e16-7355a547544e:164:43
The connection to wss://pushstream.tradingview.com/message-pipe-ws/public was interrupted while the page was loading.

So I guess I need to configure something for pushstream.tradingview.com to work?

@defkev
Copy link
Contributor

defkev commented Jan 20, 2018

200 is good
The tradingview.com widget should be loaded inside an iframe but the websocket connection is failing for whatever reason.
This doesn't really sound like a problem with zen but Firefox, are you running any adblocker or content filter in FF?

@kbfifi
Copy link
Author

kbfifi commented Jan 20, 2018

Good point! I tried it with out adblocker: Still blank screen. Console output:
GET
http://192.168.178.28:20000/
[HTTP/1.1 304 Not Modified 18ms]
GET
http://192.168.178.28:20000/assets-wp/app.bundle.js
[HTTP/1.1 404 Not Found 6ms]
GET
https://s3.tradingview.com/tv.js
[HTTP/2.0 304 Not Modified 25ms]
Empty string passed to getElementById().
tv.js:1:372
GET
http://192.168.178.28:20000/assets-wp/app.bundle.js
[HTTP/1.1 404 Not Found 6ms]
GET
https://s.tradingview.com/widgetembed/
[HTTP/2.0 200 OK 22ms]
Loading failed for the <script> with source “http://192.168.178.28:20000/assets-wp/app.bundle.js”.
192.168.178.28:20000:212
GETXHR
https://api.coinmarketcap.com/v1/ticker/
[HTTP/2.0 200 OK 21ms]
GET
https://s-new.tradingview.com/static/bundles/css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css
[HTTP/2.0 200 OK 0ms]
GET
https://s-new.tradingview.com/static/lib/external/spin.min.js
[HTTP/2.0 200 OK 0ms]
GET
https://s-new.tradingview.com/static/bundles/vendors_embed.8ce75dee81c786efb4d9.5c88002e49bc.js
[HTTP/2.0 200 OK 0ms]
GET
https://s-new.tradingview.com/static/bundles/vendors_embed.a94ef44ed5c201cefcf6ad7460788c1a.a94ef44ed5c2.css
[HTTP/2.0 200 OK 0ms]
GET
https://s-new.tradingview.com/static/bundles/embed_i18n_embed.0183d68eb4480bd3a5b8.6542dc20ffd8.js
[HTTP/2.0 200 OK 0ms]
GET
https://s-new.tradingview.com/static/bundles/embed_embed_widget.bb465443b0ae68030cc0.b5941da3c8b8.js
[HTTP/2.0 200 OK 0ms]
GET
https://s-new.tradingview.com/static/bundles/embed_widget.241950a4253798217bd7ac85b3ba702b.241950a42537.css
[HTTP/2.0 200 OK 0ms]
GET
https://widgetdata.tradingview.com/socket.io/websocket
[HTTP/1.1 101 Switching Protocols 472ms]
Error in parsing value for '-webkit-text-size-adjust'. Declaration dropped.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:131
Unknown pseudo-class or pseudo-element '-webkit-inner-spin-button'. Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:1547
Unknown pseudo-class or pseudo-element '-webkit-search-cancel-button'. Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:1722
Unknown pseudo-class or pseudo-element 'selection'. Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:16047
Unknown pseudo-class or pseudo-element 'selection'. Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:16156
Unknown property 'user-select'. Declaration dropped.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:19122
Unknown property 'appearance'. Declaration dropped.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:19207
Unknown pseudo-class or pseudo-element '-ms-clear'. Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:38898
Unknown property 'user-select'. Declaration dropped.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:39114
Unknown property 'user-select'. Declaration dropped.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:39562
Unknown property 'user-select'. Declaration dropped.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:50613
Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:51617
Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:51841
Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:52054
Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:52272
Ruleset ignored due to bad selector.
css_embed_widget.9a10b3751a1e99d1e69e6a3b26656740.9a10b3751a1e.css:1:52506
Ruleset ignored due to bad selector.

Also tried with Chrome and the screen's blank as well. Console output:
192.168.178.28/:25 GET http://192.168.178.28:20000/assets-wp/app.bundle.js net::ERR_ABORTED
(index):212 GET http://192.168.178.28:20000/assets-wp/app.bundle.js net::ERR_ABORTED
(index):212 GET http://192.168.178.28:20000/assets-wp/app.bundle.js net::ERR_ABORTED

@defkev
Copy link
Contributor

defkev commented Jan 21, 2018

http://192.168.178.28:20000/assets-wp/app.bundle.js [HTTP/1.1 404 Not Found 6ms]

Your app.bundle is missing...

Run npm install in /zenbot per README.md

@kbfifi
Copy link
Author

kbfifi commented Jan 21, 2018

Hmm I read README and followed the steps. When I do it again:
npm install
npm WARN lifecycle zenbot4@4.1.0~postinstall: cannot run in wd %s %s (wd=%s) zenbot4@4.1.0 node post_install.js /root/zenbot
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})

added 158 packages, removed 12 packages and updated 15 packages in 75.873s

Googled a bit then retried with:
npm install --unsafe-perm

zenbot4@4.1.0 postinstall /root/zenbot
node post_install.js

removing node_modules/forex.analytics/.git
bundling WebApp components
Hash: 785227128699e26d9ee2
Version: webpack 3.10.0
Time: 67218ms
Asset Size Chunks Chunk Names
app.bundle.js 549 kB 0 [emitted] [big] app
[3] (webpack)/buildin/global.js 509 bytes {0} [built]
[4] ./node_modules/css-loader!./templates/dashboard_assets/css/spinners.css 896 bytes {0} [built]
[5] ./webpack-src/js/app.js 563 bytes {0} [built]
[15] ./templates/dashboard_assets/js/custom.js 3.33 kB {0} [built]
[16] ./templates/dashboard_assets/js/jquery.slimscroll.js 6.01 kB {0} [built]
[17] ./templates/dashboard_assets/css/style.css 1.03 kB {0} [built]
[18] ./node_modules/css-loader!./templates/dashboard_assets/css/style.css 171 kB {0} [built]
[19] ./templates/dashboard_assets/css/spinners.css 1.04 kB {0} [built]
[20] ./templates/dashboard_assets/css/animate.css 1.04 kB {0} [built]
[21] ./node_modules/css-loader!./templates/dashboard_assets/css/animate.css 54.6 kB {0} [built]
[22] ./templates/dashboard_assets/css/colors/default.css 1.05 kB {0} [built]
[23] ./node_modules/css-loader!./templates/dashboard_assets/css/colors/default.css 2.48 kB {0} [built]
+ 12 hidden modules
installing genetic_backtester components
npm WARN zenbot4_auto_backtester@0.2.0 No repository field.
npm WARN zenbot4_auto_backtester@0.2.0 No license field.

added 105 packages in 14.671s
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})

added 115 packages and updated 1 package in 167.076s

And now it's working!! Any comments on the --unsafe-perm? Better solution?

@kbfifi
Copy link
Author

kbfifi commented Jan 21, 2018

That leaves the /stats url:
change zenbot/extensions/output/api.js, line 47
from: res.sendFile(path.join(__dirname+'../../../stats/index.html'));
to: res.sendFile(path.join(__dirname+'/../../stats/index.html'));

Then it works. Is there a way to get from the main page to the stats or trades page?

@defkev
Copy link
Contributor

defkev commented Jan 21, 2018

npm install --unsafe-perm

You are either running npm as root or, as somebody else reported, enforcing selinux.

@DeviaVir
Copy link
Owner

Dear issue reporter,

We have slightly changed our github issue policy and would now kindly request folks that have questions that they ask them in our zenbot subreddit.

You can find it here: https://reddit.com/r/zenbot

This issue will be closed, but if you disagree with your ticket being marked as a question feel free to leave a comment defending your case.

Thanks for contributing time and effort!

Greetings,
🤖

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

No branches or pull requests

3 participants