djmelik / lndash

A simple web dashboard for lnd.
https://lightninglayer.com
GNU General Public License v3.0
118 stars 16 forks source link

Cannot open Events page, probably due to not having any inbound events? #5

Closed sethforprivacy closed 5 years ago

sethforprivacy commented 5 years ago

First off, love the dashboard! Nice to have a simple way to locally visualize my node. I did run into one issue though -- when I try to go to the "Events" tab, it fails with a 500 every time. I'm wondering if it's because I have never routed payments through my node, but merely used it for outbound payments so far? This is the error I get each time:


Traceback (most recent call last):
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/xmr/build/lndash/main.py", line 274, in events
    return render_template('events.html', **content)
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/flask/templating.py", line 135, in render_template
    context, ctx.app)
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/flask/templating.py", line 117, in _render
    rv = template.render(context)
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/xmr/build/lndash/venv/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/xmr/build/lndash/templates/events.html", line 2, in top-level template code
    {% extends "layout.html" %}
  File "/home/xmr/build/lndash/templates/layout.html", line 45, in top-level template code
    {% block body %}
  File "/home/xmr/build/lndash/templates/events.html", line 73, in block "body"
    range: [0, {{ events_stats.maximum.events * 2 }}],
UndefinedError: 'int object' has no attribute 'events'
djmelik commented 5 years ago

Thanks for opening this issue. You are correct, the template fails due to no routed payments.

I have been aware of this issue. Fix is coming shortly.

djmelik commented 5 years ago

This is now fixed, the events page should no longer result in a 500 error. It should now read:

"This lightning node has not routed any payments yet. Please check back later."

Can you test the changes?

ErwanLetard commented 5 years ago

Confirmed ! "OVERVIEW This lightning node has not routed any payments yet. Please check back later."

djmelik commented 5 years ago

Thanks Erwan, I also verified this with one of my other nodes that currently has no forwarding events and it works as expected. I think it's safe to resolve this issue.