Coder Social home page Coder Social logo

Dashboard about gryphon HOT 11 OPEN

garethdmm avatar garethdmm commented on August 30, 2024
Dashboard

from gryphon.

Comments (11)

garethdmm avatar garethdmm commented on August 30, 2024

I don't know what webpack is, but it isn't part of Gryphon (a grep in the repo will say the same). As well, the GDS warning there is innocuous.

Where are you navigating to with your browser? With gryphon-dashboards running you should be able to navigate to localhost:8080 and see the login screen at least.

Also, the process just pauses after those lines you posted, right? It doesn't instant quit back to the terminal?

from gryphon.

mattstone avatar mattstone commented on August 30, 2024

ah.. thanks.

This page https://gryphon.readthedocs.io/en/latest/dashboards.html

Has this line.

Point your web browser at localhost:8000 and you should see this login screen:

I develop with Vue & React & had another browser window pointing at 8080 - hence the message I was getting.

from gryphon.

garethdmm avatar garethdmm commented on August 30, 2024

Just to be clear it does work with localhost:8080?

I think changing the default port may have been a late change before release, I'll update the docs and mention this issue in the PR.

from gryphon.

mattstone avatar mattstone commented on August 30, 2024

Hi Gareth.

Yep it loads and I can login.

I've run the Simple Market Making Strategy for awhile, then attempted to select this from the Trading Menu. This is the error that occurs.

ERROR:tornado.application:Exception in exception handler
Traceback (most recent call last):
File "/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/tornado/web.py", line 1597, in _execute
self._handle_request_exception(e)
File "/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/tornado/web.py", line 1650, in _handle_request_exception
self.send_error(500, exc_info=sys.exc_info())
File "/Users/matt/projects/internetschminternet/gryphon/gryphon-master/gryphon/dashboards/handlers/base.py", line 48, in send_error
print str(vars(status_code))
TypeError: vars() argument must have dict attribute

I'll poke around in the source tonight and see if I can workout what is going on.

from gryphon.

garethdmm avatar garethdmm commented on August 30, 2024

That does look like you're getting a 500, but the actual stack trace is being hidden because there's an error in the exception handler. Any chance you added a print statement in base.py at line 48?

print str(vars(status_code))

from gryphon.

mattstone avatar mattstone commented on August 30, 2024

Thanks Gareth.

This is actually the error before the above one - I'll add the print statement as you ask tonight.

INFO:gryphon.dashboards.app:Could not find a gds credential, orderbook and other dashboards won't be operational
INFO:root:200 GET / (::1) 221.95ms - PRETTY SLOW
/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py:242: SAWarning: Unicode type received non-unicode bind param value 'SIMPLE_MM'. (this warning may be suppressed after 10 occurrences)
(util.ellipses_string(value),))
ERROR:tornado.application:Uncaught exception GET /strategies/simple_mm (::1)
HTTPServerRequest(protocol='http', host='localhost:8080', method='GET', uri='/strategies/simple_mm', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/tornado/web.py", line 1590, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/tornado/web.py", line 3006, in wrapper
return method(self, *args, **kwargs)
File "/Users/matt/projects/internetschminternet/gryphon/gryphon-master/gryphon/dashboards/handlers/strategies/strategy.py", line 63, in get
self.render_template('strategy.html', args=template_args)
File "/Users/matt/projects/internetschminternet/gryphon/gryphon-master/gryphon/dashboards/handlers/admin_base.py", line 109, in render_template
return self.render(template, **kwargs)
File "/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/tornado/web.py", line 766, in render
html = self.render_string(template_name, **kwargs)
File "/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/tornado/web.py", line 907, in render_string
return t.generate(**namespace)
File "/Users/matt/projects/internetschminternet/gryphon/venv/lib/python2.7/site-packages/tornado/template.py", line 346, in generate
return execute()
File "templates/strategy_html.generated.py", line 107, in _tt_execute
_tt_tmp = '%s %.2f' % (args['open_pl'].currency, args['open_pl'].amount) # templates/strategy.html:51 (via templates/base.html:207)
AttributeError: 'NoneType' object has no attribute 'currency'

from gryphon.

garethdmm avatar garethdmm commented on August 30, 2024

Hmm ok, let me take a closer look at this tomorrow morning.

from gryphon.

garethdmm avatar garethdmm commented on August 30, 2024

After a quick refresher on this, this is a known issue with a simple fix I've had in a branch for about a month. The issue is that open_pl in the strategy handler isn't initialized with a default value, so if the strategy has no trading history (or, I think, only a single trade such that you can't calculate a realized p&l for it), the page will error.

I'll try to merge those changes this weekend, but in the meantime if you want to fix it in your version and create a patch back to the repo, that would be appreciated too!

from gryphon.

garethdmm avatar garethdmm commented on August 30, 2024

@mattstone #38 is in progress and has multiple dashboard fixes including I believe the fix for your Nonetype issue. It'll be into master in the next day or two.

The specific fix is in this commit: 2fd690f

from gryphon.

mattstone avatar mattstone commented on August 30, 2024

Thanks for following this up.

from gryphon.

Lz-Gustavo avatar Lz-Gustavo commented on August 30, 2024

Just faced this same issue today while trying to monitor some simple strategies on the dashboard. Managed to avoid it by adding a simple if statement on template/strategy.html line 51, as shown below. Then noticed #47 commit 2fd690f with a much better solution already implemented.

{% if args['open_pl'] %}
  <h3>{{ '%s %.2f' % (args['open_pl'].currency, args['open_pl'].amount) }}</h3>
{% end %}

So, if the branch is ok, could you please merge dashboard_overhaul when possible? Just merged locally without any conflict resolution.

from gryphon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.